Class ApiHubClient

java.lang.Object
com.google.cloud.apihub.v1.ApiHubClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class ApiHubClient extends Object implements BackgroundResource
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][google.cloud.apihub.v1.Api] can be updated:

  • [display_name][google.cloud.apihub.v1.Api.display_name]
  • [description][google.cloud.apihub.v1.Api.description]
  • [owner][google.cloud.apihub.v1.Api.owner]
  • [documentation][google.cloud.apihub.v1.Api.documentation]
  • [target_user][google.cloud.apihub.v1.Api.target_user]
  • [team][google.cloud.apihub.v1.Api.team]
  • [business_unit][google.cloud.apihub.v1.Api.business_unit]
  • [maturity_level][google.cloud.apihub.v1.Api.maturity_level]
  • [api_style][google.cloud.apihub.v1.Api.api_style]
  • [attributes][google.cloud.apihub.v1.Api.attributes]

The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.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][google.cloud.apihub.v1.Version] can be updated currently:

  • [display_name][google.cloud.apihub.v1.Version.display_name]
  • [description][google.cloud.apihub.v1.Version.description]
  • [documentation][google.cloud.apihub.v1.Version.documentation]
  • [deployments][google.cloud.apihub.v1.Version.deployments]
  • [lifecycle][google.cloud.apihub.v1.Version.lifecycle]
  • [compliance][google.cloud.apihub.v1.Version.compliance]
  • [accreditation][google.cloud.apihub.v1.Version.accreditation]
  • [attributes][google.cloud.apihub.v1.Version.attributes]

The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.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][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.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][google.cloud.apihub.v1.ApiHub.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][google.cloud.apihub.v1.Spec] can be updated:

  • [display_name][google.cloud.apihub.v1.Spec.display_name]
  • [source_uri][google.cloud.apihub.v1.Spec.source_uri]
  • [lint_response][google.cloud.apihub.v1.Spec.lint_response]
  • [attributes][google.cloud.apihub.v1.Spec.attributes]
  • [contents][google.cloud.apihub.v1.Spec.contents]
  • [spec_type][google.cloud.apihub.v1.Spec.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][google.cloud.apihub.v1.UpdateSpecRequest.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()

CreateApiOperation

Create an apiOperation in an API version. An apiOperation can be created only if the version has no apiOperations which were created by parsing a spec.

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

  • createApiOperation(CreateApiOperationRequest request)

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

  • createApiOperation(VersionName parent, ApiOperation apiOperation, String apiOperationId)

  • createApiOperation(String parent, ApiOperation apiOperation, String apiOperationId)

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

  • createApiOperationCallable()

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()

UpdateApiOperation

Update an operation in an API version. The following fields in the [ApiOperation resource][google.cloud.apihub.v1.ApiOperation] can be updated:

  • [details.description][ApiOperation.details.description]
  • [details.documentation][ApiOperation.details.documentation]
  • [details.http_operation.path][ApiOperation.details.http_operation.path.path]
  • [details.http_operation.method][ApiOperation.details.http_operation.method]
  • [details.deprecated][ApiOperation.details.deprecated]
  • [attributes][google.cloud.apihub.v1.ApiOperation.attributes]

The [update_mask][google.cloud.apihub.v1.UpdateApiOperationRequest.update_mask] should be used to specify the fields being updated.

An operation can be updated only if the operation was created via [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation] API. If the operation was created by parsing the spec, then it can be edited by updating the spec.

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

  • updateApiOperation(UpdateApiOperationRequest request)

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

  • updateApiOperation(ApiOperation apiOperation, 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.

  • updateApiOperationCallable()

DeleteApiOperation

Delete an operation in an API version and we can delete only the operations created via create API. If the operation was created by parsing the spec, then it can be deleted by editing or deleting the spec.

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

  • deleteApiOperation(DeleteApiOperationRequest request)

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

  • deleteApiOperation(ApiOperationName name)

  • deleteApiOperation(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.

  • deleteApiOperationCallable()

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][google.cloud.apihub.v1.Deployment] can be updated:

  • [display_name][google.cloud.apihub.v1.Deployment.display_name]
  • [description][google.cloud.apihub.v1.Deployment.description]
  • [documentation][google.cloud.apihub.v1.Deployment.documentation]
  • [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type]
  • [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri]
  • [endpoints][google.cloud.apihub.v1.Deployment.endpoints]
  • [slo][google.cloud.apihub.v1.Deployment.slo]
  • [environment][google.cloud.apihub.v1.Deployment.environment]
  • [attributes][google.cloud.apihub.v1.Deployment.attributes]
  • [source_project] [google.cloud.apihub.v1.Deployment.source_project]
  • [source_environment] [google.cloud.apihub.v1.Deployment.source_environment]
  • [management_url][google.cloud.apihub.v1.Deployment.management_url]
  • [source_uri][google.cloud.apihub.v1.Deployment.source_uri] The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.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][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.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][google.cloud.apihub.v1.Attribute] can be updated:

  • [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be updated for user defined attributes only.
  • [description][google.cloud.apihub.v1.Attribute.description] The description can be updated for user defined attributes only.
  • [allowed_values][google.cloud.apihub.v1.Attribute.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][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update.

The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.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][google.cloud.apihub.v1.ExternalApi.display_name]
  • [description][google.cloud.apihub.v1.ExternalApi.description]
  • [documentation][google.cloud.apihub.v1.ExternalApi.documentation]
  • [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints]
  • [paths][google.cloud.apihub.v1.ExternalApi.paths]

The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.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);
 

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

  • Constructor Details

    • ApiHubClient

      protected ApiHubClient(ApiHubSettings settings) throws IOException
      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.
      Throws:
      IOException
    • ApiHubClient

      protected ApiHubClient(ApiHubStub stub)
  • Method Details

    • create

      public static final ApiHubClient create() throws IOException
      Constructs an instance of ApiHubClient with default settings.
      Throws:
      IOException
    • create

      public static final ApiHubClient create(ApiHubSettings settings) throws IOException
      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.
      Throws:
      IOException
    • create

      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).
    • getSettings

      public final ApiHubSettings getSettings()
    • getStub

      public ApiHubStub getStub()
    • createApi

      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:
      parent - Required. The parent resource for the API resource. Format: `projects/{project}/locations/{location}`
      api - Required. The API resource to create.
      apiId - 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][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createApi

      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:
      parent - Required. The parent resource for the API resource. Format: `projects/{project}/locations/{location}`
      api - Required. The API resource to create.
      apiId - 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][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createApi

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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();
       }
       
    • getApi

      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);
       }
       
      Parameters:
      name - Required. The name of the API resource to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}`
      Throws:
      ApiException - if the remote call fails
    • getApi

      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);
       }
       
      Parameters:
      name - Required. The name of the API resource to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}`
      Throws:
      ApiException - if the remote call fails
    • getApi

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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();
       }
       
    • listApis

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of API resources. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listApis

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of API resources. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listApis

      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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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);
         }
       }
       
    • 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;
           }
         }
       }
       
    • updateApi

      public final Api updateApi(Api api, com.google.protobuf.FieldMask updateMask)
      Update an API resource in the API hub. The following fields in the [API][google.cloud.apihub.v1.Api] can be updated:
      • [display_name][google.cloud.apihub.v1.Api.display_name]
      • [description][google.cloud.apihub.v1.Api.description]
      • [owner][google.cloud.apihub.v1.Api.owner]
      • [documentation][google.cloud.apihub.v1.Api.documentation]
      • [target_user][google.cloud.apihub.v1.Api.target_user]
      • [team][google.cloud.apihub.v1.Api.team]
      • [business_unit][google.cloud.apihub.v1.Api.business_unit]
      • [maturity_level][google.cloud.apihub.v1.Api.maturity_level]
      • [api_style][google.cloud.apihub.v1.Api.api_style]
      • [attributes][google.cloud.apihub.v1.Api.attributes]

      The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.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:
      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 - Required. The list of fields to update.
      Throws:
      ApiException - if the remote call fails
    • updateApi

      public final Api updateApi(UpdateApiRequest request)
      Update an API resource in the API hub. The following fields in the [API][google.cloud.apihub.v1.Api] can be updated:
      • [display_name][google.cloud.apihub.v1.Api.display_name]
      • [description][google.cloud.apihub.v1.Api.description]
      • [owner][google.cloud.apihub.v1.Api.owner]
      • [documentation][google.cloud.apihub.v1.Api.documentation]
      • [target_user][google.cloud.apihub.v1.Api.target_user]
      • [team][google.cloud.apihub.v1.Api.team]
      • [business_unit][google.cloud.apihub.v1.Api.business_unit]
      • [maturity_level][google.cloud.apihub.v1.Api.maturity_level]
      • [api_style][google.cloud.apihub.v1.Api.api_style]
      • [attributes][google.cloud.apihub.v1.Api.attributes]

      The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateApiCallable

      public final UnaryCallable<UpdateApiRequest,Api> updateApiCallable()
      Update an API resource in the API hub. The following fields in the [API][google.cloud.apihub.v1.Api] can be updated:
      • [display_name][google.cloud.apihub.v1.Api.display_name]
      • [description][google.cloud.apihub.v1.Api.description]
      • [owner][google.cloud.apihub.v1.Api.owner]
      • [documentation][google.cloud.apihub.v1.Api.documentation]
      • [target_user][google.cloud.apihub.v1.Api.target_user]
      • [team][google.cloud.apihub.v1.Api.team]
      • [business_unit][google.cloud.apihub.v1.Api.business_unit]
      • [maturity_level][google.cloud.apihub.v1.Api.maturity_level]
      • [api_style][google.cloud.apihub.v1.Api.api_style]
      • [attributes][google.cloud.apihub.v1.Api.attributes]

      The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.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();
       }
       
    • deleteApi

      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);
       }
       
      Parameters:
      name - Required. The name of the API resource to delete. Format: `projects/{project}/locations/{location}/apis/{api}`
      Throws:
      ApiException - if the remote call fails
    • deleteApi

      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);
       }
       
      Parameters:
      name - Required. The name of the API resource to delete. Format: `projects/{project}/locations/{location}/apis/{api}`
      Throws:
      ApiException - if the remote call fails
    • deleteApi

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteApiCallable

      public final UnaryCallable<DeleteApiRequest,com.google.protobuf.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();
       }
       
    • createVersion

      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:
      parent - Required. The parent resource for API version. Format: `projects/{project}/locations/{location}/apis/{api}`
      version - Required. The version to create.
      versionId - 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, overall resource name which will be of format `projects/{project}/locations/{location}/apis/{api}/versions/{version}`, its length is limited to 700 characters and valid characters are /[a-z][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createVersion

      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:
      parent - Required. The parent resource for API version. Format: `projects/{project}/locations/{location}/apis/{api}`
      version - Required. The version to create.
      versionId - 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, overall resource name which will be of format `projects/{project}/locations/{location}/apis/{api}/versions/{version}`, its length is limited to 700 characters and valid characters are /[a-z][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createVersion

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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();
       }
       
    • getVersion

      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);
       }
       
      Parameters:
      name - Required. The name of the API version to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
      Throws:
      ApiException - if the remote call fails
    • getVersion

      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);
       }
       
      Parameters:
      name - Required. The name of the API version to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
      Throws:
      ApiException - if the remote call fails
    • getVersion

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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();
       }
       
    • listVersions

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent which owns this collection of API versions i.e., the API resource Format: `projects/{project}/locations/{location}/apis/{api}`
      Throws:
      ApiException - if the remote call fails
    • listVersions

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent which owns this collection of API versions i.e., the API resource Format: `projects/{project}/locations/{location}/apis/{api}`
      Throws:
      ApiException - if the remote call fails
    • listVersions

      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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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);
         }
       }
       
    • 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;
           }
         }
       }
       
    • updateVersion

      public final Version updateVersion(Version version, com.google.protobuf.FieldMask updateMask)
      Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can be updated currently:
      • [display_name][google.cloud.apihub.v1.Version.display_name]
      • [description][google.cloud.apihub.v1.Version.description]
      • [documentation][google.cloud.apihub.v1.Version.documentation]
      • [deployments][google.cloud.apihub.v1.Version.deployments]
      • [lifecycle][google.cloud.apihub.v1.Version.lifecycle]
      • [compliance][google.cloud.apihub.v1.Version.compliance]
      • [accreditation][google.cloud.apihub.v1.Version.accreditation]
      • [attributes][google.cloud.apihub.v1.Version.attributes]

      The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.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:
      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 - Required. The list of fields to update.
      Throws:
      ApiException - if the remote call fails
    • updateVersion

      public final Version updateVersion(UpdateVersionRequest request)
      Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can be updated currently:
      • [display_name][google.cloud.apihub.v1.Version.display_name]
      • [description][google.cloud.apihub.v1.Version.description]
      • [documentation][google.cloud.apihub.v1.Version.documentation]
      • [deployments][google.cloud.apihub.v1.Version.deployments]
      • [lifecycle][google.cloud.apihub.v1.Version.lifecycle]
      • [compliance][google.cloud.apihub.v1.Version.compliance]
      • [accreditation][google.cloud.apihub.v1.Version.accreditation]
      • [attributes][google.cloud.apihub.v1.Version.attributes]

      The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateVersionCallable

      public final UnaryCallable<UpdateVersionRequest,Version> updateVersionCallable()
      Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can be updated currently:
      • [display_name][google.cloud.apihub.v1.Version.display_name]
      • [description][google.cloud.apihub.v1.Version.description]
      • [documentation][google.cloud.apihub.v1.Version.documentation]
      • [deployments][google.cloud.apihub.v1.Version.deployments]
      • [lifecycle][google.cloud.apihub.v1.Version.lifecycle]
      • [compliance][google.cloud.apihub.v1.Version.compliance]
      • [accreditation][google.cloud.apihub.v1.Version.accreditation]
      • [attributes][google.cloud.apihub.v1.Version.attributes]

      The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.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();
       }
       
    • deleteVersion

      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);
       }
       
      Parameters:
      name - Required. The name of the version to delete. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
      Throws:
      ApiException - if the remote call fails
    • deleteVersion

      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);
       }
       
      Parameters:
      name - Required. The name of the version to delete. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
      Throws:
      ApiException - if the remote call fails
    • deleteVersion

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteVersionCallable

      public final UnaryCallable<DeleteVersionRequest,com.google.protobuf.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();
       }
       
    • createSpec

      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][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.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:
      parent - Required. The parent resource for Spec. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
      spec - Required. The spec to create.
      specId - 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, overall resource name which will be of format `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`, its length is limited to 1000 characters and valid characters are /[a-z][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createSpec

      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][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.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:
      parent - Required. The parent resource for Spec. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
      spec - Required. The spec to create.
      specId - 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, overall resource name which will be of format `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`, its length is limited to 1000 characters and valid characters are /[a-z][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createSpec

      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][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.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();
       }
       
    • getSpec

      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][google.cloud.apihub.v1.ApiHub.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);
       }
       
      Parameters:
      name - Required. The name of the spec to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
      Throws:
      ApiException - if the remote call fails
    • getSpec

      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][google.cloud.apihub.v1.ApiHub.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);
       }
       
      Parameters:
      name - Required. The name of the spec to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
      Throws:
      ApiException - if the remote call fails
    • getSpec

      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][google.cloud.apihub.v1.ApiHub.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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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][google.cloud.apihub.v1.ApiHub.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();
       }
       
    • getSpecContents

      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);
       }
       
      Parameters:
      name - Required. The name of the spec whose contents need to be retrieved. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
      Throws:
      ApiException - if the remote call fails
    • getSpecContents

      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);
       }
       
      Parameters:
      name - Required. The name of the spec whose contents need to be retrieved. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
      Throws:
      ApiException - if the remote call fails
    • getSpecContents

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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();
       }
       
    • listSpecs

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of specs. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
      Throws:
      ApiException - if the remote call fails
    • listSpecs

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of specs. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
      Throws:
      ApiException - if the remote call fails
    • listSpecs

      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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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);
         }
       }
       
    • 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;
           }
         }
       }
       
    • updateSpec

      public final Spec updateSpec(Spec spec, com.google.protobuf.FieldMask updateMask)
      Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated:
      • [display_name][google.cloud.apihub.v1.Spec.display_name]
      • [source_uri][google.cloud.apihub.v1.Spec.source_uri]
      • [lint_response][google.cloud.apihub.v1.Spec.lint_response]
      • [attributes][google.cloud.apihub.v1.Spec.attributes]
      • [contents][google.cloud.apihub.v1.Spec.contents]
      • [spec_type][google.cloud.apihub.v1.Spec.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][google.cloud.apihub.v1.UpdateSpecRequest.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:
      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 - Required. The list of fields to update.
      Throws:
      ApiException - if the remote call fails
    • updateSpec

      public final Spec updateSpec(UpdateSpecRequest request)
      Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated:
      • [display_name][google.cloud.apihub.v1.Spec.display_name]
      • [source_uri][google.cloud.apihub.v1.Spec.source_uri]
      • [lint_response][google.cloud.apihub.v1.Spec.lint_response]
      • [attributes][google.cloud.apihub.v1.Spec.attributes]
      • [contents][google.cloud.apihub.v1.Spec.contents]
      • [spec_type][google.cloud.apihub.v1.Spec.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][google.cloud.apihub.v1.UpdateSpecRequest.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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateSpecCallable

      public final UnaryCallable<UpdateSpecRequest,Spec> updateSpecCallable()
      Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated:
      • [display_name][google.cloud.apihub.v1.Spec.display_name]
      • [source_uri][google.cloud.apihub.v1.Spec.source_uri]
      • [lint_response][google.cloud.apihub.v1.Spec.lint_response]
      • [attributes][google.cloud.apihub.v1.Spec.attributes]
      • [contents][google.cloud.apihub.v1.Spec.contents]
      • [spec_type][google.cloud.apihub.v1.Spec.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][google.cloud.apihub.v1.UpdateSpecRequest.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();
       }
       
    • deleteSpec

      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);
       }
       
      Parameters:
      name - Required. The name of the spec to delete. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
      Throws:
      ApiException - if the remote call fails
    • deleteSpec

      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);
       }
       
      Parameters:
      name - Required. The name of the spec to delete. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
      Throws:
      ApiException - if the remote call fails
    • deleteSpec

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteSpecCallable

      public final UnaryCallable<DeleteSpecRequest,com.google.protobuf.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();
       }
       
    • createApiOperation

      public final ApiOperation createApiOperation(VersionName parent, ApiOperation apiOperation, String apiOperationId)
      Create an apiOperation in an API version. An apiOperation can be created only if the version has no apiOperations which were created by parsing a spec.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ApiHubClient apiHubClient = ApiHubClient.create()) {
         VersionName parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]");
         ApiOperation apiOperation = ApiOperation.newBuilder().build();
         String apiOperationId = "apiOperationId-2124555672";
         ApiOperation response = apiHubClient.createApiOperation(parent, apiOperation, apiOperationId);
       }
       
      Parameters:
      parent - Required. The parent resource for the operation resource. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
      apiOperation - Required. The operation resource to create.
      apiOperationId - Optional. The ID to use for the operation resource, which will become the final component of the operation'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 operation resource in the API hub.
      • If not provided, a system generated id will be used.

      This value should be 4-500 characters, overall resource name which will be of format `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`, its length is limited to 700 characters, and valid characters are /[a-z][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createApiOperation

      public final ApiOperation createApiOperation(String parent, ApiOperation apiOperation, String apiOperationId)
      Create an apiOperation in an API version. An apiOperation can be created only if the version has no apiOperations which were created by parsing a spec.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ApiHubClient apiHubClient = ApiHubClient.create()) {
         String parent = VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString();
         ApiOperation apiOperation = ApiOperation.newBuilder().build();
         String apiOperationId = "apiOperationId-2124555672";
         ApiOperation response = apiHubClient.createApiOperation(parent, apiOperation, apiOperationId);
       }
       
      Parameters:
      parent - Required. The parent resource for the operation resource. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
      apiOperation - Required. The operation resource to create.
      apiOperationId - Optional. The ID to use for the operation resource, which will become the final component of the operation'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 operation resource in the API hub.
      • If not provided, a system generated id will be used.

      This value should be 4-500 characters, overall resource name which will be of format `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`, its length is limited to 700 characters, and valid characters are /[a-z][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createApiOperation

      public final ApiOperation createApiOperation(CreateApiOperationRequest request)
      Create an apiOperation in an API version. An apiOperation can be created only if the version has no apiOperations which were created by parsing a spec.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ApiHubClient apiHubClient = ApiHubClient.create()) {
         CreateApiOperationRequest request =
             CreateApiOperationRequest.newBuilder()
                 .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString())
                 .setApiOperationId("apiOperationId-2124555672")
                 .setApiOperation(ApiOperation.newBuilder().build())
                 .build();
         ApiOperation response = apiHubClient.createApiOperation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createApiOperationCallable

      public final UnaryCallable<CreateApiOperationRequest,ApiOperation> createApiOperationCallable()
      Create an apiOperation in an API version. An apiOperation can be created only if the version has no apiOperations which were created by parsing a spec.

      Sample code:

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

      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);
       }
       
      Parameters:
      name - Required. The name of the operation to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
      Throws:
      ApiException - if the remote call fails
    • getApiOperation

      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);
       }
       
      Parameters:
      name - Required. The name of the operation to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
      Throws:
      ApiException - if the remote call fails
    • getApiOperation

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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();
       }
       
    • listApiOperations

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent which owns this collection of operations i.e., the API version. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
      Throws:
      ApiException - if the remote call fails
    • listApiOperations

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent which owns this collection of operations i.e., the API version. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
      Throws:
      ApiException - if the remote call fails
    • listApiOperations

      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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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);
         }
       }
       
    • 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;
           }
         }
       }
       
    • updateApiOperation

      public final ApiOperation updateApiOperation(ApiOperation apiOperation, com.google.protobuf.FieldMask updateMask)
      Update an operation in an API version. The following fields in the [ApiOperation resource][google.cloud.apihub.v1.ApiOperation] can be updated:
      • [details.description][ApiOperation.details.description]
      • [details.documentation][ApiOperation.details.documentation]
      • [details.http_operation.path][ApiOperation.details.http_operation.path.path]
      • [details.http_operation.method][ApiOperation.details.http_operation.method]
      • [details.deprecated][ApiOperation.details.deprecated]
      • [attributes][google.cloud.apihub.v1.ApiOperation.attributes]

      The [update_mask][google.cloud.apihub.v1.UpdateApiOperationRequest.update_mask] should be used to specify the fields being updated.

      An operation can be updated only if the operation was created via [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation] API. If the operation was created by parsing the spec, then it can be edited by updating the spec.

      Sample code:

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

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

      updateMask - Required. The list of fields to update.
      Throws:
      ApiException - if the remote call fails
    • updateApiOperation

      public final ApiOperation updateApiOperation(UpdateApiOperationRequest request)
      Update an operation in an API version. The following fields in the [ApiOperation resource][google.cloud.apihub.v1.ApiOperation] can be updated:
      • [details.description][ApiOperation.details.description]
      • [details.documentation][ApiOperation.details.documentation]
      • [details.http_operation.path][ApiOperation.details.http_operation.path.path]
      • [details.http_operation.method][ApiOperation.details.http_operation.method]
      • [details.deprecated][ApiOperation.details.deprecated]
      • [attributes][google.cloud.apihub.v1.ApiOperation.attributes]

      The [update_mask][google.cloud.apihub.v1.UpdateApiOperationRequest.update_mask] should be used to specify the fields being updated.

      An operation can be updated only if the operation was created via [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation] API. If the operation was created by parsing the spec, then it can be edited by updating the spec.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ApiHubClient apiHubClient = ApiHubClient.create()) {
         UpdateApiOperationRequest request =
             UpdateApiOperationRequest.newBuilder()
                 .setApiOperation(ApiOperation.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiOperation response = apiHubClient.updateApiOperation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateApiOperationCallable

      public final UnaryCallable<UpdateApiOperationRequest,ApiOperation> updateApiOperationCallable()
      Update an operation in an API version. The following fields in the [ApiOperation resource][google.cloud.apihub.v1.ApiOperation] can be updated:
      • [details.description][ApiOperation.details.description]
      • [details.documentation][ApiOperation.details.documentation]
      • [details.http_operation.path][ApiOperation.details.http_operation.path.path]
      • [details.http_operation.method][ApiOperation.details.http_operation.method]
      • [details.deprecated][ApiOperation.details.deprecated]
      • [attributes][google.cloud.apihub.v1.ApiOperation.attributes]

      The [update_mask][google.cloud.apihub.v1.UpdateApiOperationRequest.update_mask] should be used to specify the fields being updated.

      An operation can be updated only if the operation was created via [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation] API. If the operation was created by parsing the spec, then it can be edited by updating the spec.

      Sample code:

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

      public final void deleteApiOperation(ApiOperationName name)
      Delete an operation in an API version and we can delete only the operations created via create API. If the operation was created by parsing the spec, then it can be deleted by editing or deleting the spec.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ApiHubClient apiHubClient = ApiHubClient.create()) {
         ApiOperationName name =
             ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]");
         apiHubClient.deleteApiOperation(name);
       }
       
      Parameters:
      name - Required. The name of the operation resource to delete. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
      Throws:
      ApiException - if the remote call fails
    • deleteApiOperation

      public final void deleteApiOperation(String name)
      Delete an operation in an API version and we can delete only the operations created via create API. If the operation was created by parsing the spec, then it can be deleted by editing or deleting the spec.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ApiHubClient apiHubClient = ApiHubClient.create()) {
         String name =
             ApiOperationName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]")
                 .toString();
         apiHubClient.deleteApiOperation(name);
       }
       
      Parameters:
      name - Required. The name of the operation resource to delete. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
      Throws:
      ApiException - if the remote call fails
    • deleteApiOperation

      public final void deleteApiOperation(DeleteApiOperationRequest request)
      Delete an operation in an API version and we can delete only the operations created via create API. If the operation was created by parsing the spec, then it can be deleted by editing or deleting the spec.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (ApiHubClient apiHubClient = ApiHubClient.create()) {
         DeleteApiOperationRequest request =
             DeleteApiOperationRequest.newBuilder()
                 .setName(
                     ApiOperationName.of(
                             "[PROJECT]", "[LOCATION]", "[API]", "[VERSION]", "[OPERATION]")
                         .toString())
                 .build();
         apiHubClient.deleteApiOperation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteApiOperationCallable

      public final UnaryCallable<DeleteApiOperationRequest,com.google.protobuf.Empty> deleteApiOperationCallable()
      Delete an operation in an API version and we can delete only the operations created via create API. If the operation was created by parsing the spec, then it can be deleted by editing or deleting the spec.

      Sample code:

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

      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);
       }
       
      Parameters:
      name - Required. The name of the definition to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
      Throws:
      ApiException - if the remote call fails
    • getDefinition

      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);
       }
       
      Parameters:
      name - Required. The name of the definition to retrieve. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
      Throws:
      ApiException - if the remote call fails
    • getDefinition

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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();
       }
       
    • createDeployment

      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:
      parent - Required. The parent resource for the deployment resource. Format: `projects/{project}/locations/{location}`
      deployment - Required. The deployment resource to create.
      deploymentId - 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][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createDeployment

      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:
      parent - Required. The parent resource for the deployment resource. Format: `projects/{project}/locations/{location}`
      deployment - Required. The deployment resource to create.
      deploymentId - 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][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createDeployment

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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();
       }
       
    • getDeployment

      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);
       }
       
      Parameters:
      name - Required. The name of the deployment resource to retrieve. Format: `projects/{project}/locations/{location}/deployments/{deployment}`
      Throws:
      ApiException - if the remote call fails
    • getDeployment

      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);
       }
       
      Parameters:
      name - Required. The name of the deployment resource to retrieve. Format: `projects/{project}/locations/{location}/deployments/{deployment}`
      Throws:
      ApiException - if the remote call fails
    • getDeployment

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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();
       }
       
    • listDeployments

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of deployment resources. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listDeployments

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of deployment resources. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listDeployments

      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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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);
         }
       }
       
    • 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;
           }
         }
       }
       
    • updateDeployment

      public final Deployment updateDeployment(Deployment deployment, com.google.protobuf.FieldMask updateMask)
      Update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated:
      • [display_name][google.cloud.apihub.v1.Deployment.display_name]
      • [description][google.cloud.apihub.v1.Deployment.description]
      • [documentation][google.cloud.apihub.v1.Deployment.documentation]
      • [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type]
      • [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri]
      • [endpoints][google.cloud.apihub.v1.Deployment.endpoints]
      • [slo][google.cloud.apihub.v1.Deployment.slo]
      • [environment][google.cloud.apihub.v1.Deployment.environment]
      • [attributes][google.cloud.apihub.v1.Deployment.attributes]
      • [source_project] [google.cloud.apihub.v1.Deployment.source_project]
      • [source_environment] [google.cloud.apihub.v1.Deployment.source_environment]
      • [management_url][google.cloud.apihub.v1.Deployment.management_url]
      • [source_uri][google.cloud.apihub.v1.Deployment.source_uri] The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.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:
      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 - Required. The list of fields to update.
      Throws:
      ApiException - if the remote call fails
    • updateDeployment

      public final Deployment updateDeployment(UpdateDeploymentRequest request)
      Update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated:
      • [display_name][google.cloud.apihub.v1.Deployment.display_name]
      • [description][google.cloud.apihub.v1.Deployment.description]
      • [documentation][google.cloud.apihub.v1.Deployment.documentation]
      • [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type]
      • [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri]
      • [endpoints][google.cloud.apihub.v1.Deployment.endpoints]
      • [slo][google.cloud.apihub.v1.Deployment.slo]
      • [environment][google.cloud.apihub.v1.Deployment.environment]
      • [attributes][google.cloud.apihub.v1.Deployment.attributes]
      • [source_project] [google.cloud.apihub.v1.Deployment.source_project]
      • [source_environment] [google.cloud.apihub.v1.Deployment.source_environment]
      • [management_url][google.cloud.apihub.v1.Deployment.management_url]
      • [source_uri][google.cloud.apihub.v1.Deployment.source_uri] The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateDeploymentCallable

      public final UnaryCallable<UpdateDeploymentRequest,Deployment> updateDeploymentCallable()
      Update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated:
      • [display_name][google.cloud.apihub.v1.Deployment.display_name]
      • [description][google.cloud.apihub.v1.Deployment.description]
      • [documentation][google.cloud.apihub.v1.Deployment.documentation]
      • [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type]
      • [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri]
      • [endpoints][google.cloud.apihub.v1.Deployment.endpoints]
      • [slo][google.cloud.apihub.v1.Deployment.slo]
      • [environment][google.cloud.apihub.v1.Deployment.environment]
      • [attributes][google.cloud.apihub.v1.Deployment.attributes]
      • [source_project] [google.cloud.apihub.v1.Deployment.source_project]
      • [source_environment] [google.cloud.apihub.v1.Deployment.source_environment]
      • [management_url][google.cloud.apihub.v1.Deployment.management_url]
      • [source_uri][google.cloud.apihub.v1.Deployment.source_uri] The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.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();
       }
       
    • deleteDeployment

      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);
       }
       
      Parameters:
      name - Required. The name of the deployment resource to delete. Format: `projects/{project}/locations/{location}/deployments/{deployment}`
      Throws:
      ApiException - if the remote call fails
    • deleteDeployment

      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);
       }
       
      Parameters:
      name - Required. The name of the deployment resource to delete. Format: `projects/{project}/locations/{location}/deployments/{deployment}`
      Throws:
      ApiException - if the remote call fails
    • deleteDeployment

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteDeploymentCallable

      public final UnaryCallable<DeleteDeploymentRequest,com.google.protobuf.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();
       }
       
    • createAttribute

      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][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.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:
      parent - Required. The parent resource for Attribute. Format: `projects/{project}/locations/{location}`
      attribute - Required. The attribute to create.
      attributeId - 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][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createAttribute

      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][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.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:
      parent - Required. The parent resource for Attribute. Format: `projects/{project}/locations/{location}`
      attribute - Required. The attribute to create.
      attributeId - 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][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createAttribute

      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][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.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();
       }
       
    • getAttribute

      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);
       }
       
      Parameters:
      name - Required. The name of the attribute to retrieve. Format: `projects/{project}/locations/{location}/attributes/{attribute}`
      Throws:
      ApiException - if the remote call fails
    • getAttribute

      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);
       }
       
      Parameters:
      name - Required. The name of the attribute to retrieve. Format: `projects/{project}/locations/{location}/attributes/{attribute}`
      Throws:
      ApiException - if the remote call fails
    • getAttribute

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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();
       }
       
    • updateAttribute

      public final Attribute updateAttribute(Attribute attribute, com.google.protobuf.FieldMask updateMask)
      Update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated:
      • [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be updated for user defined attributes only.
      • [description][google.cloud.apihub.v1.Attribute.description] The description can be updated for user defined attributes only.
      • [allowed_values][google.cloud.apihub.v1.Attribute.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][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update.

      The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.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:
      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 - Required. The list of fields to update.
      Throws:
      ApiException - if the remote call fails
    • updateAttribute

      public final Attribute updateAttribute(UpdateAttributeRequest request)
      Update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated:
      • [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be updated for user defined attributes only.
      • [description][google.cloud.apihub.v1.Attribute.description] The description can be updated for user defined attributes only.
      • [allowed_values][google.cloud.apihub.v1.Attribute.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][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update.

      The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateAttributeCallable

      public final UnaryCallable<UpdateAttributeRequest,Attribute> updateAttributeCallable()
      Update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated:
      • [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be updated for user defined attributes only.
      • [description][google.cloud.apihub.v1.Attribute.description] The description can be updated for user defined attributes only.
      • [allowed_values][google.cloud.apihub.v1.Attribute.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][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update.

      The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.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();
       }
       
    • deleteAttribute

      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);
       }
       
      Parameters:
      name - Required. The name of the attribute to delete. Format: `projects/{project}/locations/{location}/attributes/{attribute}`
      Throws:
      ApiException - if the remote call fails
    • deleteAttribute

      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);
       }
       
      Parameters:
      name - Required. The name of the attribute to delete. Format: `projects/{project}/locations/{location}/attributes/{attribute}`
      Throws:
      ApiException - if the remote call fails
    • deleteAttribute

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteAttributeCallable

      public final UnaryCallable<DeleteAttributeRequest,com.google.protobuf.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();
       }
       
    • listAttributes

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent resource for Attribute. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listAttributes

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent resource for Attribute. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listAttributes

      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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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);
         }
       }
       
    • 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;
           }
         }
       }
       
    • searchResources

      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:
      location - 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 - 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.
      Throws:
      ApiException - if the remote call fails
    • searchResources

      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:
      location - 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 - 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.
      Throws:
      ApiException - if the remote call fails
    • searchResources

      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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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);
         }
       }
       
    • 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;
           }
         }
       }
       
    • createExternalApi

      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:
      parent - Required. The parent resource for the External API resource. Format: `projects/{project}/locations/{location}`
      externalApi - Required. The External API resource to create.
      externalApiId - 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][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createExternalApi

      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:
      parent - Required. The parent resource for the External API resource. Format: `projects/{project}/locations/{location}`
      externalApi - Required. The External API resource to create.
      externalApiId - 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][A-Z][0-9]-_/.

      Throws:
      ApiException - if the remote call fails
    • createExternalApi

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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();
       }
       
    • getExternalApi

      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);
       }
       
      Parameters:
      name - Required. The name of the External API resource to retrieve. Format: `projects/{project}/locations/{location}/externalApis/{externalApi}`
      Throws:
      ApiException - if the remote call fails
    • getExternalApi

      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);
       }
       
      Parameters:
      name - Required. The name of the External API resource to retrieve. Format: `projects/{project}/locations/{location}/externalApis/{externalApi}`
      Throws:
      ApiException - if the remote call fails
    • getExternalApi

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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();
       }
       
    • updateExternalApi

      public final ExternalApi updateExternalApi(ExternalApi externalApi, com.google.protobuf.FieldMask updateMask)
      Update an External API resource in the API hub. The following fields can be updated:
      • [display_name][google.cloud.apihub.v1.ExternalApi.display_name]
      • [description][google.cloud.apihub.v1.ExternalApi.description]
      • [documentation][google.cloud.apihub.v1.ExternalApi.documentation]
      • [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints]
      • [paths][google.cloud.apihub.v1.ExternalApi.paths]

      The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.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:
      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 - Required. The list of fields to update.
      Throws:
      ApiException - if the remote call fails
    • updateExternalApi

      public final ExternalApi updateExternalApi(UpdateExternalApiRequest request)
      Update an External API resource in the API hub. The following fields can be updated:
      • [display_name][google.cloud.apihub.v1.ExternalApi.display_name]
      • [description][google.cloud.apihub.v1.ExternalApi.description]
      • [documentation][google.cloud.apihub.v1.ExternalApi.documentation]
      • [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints]
      • [paths][google.cloud.apihub.v1.ExternalApi.paths]

      The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateExternalApiCallable

      public final UnaryCallable<UpdateExternalApiRequest,ExternalApi> updateExternalApiCallable()
      Update an External API resource in the API hub. The following fields can be updated:
      • [display_name][google.cloud.apihub.v1.ExternalApi.display_name]
      • [description][google.cloud.apihub.v1.ExternalApi.description]
      • [documentation][google.cloud.apihub.v1.ExternalApi.documentation]
      • [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints]
      • [paths][google.cloud.apihub.v1.ExternalApi.paths]

      The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.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();
       }
       
    • deleteExternalApi

      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);
       }
       
      Parameters:
      name - Required. The name of the External API resource to delete. Format: `projects/{project}/locations/{location}/externalApis/{externalApi}`
      Throws:
      ApiException - if the remote call fails
    • deleteExternalApi

      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);
       }
       
      Parameters:
      name - Required. The name of the External API resource to delete. Format: `projects/{project}/locations/{location}/externalApis/{externalApi}`
      Throws:
      ApiException - if the remote call fails
    • deleteExternalApi

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteExternalApiCallable

      public final UnaryCallable<DeleteExternalApiRequest,com.google.protobuf.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();
       }
       
    • listExternalApis

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of External API resources. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listExternalApis

      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);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of External API resources. Format: `projects/{project}/locations/{location}`
      Throws:
      ApiException - if the remote call fails
    • listExternalApis

      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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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);
         }
       }
       
    • 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;
           }
         }
       }
       
    • listLocations

      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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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);
         }
       }
       
    • 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;
           }
         }
       }
       
    • getLocation

      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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • 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();
       }
       
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface BackgroundResource
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface BackgroundResource
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface BackgroundResource
    • shutdownNow

      public void shutdownNow()
      Specified by:
      shutdownNow in interface BackgroundResource
    • awaitTermination

      public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface BackgroundResource
      Throws:
      InterruptedException