Class ApiHubClient (0.1.0)

GitHub RepositoryProduct Reference

Service Description: This service provides all methods related to the API hub.

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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Api api = Api.newBuilder().build();
   String apiId = "apiId93021397";
   Api response = apiHubClient.createApi(parent, api, apiId);
 }
 

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

Methods
Method Description Method Variants

CreateApi

Create an API resource in the API hub. Once an API resource is created, versions can be added to it.

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

  • createApi(CreateApiRequest request)

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

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

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

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

  • createApiCallable()

GetApi

Get API resource details including the API versions contained in it.

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

  • getApi(GetApiRequest request)

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

  • getApi(ApiName name)

  • getApi(String name)

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

  • getApiCallable()

ListApis

List API resources in the API hub.

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

  • listApis(ListApisRequest request)

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

  • listApis(LocationName parent)

  • listApis(String parent)

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

  • listApisPagedCallable()

  • listApisCallable()

UpdateApi

Update an API resource in the API hub. The following fields in the [API][] can be updated:

  • display_name
  • description
  • owner
  • documentation
  • target_user
  • team
  • business_unit
  • maturity_level
  • attributes

The update_mask should be used to specify the fields being updated.

Updating the owner field requires complete owner message and updates both owner and email fields.

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

  • updateApi(UpdateApiRequest request)

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

  • updateApi(Api api, FieldMask updateMask)

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

  • updateApiCallable()

DeleteApi

Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.

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

  • deleteApi(DeleteApiRequest request)

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

  • deleteApi(ApiName name)

  • deleteApi(String name)

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

  • deleteApiCallable()

CreateVersion

Create an API version for an API resource in the API hub.

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

  • createVersion(CreateVersionRequest request)

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

  • createVersion(ApiName parent, Version version, String versionId)

  • createVersion(String parent, Version version, String versionId)

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

  • createVersionCallable()

GetVersion

Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.

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

  • getVersion(GetVersionRequest request)

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

  • getVersion(VersionName name)

  • getVersion(String name)

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

  • getVersionCallable()

ListVersions

List API versions of an API resource in the API hub.

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

  • listVersions(ListVersionsRequest request)

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

  • listVersions(ApiName parent)

  • listVersions(String parent)

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

  • listVersionsPagedCallable()

  • listVersionsCallable()

UpdateVersion

Update API version. The following fields in the version can be updated currently:

  • display_name
  • description
  • documentation
  • deployments
  • lifecycle
  • compliance
  • accreditation
  • attributes

The update_mask should be used to specify the fields being updated.

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

  • updateVersion(UpdateVersionRequest request)

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

  • updateVersion(Version version, FieldMask updateMask)

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

  • updateVersionCallable()

DeleteVersion

Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.

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

  • deleteVersion(DeleteVersionRequest request)

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

  • deleteVersion(VersionName name)

  • deleteVersion(String name)

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

  • deleteVersionCallable()

CreateSpec

Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of contents or source_uri must be provided. If contents is provided, then spec_type must also be provided.

On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the projects/{project}/locations/{location}/attributes/system-spec-type attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently.

In order to access the information parsed from the spec, use the GetSpec method. In order to access the raw contents for a particular spec, use the GetSpecContents method. In order to access the operations parsed from the spec, use the ListAPIOperations method.

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

  • createSpec(CreateSpecRequest request)

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

  • createSpec(VersionName parent, Spec spec, String specId)

  • createSpec(String parent, Spec spec, String specId)

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

  • createSpecCallable()

GetSpec

Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use GetSpecContents method to retrieve the same.

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

  • getSpec(GetSpecRequest request)

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

  • getSpec(SpecName name)

  • getSpec(String name)

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

  • getSpecCallable()

GetSpecContents

Get spec contents.

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

  • getSpecContents(GetSpecContentsRequest request)

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

  • getSpecContents(SpecName name)

  • getSpecContents(String name)

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

  • getSpecContentsCallable()

ListSpecs

List specs corresponding to a particular API resource.

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

  • listSpecs(ListSpecsRequest request)

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

  • listSpecs(VersionName parent)

  • listSpecs(String parent)

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

  • listSpecsPagedCallable()

  • listSpecsCallable()

UpdateSpec

Update spec. The following fields in the spec can be updated:

  • display_name
  • source_uri
  • lint_response
  • attributes
  • contents
  • spec_type

In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed out from the new spec.

In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present.

The update_mask should be used to specify the fields being updated.

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

  • updateSpec(UpdateSpecRequest request)

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

  • updateSpec(Spec spec, FieldMask updateMask)

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

  • updateSpecCallable()

DeleteSpec

Delete a spec. Deleting a spec will also delete the associated operations from the version.

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

  • deleteSpec(DeleteSpecRequest request)

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

  • deleteSpec(SpecName name)

  • deleteSpec(String name)

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

  • deleteSpecCallable()

GetApiOperation

Get details about a particular operation in API version.

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

  • getApiOperation(GetApiOperationRequest request)

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

  • getApiOperation(ApiOperationName name)

  • getApiOperation(String name)

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

  • getApiOperationCallable()

ListApiOperations

List operations in an API version.

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

  • listApiOperations(ListApiOperationsRequest request)

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

  • listApiOperations(VersionName parent)

  • listApiOperations(String parent)

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

  • listApiOperationsPagedCallable()

  • listApiOperationsCallable()

GetDefinition

Get details about a definition in an API version.

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

  • getDefinition(GetDefinitionRequest request)

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

  • getDefinition(DefinitionName name)

  • getDefinition(String name)

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

  • getDefinitionCallable()

CreateDeployment

Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions.

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

  • createDeployment(CreateDeploymentRequest request)

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

  • createDeployment(LocationName parent, Deployment deployment, String deploymentId)

  • createDeployment(String parent, Deployment deployment, String deploymentId)

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

  • createDeploymentCallable()

GetDeployment

Get details about a deployment and the API versions linked to it.

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

  • getDeployment(GetDeploymentRequest request)

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

  • getDeployment(DeploymentName name)

  • getDeployment(String name)

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

  • getDeploymentCallable()

ListDeployments

List deployment resources in the API hub.

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

  • listDeployments(ListDeploymentsRequest request)

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

  • listDeployments(LocationName parent)

  • listDeployments(String parent)

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

  • listDeploymentsPagedCallable()

  • listDeploymentsCallable()

UpdateDeployment

Update a deployment resource in the API hub. The following fields in the deployment resource can be updated:

  • display_name
  • description
  • documentation
  • deployment_type
  • resource_uri
  • endpoints
  • slo
  • environment
  • attributes

The update_mask should be used to specify the fields being updated.

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

  • updateDeployment(UpdateDeploymentRequest request)

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

  • updateDeployment(Deployment deployment, FieldMask updateMask)

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

  • updateDeploymentCallable()

DeleteDeployment

Delete a deployment resource in the API hub.

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

  • deleteDeployment(DeleteDeploymentRequest request)

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

  • deleteDeployment(DeploymentName name)

  • deleteDeployment(String name)

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

  • deleteDeploymentCallable()

CreateAttribute

Create a user defined attribute.

Certain pre defined attributes are already created by the API hub. These attributes will have type as SYSTEM_DEFINED and can be listed via ListAttributes method. Allowed values for the same can be updated via UpdateAttribute method.

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

  • createAttribute(CreateAttributeRequest request)

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

  • createAttribute(LocationName parent, Attribute attribute, String attributeId)

  • createAttribute(String parent, Attribute attribute, String attributeId)

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

  • createAttributeCallable()

GetAttribute

Get details about the attribute.

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

  • getAttribute(GetAttributeRequest request)

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

  • getAttribute(AttributeName name)

  • getAttribute(String name)

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

  • getAttributeCallable()

UpdateAttribute

Update the attribute. The following fields in the Attribute resource can be updated:

  • display_name The display name can be updated for user defined attributes only.
  • description The description can be updated for user defined attributes only.
  • allowed_values To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource's attribute is deleted, then the association between the resource and the attribute value will also be deleted.
  • cardinality The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update.

The update_mask should be used to specify the fields being updated.

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

  • updateAttribute(UpdateAttributeRequest request)

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

  • updateAttribute(Attribute attribute, FieldMask updateMask)

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

  • updateAttributeCallable()

DeleteAttribute

Delete an attribute.

Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.

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

  • deleteAttribute(DeleteAttributeRequest request)

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

  • deleteAttribute(AttributeName name)

  • deleteAttribute(String name)

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

  • deleteAttributeCallable()

ListAttributes

List all attributes.

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

  • listAttributes(ListAttributesRequest request)

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

  • listAttributes(LocationName parent)

  • listAttributes(String parent)

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

  • listAttributesPagedCallable()

  • listAttributesCallable()

SearchResources

Search across API-Hub resources.

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

  • searchResources(SearchResourcesRequest request)

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

  • searchResources(LocationName location, String query)

  • searchResources(String location, String query)

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

  • searchResourcesPagedCallable()

  • searchResourcesCallable()

CreateExternalApi

Create an External API resource in the API hub.

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

  • createExternalApi(CreateExternalApiRequest request)

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

  • createExternalApi(LocationName parent, ExternalApi externalApi, String externalApiId)

  • createExternalApi(String parent, ExternalApi externalApi, String externalApiId)

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

  • createExternalApiCallable()

GetExternalApi

Get details about an External API resource in the API hub.

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

  • getExternalApi(GetExternalApiRequest request)

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

  • getExternalApi(ExternalApiName name)

  • getExternalApi(String name)

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

  • getExternalApiCallable()

UpdateExternalApi

Update an External API resource in the API hub. The following fields can be updated:

  • display_name
  • description
  • documentation
  • endpoints
  • paths

The update_mask should be used to specify the fields being updated.

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

  • updateExternalApi(UpdateExternalApiRequest request)

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

  • updateExternalApi(ExternalApi externalApi, FieldMask updateMask)

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

  • updateExternalApiCallable()

DeleteExternalApi

Delete an External API resource in the API hub.

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

  • deleteExternalApi(DeleteExternalApiRequest request)

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

  • deleteExternalApi(ExternalApiName name)

  • deleteExternalApi(String name)

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

  • deleteExternalApiCallable()

ListExternalApis

List External API resources in the API hub.

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

  • listExternalApis(ListExternalApisRequest request)

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

  • listExternalApis(LocationName parent)

  • listExternalApis(String parent)

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

  • listExternalApisPagedCallable()

  • listExternalApisCallable()

ListLocations

Lists information about the supported locations for this service.

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

  • listLocations(ListLocationsRequest request)

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

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

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

  • getLocation(GetLocationRequest request)

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

  • getLocationCallable()

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 ApiHubSettings 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
 ApiHubSettings apiHubSettings =
     ApiHubSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ApiHubClient apiHubClient = ApiHubClient.create(apiHubSettings);
 

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
 ApiHubSettings apiHubSettings = ApiHubSettings.newBuilder().setEndpoint(myEndpoint).build();
 ApiHubClient apiHubClient = ApiHubClient.create(apiHubSettings);
 

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
 ApiHubSettings apiHubSettings = ApiHubSettings.newHttpJsonBuilder().build();
 ApiHubClient apiHubClient = ApiHubClient.create(apiHubSettings);
 

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

Inheritance

java.lang.Object > ApiHubClient

Static Methods

create()

public static final ApiHubClient create()

Constructs an instance of ApiHubClient with default settings.

Returns
Type Description
ApiHubClient
Exceptions
Type Description
IOException

create(ApiHubSettings settings)

public static final ApiHubClient create(ApiHubSettings settings)

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

Parameter
Name Description
settings ApiHubSettings
Returns
Type Description
ApiHubClient
Exceptions
Type Description
IOException

create(ApiHubStub stub)

public static final ApiHubClient create(ApiHubStub stub)

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

Parameter
Name Description
stub ApiHubStub
Returns
Type Description
ApiHubClient

Constructors

ApiHubClient(ApiHubSettings settings)

protected ApiHubClient(ApiHubSettings settings)

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

Parameter
Name Description
settings ApiHubSettings

ApiHubClient(ApiHubStub stub)

protected ApiHubClient(ApiHubStub stub)
Parameter
Name Description
stub ApiHubStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

createApi(CreateApiRequest request)

public final Api createApi(CreateApiRequest request)

Create an API resource in the API hub. Once an API resource is created, versions can be added to it.

Sample code:


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

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

Returns
Type Description
Api

createApi(LocationName parent, Api api, String apiId)

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

Create an API resource in the API hub. Once an API resource is created, versions can be added to it.

Sample code:


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

Required. The parent resource for the API resource. Format: projects/{project}/locations/{location}

api Api

Required. The API resource to create.

apiId String

Optional. The ID to use for the API resource, which will become the final component of the API's resource name. This field is optional.

  • If provided, the same will be used. The service will throw an error if the specified id is already used by another API resource in the API hub.
  • If not provided, a system generated id will be used.

This value should be 4-500 characters, and valid characters are /a-z[0-9]-_/.

Returns
Type Description
Api

createApi(String parent, Api api, String apiId)

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

Create an API resource in the API hub. Once an API resource is created, versions can be added to it.

Sample code:


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

Required. The parent resource for the API resource. Format: projects/{project}/locations/{location}

api Api

Required. The API resource to create.

apiId String

Optional. The ID to use for the API resource, which will become the final component of the API's resource name. This field is optional.

  • If provided, the same will be used. The service will throw an error if the specified id is already used by another API resource in the API hub.
  • If not provided, a system generated id will be used.

This value should be 4-500 characters, and valid characters are /a-z[0-9]-_/.

Returns
Type Description
Api

createApiCallable()

public final UnaryCallable<CreateApiRequest,Api> createApiCallable()

Create an API resource in the API hub. Once an API resource is created, versions can be added to it.

Sample code:


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

createAttribute(CreateAttributeRequest request)

public final Attribute createAttribute(CreateAttributeRequest request)

Create a user defined attribute.

Certain pre defined attributes are already created by the API hub. These attributes will have type as SYSTEM_DEFINED and can be listed via ListAttributes method. Allowed values for the same can be updated via UpdateAttribute method.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   CreateAttributeRequest request =
       CreateAttributeRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setAttributeId("attributeId-309887785")
           .setAttribute(Attribute.newBuilder().build())
           .build();
   Attribute response = apiHubClient.createAttribute(request);
 }
 
Parameter
Name Description
request CreateAttributeRequest

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

Returns
Type Description
Attribute

createAttribute(LocationName parent, Attribute attribute, String attributeId)

public final Attribute createAttribute(LocationName parent, Attribute attribute, String attributeId)

Create a user defined attribute.

Certain pre defined attributes are already created by the API hub. These attributes will have type as SYSTEM_DEFINED and can be listed via ListAttributes method. Allowed values for the same can be updated via UpdateAttribute method.

Sample code:


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

Required. The parent resource for Attribute. Format: projects/{project}/locations/{location}

attribute Attribute

Required. The attribute to create.

attributeId String

Optional. The ID to use for the attribute, which will become the final component of the attribute's resource name. This field is optional.

  • If provided, the same will be used. The service will throw an error if the specified id is already used by another attribute resource in the API hub.
  • If not provided, a system generated id will be used.

This value should be 4-500 characters, and valid characters are /a-z[0-9]-_/.

Returns
Type Description
Attribute

createAttribute(String parent, Attribute attribute, String attributeId)

public final Attribute createAttribute(String parent, Attribute attribute, String attributeId)

Create a user defined attribute.

Certain pre defined attributes are already created by the API hub. These attributes will have type as SYSTEM_DEFINED and can be listed via ListAttributes method. Allowed values for the same can be updated via UpdateAttribute method.

Sample code:


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

Required. The parent resource for Attribute. Format: projects/{project}/locations/{location}

attribute Attribute

Required. The attribute to create.

attributeId String

Optional. The ID to use for the attribute, which will become the final component of the attribute's resource name. This field is optional.

  • If provided, the same will be used. The service will throw an error if the specified id is already used by another attribute resource in the API hub.
  • If not provided, a system generated id will be used.

This value should be 4-500 characters, and valid characters are /a-z[0-9]-_/.

Returns
Type Description
Attribute

createAttributeCallable()

public final UnaryCallable<CreateAttributeRequest,Attribute> createAttributeCallable()

Create a user defined attribute.

Certain pre defined attributes are already created by the API hub. These attributes will have type as SYSTEM_DEFINED and can be listed via ListAttributes method. Allowed values for the same can be updated via UpdateAttribute method.

Sample code:


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

createDeployment(CreateDeploymentRequest request)

public final Deployment createDeployment(CreateDeploymentRequest request)

Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   CreateDeploymentRequest request =
       CreateDeploymentRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDeploymentId("deploymentId-136894784")
           .setDeployment(Deployment.newBuilder().build())
           .build();
   Deployment response = apiHubClient.createDeployment(request);
 }
 
Parameter
Name Description
request CreateDeploymentRequest

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

Returns
Type Description
Deployment

createDeployment(LocationName parent, Deployment deployment, String deploymentId)

public final Deployment createDeployment(LocationName parent, Deployment deployment, String deploymentId)

Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Deployment deployment = Deployment.newBuilder().build();
   String deploymentId = "deploymentId-136894784";
   Deployment response = apiHubClient.createDeployment(parent, deployment, deploymentId);
 }
 
Parameters
Name Description
parent LocationName

Required. The parent resource for the deployment resource. Format: projects/{project}/locations/{location}

deployment Deployment

Required. The deployment resource to create.

deploymentId String

Optional. The ID to use for the deployment resource, which will become the final component of the deployment's resource name. This field is optional.

  • If provided, the same will be used. The service will throw an error if the specified id is already used by another deployment resource in the API hub.
  • If not provided, a system generated id will be used.

This value should be 4-500 characters, and valid characters are /a-z[0-9]-_/.

Returns
Type Description
Deployment

createDeployment(String parent, Deployment deployment, String deploymentId)

public final Deployment createDeployment(String parent, Deployment deployment, String deploymentId)

Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Deployment deployment = Deployment.newBuilder().build();
   String deploymentId = "deploymentId-136894784";
   Deployment response = apiHubClient.createDeployment(parent, deployment, deploymentId);
 }
 
Parameters
Name Description
parent String

Required. The parent resource for the deployment resource. Format: projects/{project}/locations/{location}

deployment Deployment

Required. The deployment resource to create.

deploymentId String

Optional. The ID to use for the deployment resource, which will become the final component of the deployment's resource name. This field is optional.

  • If provided, the same will be used. The service will throw an error if the specified id is already used by another deployment resource in the API hub.
  • If not provided, a system generated id will be used.

This value should be 4-500 characters, and valid characters are /a-z[0-9]-_/.

Returns
Type Description
Deployment

createDeploymentCallable()

public final UnaryCallable<CreateDeploymentRequest,Deployment> createDeploymentCallable()

Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   CreateDeploymentRequest request =
       CreateDeploymentRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDeploymentId("deploymentId-136894784")
           .setDeployment(Deployment.newBuilder().build())
           .build();
   ApiFuture<Deployment> future = apiHubClient.createDeploymentCallable().futureCall(request);
   // Do something.
   Deployment response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateDeploymentRequest,Deployment>

createExternalApi(CreateExternalApiRequest request)

public final ExternalApi createExternalApi(CreateExternalApiRequest request)

Create an External API resource in the API hub.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   CreateExternalApiRequest request =
       CreateExternalApiRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setExternalApiId("externalApiId-31672374")
           .setExternalApi(ExternalApi.newBuilder().build())
           .build();
   ExternalApi response = apiHubClient.createExternalApi(request);
 }
 
Parameter
Name Description
request CreateExternalApiRequest

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

Returns
Type Description
ExternalApi

createExternalApi(LocationName parent, ExternalApi externalApi, String externalApiId)

public final ExternalApi createExternalApi(LocationName parent, ExternalApi externalApi, String externalApiId)

Create an External API resource in the API hub.

Sample code:


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

Required. The parent resource for the External API resource. Format: projects/{project}/locations/{location}

externalApi ExternalApi

Required. The External API resource to create.

externalApiId String

Optional. The ID to use for the External API resource, which will become the final component of the External API's resource name. This field is optional.

  • If provided, the same will be used. The service will throw an error if the specified id is already used by another External API resource in the API hub.
  • If not provided, a system generated id will be used.

This value should be 4-500 characters, and valid characters are /a-z[0-9]-_/.

Returns
Type Description
ExternalApi

createExternalApi(String parent, ExternalApi externalApi, String externalApiId)

public final ExternalApi createExternalApi(String parent, ExternalApi externalApi, String externalApiId)

Create an External API resource in the API hub.

Sample code:


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

Required. The parent resource for the External API resource. Format: projects/{project}/locations/{location}

externalApi ExternalApi

Required. The External API resource to create.

externalApiId String

Optional. The ID to use for the External API resource, which will become the final component of the External API's resource name. This field is optional.

  • If provided, the same will be used. The service will throw an error if the specified id is already used by another External API resource in the API hub.
  • If not provided, a system generated id will be used.

This value should be 4-500 characters, and valid characters are /a-z[0-9]-_/.

Returns
Type Description
ExternalApi

createExternalApiCallable()

public final UnaryCallable<CreateExternalApiRequest,ExternalApi> createExternalApiCallable()

Create an External API resource in the API hub.

Sample code:


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

createSpec(CreateSpecRequest request)

public final Spec createSpec(CreateSpecRequest request)

Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of contents or source_uri must be provided. If contents is provided, then spec_type must also be provided.

On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the projects/{project}/locations/{location}/attributes/system-spec-type attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently.

In order to access the information parsed from the spec, use the GetSpec method. In order to access the raw contents for a particular spec, use the GetSpecContents method. In order to access the operations parsed from the spec, use the ListAPIOperations method.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   CreateSpecRequest request =
       CreateSpecRequest.newBuilder()
           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
           .setSpecId("specId-896074186")
           .setSpec(Spec.newBuilder().build())
           .build();
   Spec response = apiHubClient.createSpec(request);
 }
 
Parameter
Name Description
request CreateSpecRequest

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

Returns
Type Description
Spec

createSpec(VersionName parent, Spec spec, String specId)

public final Spec createSpec(VersionName parent, Spec spec, String specId)

Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of contents or source_uri must be provided. If contents is provided, then spec_type must also be provided.

On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the projects/{project}/locations/{location}/attributes/system-spec-type attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently.

In order to access the information parsed from the spec, use the GetSpec method. In order to access the raw contents for a particular spec, use the GetSpecContents method. In order to access the operations parsed from the spec, use the ListAPIOperations method.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]");
   Spec spec = Spec.newBuilder().build();
   String specId = "specId-896074186";
   Spec response = apiHubClient.createSpec(parent, spec, specId);
 }
 
Parameters
Name Description
parent VersionName

Required. The parent resource for Spec. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}

spec Spec

Required. The spec to create.

specId String

Optional. The ID to use for the spec, which will become the final component of the spec's resource name. This field is optional.

  • If provided, the same will be used. The service will throw an error if the specified id is already used by another spec in the API resource.
  • If not provided, a system generated id will be used.

This value should be 4-500 characters, and valid characters are /a-z[0-9]-_/.

Returns
Type Description
Spec

createSpec(String parent, Spec spec, String specId)

public final Spec createSpec(String parent, Spec spec, String specId)

Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of contents or source_uri must be provided. If contents is provided, then spec_type must also be provided.

On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the projects/{project}/locations/{location}/attributes/system-spec-type attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently.

In order to access the information parsed from the spec, use the GetSpec method. In order to access the raw contents for a particular spec, use the GetSpecContents method. In order to access the operations parsed from the spec, use the ListAPIOperations method.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   String parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString();
   Spec spec = Spec.newBuilder().build();
   String specId = "specId-896074186";
   Spec response = apiHubClient.createSpec(parent, spec, specId);
 }
 
Parameters
Name Description
parent String

Required. The parent resource for Spec. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}

spec Spec

Required. The spec to create.

specId String

Optional. The ID to use for the spec, which will become the final component of the spec's resource name. This field is optional.

  • If provided, the same will be used. The service will throw an error if the specified id is already used by another spec in the API resource.
  • If not provided, a system generated id will be used.

This value should be 4-500 characters, and valid characters are /a-z[0-9]-_/.

Returns
Type Description
Spec

createSpecCallable()

public final UnaryCallable<CreateSpecRequest,Spec> createSpecCallable()

Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of contents or source_uri must be provided. If contents is provided, then spec_type must also be provided.

On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the projects/{project}/locations/{location}/attributes/system-spec-type attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently.

In order to access the information parsed from the spec, use the GetSpec method. In order to access the raw contents for a particular spec, use the GetSpecContents method. In order to access the operations parsed from the spec, use the ListAPIOperations method.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   CreateSpecRequest request =
       CreateSpecRequest.newBuilder()
           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
           .setSpecId("specId-896074186")
           .setSpec(Spec.newBuilder().build())
           .build();
   ApiFuture<Spec> future = apiHubClient.createSpecCallable().futureCall(request);
   // Do something.
   Spec response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateSpecRequest,Spec>

createVersion(ApiName parent, Version version, String versionId)

public final Version createVersion(ApiName parent, Version version, String versionId)

Create an API version for an API resource in the API hub.

Sample code:


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

Required. The parent resource for API version. Format: projects/{project}/locations/{location}/apis/{api}

version Version

Required. The version to create.

versionId String

Optional. The ID to use for the API version, which will become the final component of the version's resource name. This field is optional.

  • If provided, the same will be used. The service will throw an error if the specified id is already used by another version in the API resource.
  • If not provided, a system generated id will be used.

This value should be 4-500 characters, and valid characters are /a-z[0-9]-_/.

Returns
Type Description
Version

createVersion(CreateVersionRequest request)

public final Version createVersion(CreateVersionRequest request)

Create an API version for an API resource in the API hub.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   CreateVersionRequest request =
       CreateVersionRequest.newBuilder()
           .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString())
           .setVersionId("versionId-1407102957")
           .setVersion(Version.newBuilder().build())
           .build();
   Version response = apiHubClient.createVersion(request);
 }
 
Parameter
Name Description
request CreateVersionRequest

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

Returns
Type Description
Version

createVersion(String parent, Version version, String versionId)

public final Version createVersion(String parent, Version version, String versionId)

Create an API version for an API resource in the API hub.

Sample code:


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

Required. The parent resource for API version. Format: projects/{project}/locations/{location}/apis/{api}

version Version

Required. The version to create.

versionId String

Optional. The ID to use for the API version, which will become the final component of the version's resource name. This field is optional.

  • If provided, the same will be used. The service will throw an error if the specified id is already used by another version in the API resource.
  • If not provided, a system generated id will be used.

This value should be 4-500 characters, and valid characters are /a-z[0-9]-_/.

Returns
Type Description
Version

createVersionCallable()

public final UnaryCallable<CreateVersionRequest,Version> createVersionCallable()

Create an API version for an API resource in the API hub.

Sample code:


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

deleteApi(ApiName name)

public final void deleteApi(ApiName name)

Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.

Sample code:


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

Required. The name of the API resource to delete. Format: projects/{project}/locations/{location}/apis/{api}

deleteApi(DeleteApiRequest request)

public final void deleteApi(DeleteApiRequest request)

Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.

Sample code:


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

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

deleteApi(String name)

public final void deleteApi(String name)

Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.

Sample code:


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

Required. The name of the API resource to delete. Format: projects/{project}/locations/{location}/apis/{api}

deleteApiCallable()

public final UnaryCallable<DeleteApiRequest,Empty> deleteApiCallable()

Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.

Sample code:


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

deleteAttribute(AttributeName name)

public final void deleteAttribute(AttributeName name)

Delete an attribute.

Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.

Sample code:


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

Required. The name of the attribute to delete. Format: projects/{project}/locations/{location}/attributes/{attribute}

deleteAttribute(DeleteAttributeRequest request)

public final void deleteAttribute(DeleteAttributeRequest request)

Delete an attribute.

Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.

Sample code:


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

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

deleteAttribute(String name)

public final void deleteAttribute(String name)

Delete an attribute.

Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.

Sample code:


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

Required. The name of the attribute to delete. Format: projects/{project}/locations/{location}/attributes/{attribute}

deleteAttributeCallable()

public final UnaryCallable<DeleteAttributeRequest,Empty> deleteAttributeCallable()

Delete an attribute.

Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.

Sample code:


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

deleteDeployment(DeleteDeploymentRequest request)

public final void deleteDeployment(DeleteDeploymentRequest request)

Delete a deployment resource in the API hub.

Sample code:


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

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

deleteDeployment(DeploymentName name)

public final void deleteDeployment(DeploymentName name)

Delete a deployment resource in the API hub.

Sample code:


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

Required. The name of the deployment resource to delete. Format: projects/{project}/locations/{location}/deployments/{deployment}

deleteDeployment(String name)

public final void deleteDeployment(String name)

Delete a deployment resource in the API hub.

Sample code:


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

Required. The name of the deployment resource to delete. Format: projects/{project}/locations/{location}/deployments/{deployment}

deleteDeploymentCallable()

public final UnaryCallable<DeleteDeploymentRequest,Empty> deleteDeploymentCallable()

Delete a deployment resource in the API hub.

Sample code:


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

deleteExternalApi(DeleteExternalApiRequest request)

public final void deleteExternalApi(DeleteExternalApiRequest request)

Delete an External API resource in the API hub.

Sample code:


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

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

deleteExternalApi(ExternalApiName name)

public final void deleteExternalApi(ExternalApiName name)

Delete an External API resource in the API hub.

Sample code:


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

Required. The name of the External API resource to delete. Format: projects/{project}/locations/{location}/externalApis/{externalApi}

deleteExternalApi(String name)

public final void deleteExternalApi(String name)

Delete an External API resource in the API hub.

Sample code:


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

Required. The name of the External API resource to delete. Format: projects/{project}/locations/{location}/externalApis/{externalApi}

deleteExternalApiCallable()

public final UnaryCallable<DeleteExternalApiRequest,Empty> deleteExternalApiCallable()

Delete an External API resource in the API hub.

Sample code:


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

deleteSpec(DeleteSpecRequest request)

public final void deleteSpec(DeleteSpecRequest request)

Delete a spec. Deleting a spec will also delete the associated operations from the 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   DeleteSpecRequest request =
       DeleteSpecRequest.newBuilder()
           .setName(
               SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString())
           .build();
   apiHubClient.deleteSpec(request);
 }
 
Parameter
Name Description
request DeleteSpecRequest

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

deleteSpec(SpecName name)

public final void deleteSpec(SpecName name)

Delete a spec. Deleting a spec will also delete the associated operations from the 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   SpecName name = SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]");
   apiHubClient.deleteSpec(name);
 }
 
Parameter
Name Description
name SpecName

Required. The name of the spec to delete. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}

deleteSpec(String name)

public final void deleteSpec(String name)

Delete a spec. Deleting a spec will also delete the associated operations from the 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   String name =
       SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString();
   apiHubClient.deleteSpec(name);
 }
 
Parameter
Name Description
name String

Required. The name of the spec to delete. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}

deleteSpecCallable()

public final UnaryCallable<DeleteSpecRequest,Empty> deleteSpecCallable()

Delete a spec. Deleting a spec will also delete the associated operations from the 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   DeleteSpecRequest request =
       DeleteSpecRequest.newBuilder()
           .setName(
               SpecName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[SPEC]").toString())
           .build();
   ApiFuture<Empty> future = apiHubClient.deleteSpecCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteSpecRequest,Empty>

deleteVersion(DeleteVersionRequest request)

public final void deleteVersion(DeleteVersionRequest request)

Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.

Sample code:


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

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

deleteVersion(VersionName name)

public final void deleteVersion(VersionName name)

Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.

Sample code:


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

Required. The name of the version to delete. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}

deleteVersion(String name)

public final void deleteVersion(String name)

Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.

Sample code:


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

Required. The name of the version to delete. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}

deleteVersionCallable()

public final UnaryCallable<DeleteVersionRequest,Empty> deleteVersionCallable()

Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.

Sample code:


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

getApi(ApiName name)

public final Api getApi(ApiName name)

Get API resource details including the API versions contained in it.

Sample code:


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

Required. The name of the API resource to retrieve. Format: projects/{project}/locations/{location}/apis/{api}

Returns
Type Description
Api

getApi(GetApiRequest request)

public final Api getApi(GetApiRequest request)

Get API resource details including the API versions contained in it.

Sample code:


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

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

Returns
Type Description
Api

getApi(String name)

public final Api getApi(String name)

Get API resource details including the API versions contained in it.

Sample code:


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

Required. The name of the API resource to retrieve. Format: projects/{project}/locations/{location}/apis/{api}

Returns
Type Description
Api

getApiCallable()

public final UnaryCallable<GetApiRequest,Api> getApiCallable()

Get API resource details including the API versions contained in it.

Sample code:


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

getApiOperation(ApiOperationName name)

public final ApiOperation getApiOperation(ApiOperationName name)

Get details about a particular operation in API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   ApiOperationName name =
       ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]");
   ApiOperation response = apiHubClient.getApiOperation(name);
 }
 
Parameter
Name Description
name ApiOperationName

Required. The name of the operation to retrieve. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}

Returns
Type Description
ApiOperation

getApiOperation(GetApiOperationRequest request)

public final ApiOperation getApiOperation(GetApiOperationRequest request)

Get details about a particular operation in API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   GetApiOperationRequest request =
       GetApiOperationRequest.newBuilder()
           .setName(
               ApiOperationName.of(
                       "[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]")
                   .toString())
           .build();
   ApiOperation response = apiHubClient.getApiOperation(request);
 }
 
Parameter
Name Description
request GetApiOperationRequest

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

Returns
Type Description
ApiOperation

getApiOperation(String name)

public final ApiOperation getApiOperation(String name)

Get details about a particular operation in API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   String name =
       ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]")
           .toString();
   ApiOperation response = apiHubClient.getApiOperation(name);
 }
 
Parameter
Name Description
name String

Required. The name of the operation to retrieve. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}

Returns
Type Description
ApiOperation

getApiOperationCallable()

public final UnaryCallable<GetApiOperationRequest,ApiOperation> getApiOperationCallable()

Get details about a particular operation in API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   GetApiOperationRequest request =
       GetApiOperationRequest.newBuilder()
           .setName(
               ApiOperationName.of(
                       "[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]")
                   .toString())
           .build();
   ApiFuture<ApiOperation> future = apiHubClient.getApiOperationCallable().futureCall(request);
   // Do something.
   ApiOperation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetApiOperationRequest,ApiOperation>

getAttribute(AttributeName name)

public final Attribute getAttribute(AttributeName name)

Get details about the attribute.

Sample code:


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

Required. The name of the attribute to retrieve. Format: projects/{project}/locations/{location}/attributes/{attribute}

Returns
Type Description
Attribute

getAttribute(GetAttributeRequest request)

public final Attribute getAttribute(GetAttributeRequest request)

Get details about the attribute.

Sample code:


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

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

Returns
Type Description
Attribute

getAttribute(String name)

public final Attribute getAttribute(String name)

Get details about the attribute.

Sample code:


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

Required. The name of the attribute to retrieve. Format: projects/{project}/locations/{location}/attributes/{attribute}

Returns
Type Description
Attribute

getAttributeCallable()

public final UnaryCallable<GetAttributeRequest,Attribute> getAttributeCallable()

Get details about the attribute.

Sample code:


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

getDefinition(DefinitionName name)

public final Definition getDefinition(DefinitionName name)

Get details about a definition in an API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   DefinitionName name =
       DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]");
   Definition response = apiHubClient.getDefinition(name);
 }
 
Parameter
Name Description
name DefinitionName

Required. The name of the definition to retrieve. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}

Returns
Type Description
Definition

getDefinition(GetDefinitionRequest request)

public final Definition getDefinition(GetDefinitionRequest request)

Get details about a definition in an API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   GetDefinitionRequest request =
       GetDefinitionRequest.newBuilder()
           .setName(
               DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]")
                   .toString())
           .build();
   Definition response = apiHubClient.getDefinition(request);
 }
 
Parameter
Name Description
request GetDefinitionRequest

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

Returns
Type Description
Definition

getDefinition(String name)

public final Definition getDefinition(String name)

Get details about a definition in an API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   String name =
       DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]")
           .toString();
   Definition response = apiHubClient.getDefinition(name);
 }
 
Parameter
Name Description
name String

Required. The name of the definition to retrieve. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}

Returns
Type Description
Definition

getDefinitionCallable()

public final UnaryCallable<GetDefinitionRequest,Definition> getDefinitionCallable()

Get details about a definition in an API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   GetDefinitionRequest request =
       GetDefinitionRequest.newBuilder()
           .setName(
               DefinitionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[DEFINITION]")
                   .toString())
           .build();
   ApiFuture<Definition> future = apiHubClient.getDefinitionCallable().futureCall(request);
   // Do something.
   Definition response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetDefinitionRequest,Definition>

getDeployment(DeploymentName name)

public final Deployment getDeployment(DeploymentName name)

Get details about a deployment and the API versions linked to it.

Sample code:


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

Required. The name of the deployment resource to retrieve. Format: projects/{project}/locations/{location}/deployments/{deployment}

Returns
Type Description
Deployment

getDeployment(GetDeploymentRequest request)

public final Deployment getDeployment(GetDeploymentRequest request)

Get details about a deployment and the API versions linked to it.

Sample code:


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

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

Returns
Type Description
Deployment

getDeployment(String name)

public final Deployment getDeployment(String name)

Get details about a deployment and the API versions linked to it.

Sample code:


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

Required. The name of the deployment resource to retrieve. Format: projects/{project}/locations/{location}/deployments/{deployment}

Returns
Type Description
Deployment

getDeploymentCallable()

public final UnaryCallable<GetDeploymentRequest,Deployment> getDeploymentCallable()

Get details about a deployment and the API versions linked to it.

Sample code:


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

getExternalApi(ExternalApiName name)

public final ExternalApi getExternalApi(ExternalApiName name)

Get details about an External API resource in the API hub.

Sample code:


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

Required. The name of the External API resource to retrieve. Format: projects/{project}/locations/{location}/externalApis/{externalApi}

Returns
Type Description
ExternalApi

getExternalApi(GetExternalApiRequest request)

public final ExternalApi getExternalApi(GetExternalApiRequest request)

Get details about an External API resource in the API hub.

Sample code:


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

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

Returns
Type Description
ExternalApi

getExternalApi(String name)

public final ExternalApi getExternalApi(String name)

Get details about an External API resource in the API hub.

Sample code:


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

Required. The name of the External API resource to retrieve. Format: projects/{project}/locations/{location}/externalApis/{externalApi}

Returns
Type Description
ExternalApi

getExternalApiCallable()

public final UnaryCallable<GetExternalApiRequest,ExternalApi> getExternalApiCallable()

Get details about an External API resource in the API hub.

Sample code:


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

getLocation(GetLocationRequest request)

public final Location getLocation(GetLocationRequest request)

Gets information about a location.

Sample code:


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

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

Returns
Type Description
com.google.cloud.location.Location

getLocationCallable()

public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Gets information about a location.

Sample code:


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

getSettings()

public final ApiHubSettings getSettings()
Returns
Type Description
ApiHubSettings

getSpec(GetSpecRequest request)

public final Spec getSpec(GetSpecRequest request)

Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use GetSpecContents method to retrieve the same.

Sample code:


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

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

Returns
Type Description
Spec

getSpec(SpecName name)

public final Spec getSpec(SpecName name)

Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use GetSpecContents method to retrieve the same.

Sample code:


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

Required. The name of the spec to retrieve. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}

Returns
Type Description
Spec

getSpec(String name)

public final Spec getSpec(String name)

Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use GetSpecContents method to retrieve the same.

Sample code:


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

Required. The name of the spec to retrieve. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}

Returns
Type Description
Spec

getSpecCallable()

public final UnaryCallable<GetSpecRequest,Spec> getSpecCallable()

Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use GetSpecContents method to retrieve the same.

Sample code:


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

getSpecContents(GetSpecContentsRequest request)

public final SpecContents getSpecContents(GetSpecContentsRequest request)

Get spec contents.

Sample code:


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

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

Returns
Type Description
SpecContents

getSpecContents(SpecName name)

public final SpecContents getSpecContents(SpecName name)

Get spec contents.

Sample code:


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

Required. The name of the spec whose contents need to be retrieved. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}

Returns
Type Description
SpecContents

getSpecContents(String name)

public final SpecContents getSpecContents(String name)

Get spec contents.

Sample code:


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

Required. The name of the spec whose contents need to be retrieved. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}

Returns
Type Description
SpecContents

getSpecContentsCallable()

public final UnaryCallable<GetSpecContentsRequest,SpecContents> getSpecContentsCallable()

Get spec contents.

Sample code:


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

getStub()

public ApiHubStub getStub()
Returns
Type Description
ApiHubStub

getVersion(GetVersionRequest request)

public final Version getVersion(GetVersionRequest request)

Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.

Sample code:


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

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

Returns
Type Description
Version

getVersion(VersionName name)

public final Version getVersion(VersionName name)

Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.

Sample code:


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

Required. The name of the API version to retrieve. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}

Returns
Type Description
Version

getVersion(String name)

public final Version getVersion(String name)

Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.

Sample code:


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

Required. The name of the API version to retrieve. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}

Returns
Type Description
Version

getVersionCallable()

public final UnaryCallable<GetVersionRequest,Version> getVersionCallable()

Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.

Sample code:


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

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listApiOperations(ListApiOperationsRequest request)

public final ApiHubClient.ListApiOperationsPagedResponse listApiOperations(ListApiOperationsRequest request)

List operations in an API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   ListApiOperationsRequest request =
       ListApiOperationsRequest.newBuilder()
           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (ApiOperation element : apiHubClient.listApiOperations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListApiOperationsRequest

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

Returns
Type Description
ApiHubClient.ListApiOperationsPagedResponse

listApiOperations(VersionName parent)

public final ApiHubClient.ListApiOperationsPagedResponse listApiOperations(VersionName parent)

List operations in an API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]");
   for (ApiOperation element : apiHubClient.listApiOperations(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent VersionName

Required. The parent which owns this collection of operations i.e., the API version. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}

Returns
Type Description
ApiHubClient.ListApiOperationsPagedResponse

listApiOperations(String parent)

public final ApiHubClient.ListApiOperationsPagedResponse listApiOperations(String parent)

List operations in an API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   String parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString();
   for (ApiOperation element : apiHubClient.listApiOperations(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent which owns this collection of operations i.e., the API version. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}

Returns
Type Description
ApiHubClient.ListApiOperationsPagedResponse

listApiOperationsCallable()

public final UnaryCallable<ListApiOperationsRequest,ListApiOperationsResponse> listApiOperationsCallable()

List operations in an API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   ListApiOperationsRequest request =
       ListApiOperationsRequest.newBuilder()
           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListApiOperationsResponse response = apiHubClient.listApiOperationsCallable().call(request);
     for (ApiOperation element : response.getApiOperationsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListApiOperationsRequest,ListApiOperationsResponse>

listApiOperationsPagedCallable()

public final UnaryCallable<ListApiOperationsRequest,ApiHubClient.ListApiOperationsPagedResponse> listApiOperationsPagedCallable()

List operations in an API 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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   ListApiOperationsRequest request =
       ListApiOperationsRequest.newBuilder()
           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<ApiOperation> future =
       apiHubClient.listApiOperationsPagedCallable().futureCall(request);
   // Do something.
   for (ApiOperation element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListApiOperationsRequest,ListApiOperationsPagedResponse>

listApis(ListApisRequest request)

public final ApiHubClient.ListApisPagedResponse listApis(ListApisRequest request)

List API resources in the API hub.

Sample code:


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

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

Returns
Type Description
ApiHubClient.ListApisPagedResponse

listApis(LocationName parent)

public final ApiHubClient.ListApisPagedResponse listApis(LocationName parent)

List API resources in the API hub.

Sample code:


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

Required. The parent, which owns this collection of API resources. Format: projects/{project}/locations/{location}

Returns
Type Description
ApiHubClient.ListApisPagedResponse

listApis(String parent)

public final ApiHubClient.ListApisPagedResponse listApis(String parent)

List API resources in the API hub.

Sample code:


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

Required. The parent, which owns this collection of API resources. Format: projects/{project}/locations/{location}

Returns
Type Description
ApiHubClient.ListApisPagedResponse

listApisCallable()

public final UnaryCallable<ListApisRequest,ListApisResponse> listApisCallable()

List API resources in the API hub.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   ListApisRequest request =
       ListApisRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListApisResponse response = apiHubClient.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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListApisRequest,ListApisResponse>

listApisPagedCallable()

public final UnaryCallable<ListApisRequest,ApiHubClient.ListApisPagedResponse> listApisPagedCallable()

List API resources in the API hub.

Sample code:


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

listAttributes(ListAttributesRequest request)

public final ApiHubClient.ListAttributesPagedResponse listAttributes(ListAttributesRequest request)

List all attributes.

Sample code:


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

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

Returns
Type Description
ApiHubClient.ListAttributesPagedResponse

listAttributes(LocationName parent)

public final ApiHubClient.ListAttributesPagedResponse listAttributes(LocationName parent)

List all attributes.

Sample code:


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

Required. The parent resource for Attribute. Format: projects/{project}/locations/{location}

Returns
Type Description
ApiHubClient.ListAttributesPagedResponse

listAttributes(String parent)

public final ApiHubClient.ListAttributesPagedResponse listAttributes(String parent)

List all attributes.

Sample code:


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

Required. The parent resource for Attribute. Format: projects/{project}/locations/{location}

Returns
Type Description
ApiHubClient.ListAttributesPagedResponse

listAttributesCallable()

public final UnaryCallable<ListAttributesRequest,ListAttributesResponse> listAttributesCallable()

List all attributes.

Sample code:


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

listAttributesPagedCallable()

public final UnaryCallable<ListAttributesRequest,ApiHubClient.ListAttributesPagedResponse> listAttributesPagedCallable()

List all attributes.

Sample code:


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

listDeployments(ListDeploymentsRequest request)

public final ApiHubClient.ListDeploymentsPagedResponse listDeployments(ListDeploymentsRequest request)

List deployment resources in the API hub.

Sample code:


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

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

Returns
Type Description
ApiHubClient.ListDeploymentsPagedResponse

listDeployments(LocationName parent)

public final ApiHubClient.ListDeploymentsPagedResponse listDeployments(LocationName parent)

List deployment resources in the API hub.

Sample code:


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

Required. The parent, which owns this collection of deployment resources. Format: projects/{project}/locations/{location}

Returns
Type Description
ApiHubClient.ListDeploymentsPagedResponse

listDeployments(String parent)

public final ApiHubClient.ListDeploymentsPagedResponse listDeployments(String parent)

List deployment resources in the API hub.

Sample code:


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

Required. The parent, which owns this collection of deployment resources. Format: projects/{project}/locations/{location}

Returns
Type Description
ApiHubClient.ListDeploymentsPagedResponse

listDeploymentsCallable()

public final UnaryCallable<ListDeploymentsRequest,ListDeploymentsResponse> listDeploymentsCallable()

List deployment resources in the API hub.

Sample code:


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

listDeploymentsPagedCallable()

public final UnaryCallable<ListDeploymentsRequest,ApiHubClient.ListDeploymentsPagedResponse> listDeploymentsPagedCallable()

List deployment resources in the API hub.

Sample code:


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

listExternalApis(ListExternalApisRequest request)

public final ApiHubClient.ListExternalApisPagedResponse listExternalApis(ListExternalApisRequest request)

List External API resources in the API hub.

Sample code:


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

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

Returns
Type Description
ApiHubClient.ListExternalApisPagedResponse

listExternalApis(LocationName parent)

public final ApiHubClient.ListExternalApisPagedResponse listExternalApis(LocationName parent)

List External API resources in the API hub.

Sample code:


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

Required. The parent, which owns this collection of External API resources. Format: projects/{project}/locations/{location}

Returns
Type Description
ApiHubClient.ListExternalApisPagedResponse

listExternalApis(String parent)

public final ApiHubClient.ListExternalApisPagedResponse listExternalApis(String parent)

List External API resources in the API hub.

Sample code:


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

Required. The parent, which owns this collection of External API resources. Format: projects/{project}/locations/{location}

Returns
Type Description
ApiHubClient.ListExternalApisPagedResponse

listExternalApisCallable()

public final UnaryCallable<ListExternalApisRequest,ListExternalApisResponse> listExternalApisCallable()

List External API resources in the API hub.

Sample code:


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

listExternalApisPagedCallable()

public final UnaryCallable<ListExternalApisRequest,ApiHubClient.ListExternalApisPagedResponse> listExternalApisPagedCallable()

List External API resources in the API hub.

Sample code:


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

listLocations(ListLocationsRequest request)

public final ApiHubClient.ListLocationsPagedResponse listLocations(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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Location element : apiHubClient.listLocations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

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

Returns
Type Description
ApiHubClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response = apiHubClient.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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,ApiHubClient.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 (ApiHubClient apiHubClient = ApiHubClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Location> future = apiHubClient.listLocationsPagedCallable().futureCall(request);
   // Do something.
   for (Location element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

listSpecs(ListSpecsRequest request)

public final ApiHubClient.ListSpecsPagedResponse listSpecs(ListSpecsRequest request)

List specs corresponding to a particular API resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   ListSpecsRequest request =
       ListSpecsRequest.newBuilder()
           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Spec element : apiHubClient.listSpecs(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListSpecsRequest

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

Returns
Type Description
ApiHubClient.ListSpecsPagedResponse

listSpecs(VersionName parent)

public final ApiHubClient.ListSpecsPagedResponse listSpecs(VersionName parent)

List specs corresponding to a particular API resource.

Sample code:


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

Required. The parent, which owns this collection of specs. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}

Returns
Type Description
ApiHubClient.ListSpecsPagedResponse

listSpecs(String parent)

public final ApiHubClient.ListSpecsPagedResponse listSpecs(String parent)

List specs corresponding to a particular API resource.

Sample code:


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

Required. The parent, which owns this collection of specs. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}

Returns
Type Description
ApiHubClient.ListSpecsPagedResponse

listSpecsCallable()

public final UnaryCallable<ListSpecsRequest,ListSpecsResponse> listSpecsCallable()

List specs corresponding to a particular API resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   ListSpecsRequest request =
       ListSpecsRequest.newBuilder()
           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListSpecsResponse response = apiHubClient.listSpecsCallable().call(request);
     for (Spec element : response.getSpecsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListSpecsRequest,ListSpecsResponse>

listSpecsPagedCallable()

public final UnaryCallable<ListSpecsRequest,ApiHubClient.ListSpecsPagedResponse> listSpecsPagedCallable()

List specs corresponding to a particular API resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   ListSpecsRequest request =
       ListSpecsRequest.newBuilder()
           .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Spec> future = apiHubClient.listSpecsPagedCallable().futureCall(request);
   // Do something.
   for (Spec element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListSpecsRequest,ListSpecsPagedResponse>

listVersions(ApiName parent)

public final ApiHubClient.ListVersionsPagedResponse listVersions(ApiName parent)

List API versions of an API resource in the API hub.

Sample code:


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

Required. The parent which owns this collection of API versions i.e., the API resource Format: projects/{project}/locations/{location}/apis/{api}

Returns
Type Description
ApiHubClient.ListVersionsPagedResponse

listVersions(ListVersionsRequest request)

public final ApiHubClient.ListVersionsPagedResponse listVersions(ListVersionsRequest request)

List API versions of an API resource in the API hub.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   ListVersionsRequest request =
       ListVersionsRequest.newBuilder()
           .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Version element : apiHubClient.listVersions(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListVersionsRequest

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

Returns
Type Description
ApiHubClient.ListVersionsPagedResponse

listVersions(String parent)

public final ApiHubClient.ListVersionsPagedResponse listVersions(String parent)

List API versions of an API resource in the API hub.

Sample code:


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

Required. The parent which owns this collection of API versions i.e., the API resource Format: projects/{project}/locations/{location}/apis/{api}

Returns
Type Description
ApiHubClient.ListVersionsPagedResponse

listVersionsCallable()

public final UnaryCallable<ListVersionsRequest,ListVersionsResponse> listVersionsCallable()

List API versions of an API resource in the API hub.

Sample code:


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

listVersionsPagedCallable()

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

List API versions of an API resource in the API hub.

Sample code:


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

searchResources(LocationName location, String query)

public final ApiHubClient.SearchResourcesPagedResponse searchResources(LocationName location, String query)

Search across API-Hub resources.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
   String query = "query107944136";
   for (SearchResult element : apiHubClient.searchResources(location, query).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameters
Name Description
location LocationName

Required. The resource name of the location which will be of the type projects/{project_id}/locations/{location_id}. This field is used to identify the instance of API-Hub in which resources should be searched.

query String

Required. The free text search query. This query can contain keywords which could be related to any detail of the API-Hub resources such display names, descriptions, attributes etc.

Returns
Type Description
ApiHubClient.SearchResourcesPagedResponse

searchResources(SearchResourcesRequest request)

public final ApiHubClient.SearchResourcesPagedResponse searchResources(SearchResourcesRequest request)

Search across API-Hub resources.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   SearchResourcesRequest request =
       SearchResourcesRequest.newBuilder()
           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setQuery("query107944136")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (SearchResult element : apiHubClient.searchResources(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request SearchResourcesRequest

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

Returns
Type Description
ApiHubClient.SearchResourcesPagedResponse

searchResources(String location, String query)

public final ApiHubClient.SearchResourcesPagedResponse searchResources(String location, String query)

Search across API-Hub resources.

Sample code:


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

Required. The resource name of the location which will be of the type projects/{project_id}/locations/{location_id}. This field is used to identify the instance of API-Hub in which resources should be searched.

query String

Required. The free text search query. This query can contain keywords which could be related to any detail of the API-Hub resources such display names, descriptions, attributes etc.

Returns
Type Description
ApiHubClient.SearchResourcesPagedResponse

searchResourcesCallable()

public final UnaryCallable<SearchResourcesRequest,SearchResourcesResponse> searchResourcesCallable()

Search across API-Hub resources.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   SearchResourcesRequest request =
       SearchResourcesRequest.newBuilder()
           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setQuery("query107944136")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     SearchResourcesResponse response = apiHubClient.searchResourcesCallable().call(request);
     for (SearchResult element : response.getSearchResultsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<SearchResourcesRequest,SearchResourcesResponse>

searchResourcesPagedCallable()

public final UnaryCallable<SearchResourcesRequest,ApiHubClient.SearchResourcesPagedResponse> searchResourcesPagedCallable()

Search across API-Hub resources.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ApiHubClient apiHubClient = ApiHubClient.create()) {
   SearchResourcesRequest request =
       SearchResourcesRequest.newBuilder()
           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setQuery("query107944136")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<SearchResult> future =
       apiHubClient.searchResourcesPagedCallable().futureCall(request);
   // Do something.
   for (SearchResult element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<SearchResourcesRequest,SearchResourcesPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateApi(Api api, FieldMask updateMask)

public final Api updateApi(Api api, FieldMask updateMask)

Update an API resource in the API hub. The following fields in the [API][] can be updated:

  • display_name
  • description
  • owner
  • documentation
  • target_user
  • team
  • business_unit
  • maturity_level
  • attributes

The update_mask should be used to specify the fields being updated.

Updating the owner field requires complete owner message and updates both owner and email fields.

Sample code:


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

Required. The API resource to update.

The API resource's name field is used to identify the API resource to update. Format: projects/{project}/locations/{location}/apis/{api}

updateMask FieldMask

Required. The list of fields to update.

Returns
Type Description
Api

updateApi(UpdateApiRequest request)

public final Api updateApi(UpdateApiRequest request)

Update an API resource in the API hub. The following fields in the [API][] can be updated:

  • display_name
  • description
  • owner
  • documentation
  • target_user
  • team
  • business_unit
  • maturity_level
  • attributes

The update_mask should be used to specify the fields being updated.

Updating the owner field requires complete owner message and updates both owner and email fields.

Sample code:


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

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

Returns
Type Description
Api

updateApiCallable()

public final UnaryCallable<UpdateApiRequest,Api> updateApiCallable()

Update an API resource in the API hub. The following fields in the [API][] can be updated:

  • display_name
  • description
  • owner
  • documentation
  • target_user
  • team
  • business_unit
  • maturity_level
  • attributes

The update_mask should be used to specify the fields being updated.

Updating the owner field requires complete owner message and updates both owner and email fields.

Sample code:


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

updateAttribute(Attribute attribute, FieldMask updateMask)

public final Attribute updateAttribute(Attribute attribute, FieldMask updateMask)

Update the attribute. The following fields in the Attribute resource can be updated:

  • display_name The display name can be updated for user defined attributes only.
  • description The description can be updated for user defined attributes only.
  • allowed_values To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource's attribute is deleted, then the association between the resource and the attribute value will also be deleted.
  • cardinality The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update.

The update_mask should be used to specify the fields being updated.

Sample code:


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

Required. The attribute to update.

The attribute's name field is used to identify the attribute to update. Format: projects/{project}/locations/{location}/attributes/{attribute}

updateMask FieldMask

Required. The list of fields to update.

Returns
Type Description
Attribute

updateAttribute(UpdateAttributeRequest request)

public final Attribute updateAttribute(UpdateAttributeRequest request)

Update the attribute. The following fields in the Attribute resource can be updated:

  • display_name The display name can be updated for user defined attributes only.
  • description The description can be updated for user defined attributes only.
  • allowed_values To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource's attribute is deleted, then the association between the resource and the attribute value will also be deleted.
  • cardinality The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update.

The update_mask should be used to specify the fields being updated.

Sample code:


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

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

Returns
Type Description
Attribute

updateAttributeCallable()

public final UnaryCallable<UpdateAttributeRequest,Attribute> updateAttributeCallable()

Update the attribute. The following fields in the Attribute resource can be updated:

  • display_name The display name can be updated for user defined attributes only.
  • description The description can be updated for user defined attributes only.
  • allowed_values To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource's attribute is deleted, then the association between the resource and the attribute value will also be deleted.
  • cardinality The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update.

The update_mask should be used to specify the fields being updated.

Sample code:


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

updateDeployment(Deployment deployment, FieldMask updateMask)

public final Deployment updateDeployment(Deployment deployment, FieldMask updateMask)

Update a deployment resource in the API hub. The following fields in the deployment resource can be updated:

  • display_name
  • description
  • documentation
  • deployment_type
  • resource_uri
  • endpoints
  • slo
  • environment
  • attributes

The update_mask should be used to specify the fields being updated.

Sample code:


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

Required. The deployment resource to update.

The deployment resource's name field is used to identify the deployment resource to update. Format: projects/{project}/locations/{location}/deployments/{deployment}

updateMask FieldMask

Required. The list of fields to update.

Returns
Type Description
Deployment

updateDeployment(UpdateDeploymentRequest request)

public final Deployment updateDeployment(UpdateDeploymentRequest request)

Update a deployment resource in the API hub. The following fields in the deployment resource can be updated:

  • display_name
  • description
  • documentation
  • deployment_type
  • resource_uri
  • endpoints
  • slo
  • environment
  • attributes

The update_mask should be used to specify the fields being updated.

Sample code:


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

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

Returns
Type Description
Deployment

updateDeploymentCallable()

public final UnaryCallable<UpdateDeploymentRequest,Deployment> updateDeploymentCallable()

Update a deployment resource in the API hub. The following fields in the deployment resource can be updated:

  • display_name
  • description
  • documentation
  • deployment_type
  • resource_uri
  • endpoints
  • slo
  • environment
  • attributes

The update_mask should be used to specify the fields being updated.

Sample code:


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

updateExternalApi(ExternalApi externalApi, FieldMask updateMask)

public final ExternalApi updateExternalApi(ExternalApi externalApi, FieldMask updateMask)

Update an External API resource in the API hub. The following fields can be updated:

  • display_name
  • description
  • documentation
  • endpoints
  • paths

The update_mask should be used to specify the fields being updated.

Sample code:


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

Required. The External API resource to update.

The External API resource's name field is used to identify the External API resource to update. Format: projects/{project}/locations/{location}/externalApis/{externalApi}

updateMask FieldMask

Required. The list of fields to update.

Returns
Type Description
ExternalApi

updateExternalApi(UpdateExternalApiRequest request)

public final ExternalApi updateExternalApi(UpdateExternalApiRequest request)

Update an External API resource in the API hub. The following fields can be updated:

  • display_name
  • description
  • documentation
  • endpoints
  • paths

The update_mask should be used to specify the fields being updated.

Sample code:


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

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

Returns
Type Description
ExternalApi

updateExternalApiCallable()

public final UnaryCallable<UpdateExternalApiRequest,ExternalApi> updateExternalApiCallable()

Update an External API resource in the API hub. The following fields can be updated:

  • display_name
  • description
  • documentation
  • endpoints
  • paths

The update_mask should be used to specify the fields being updated.

Sample code:


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

updateSpec(Spec spec, FieldMask updateMask)

public final Spec updateSpec(Spec spec, FieldMask updateMask)

Update spec. The following fields in the spec can be updated:

  • display_name
  • source_uri
  • lint_response
  • attributes
  • contents
  • spec_type

In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed out from the new spec.

In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present.

The update_mask should be used to specify the fields being updated.

Sample code:


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

Required. The spec to update.

The spec's name field is used to identify the spec to update. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}

updateMask FieldMask

Required. The list of fields to update.

Returns
Type Description
Spec

updateSpec(UpdateSpecRequest request)

public final Spec updateSpec(UpdateSpecRequest request)

Update spec. The following fields in the spec can be updated:

  • display_name
  • source_uri
  • lint_response
  • attributes
  • contents
  • spec_type

In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed out from the new spec.

In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present.

The update_mask should be used to specify the fields being updated.

Sample code:


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

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

Returns
Type Description
Spec

updateSpecCallable()

public final UnaryCallable<UpdateSpecRequest,Spec> updateSpecCallable()

Update spec. The following fields in the spec can be updated:

  • display_name
  • source_uri
  • lint_response
  • attributes
  • contents
  • spec_type

In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed out from the new spec.

In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present.

The update_mask should be used to specify the fields being updated.

Sample code:


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

updateVersion(UpdateVersionRequest request)

public final Version updateVersion(UpdateVersionRequest request)

Update API version. The following fields in the version can be updated currently:

  • display_name
  • description
  • documentation
  • deployments
  • lifecycle
  • compliance
  • accreditation
  • attributes

The update_mask should be used to specify the fields being updated.

Sample code:


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

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

Returns
Type Description
Version

updateVersion(Version version, FieldMask updateMask)

public final Version updateVersion(Version version, FieldMask updateMask)

Update API version. The following fields in the version can be updated currently:

  • display_name
  • description
  • documentation
  • deployments
  • lifecycle
  • compliance
  • accreditation
  • attributes

The update_mask should be used to specify the fields being updated.

Sample code:


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

Required. The API version to update.

The version's name field is used to identify the API version to update. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}

updateMask FieldMask

Required. The list of fields to update.

Returns
Type Description
Version

updateVersionCallable()

public final UnaryCallable<UpdateVersionRequest,Version> updateVersionCallable()

Update API version. The following fields in the version can be updated currently:

  • display_name
  • description
  • documentation
  • deployments
  • lifecycle
  • compliance
  • accreditation
  • attributes

The update_mask should be used to specify the fields being updated.

Sample code:


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