Class ApiHubClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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().
| 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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateApi |
Update an API resource in the API hub. The following fields in the [API][google.cloud.apihub.v1.Api] can be updated:
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateVersion |
Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can be updated currently:
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetSpecContents |
Get spec contents. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateSpec |
Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated:
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateApiOperation |
Update an operation in an API version. The following fields in the [ApiOperation resource][google.cloud.apihub.v1.ApiOperation] can be updated:
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateDeployment |
Update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated:
|
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetAttribute |
Get details about the attribute. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateAttribute |
Update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated:
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListAttributes |
List all attributes. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SearchResources |
Search across API-Hub resources. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateExternalApi |
Update an External API resource in the API hub. The following fields can be updated:
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedApiHubClient(ApiHubSettings settings) Constructs an instance of ApiHubClient, using the given settings.protectedApiHubClient(ApiHubStub stub) -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final ApiHubClientcreate()Constructs an instance of ApiHubClient with default settings.static final ApiHubClientcreate(ApiHubSettings settings) Constructs an instance of ApiHubClient, using the given settings.static final ApiHubClientcreate(ApiHubStub stub) Constructs an instance of ApiHubClient, using the given stub for making calls.final ApicreateApi(CreateApiRequest request) Create an API resource in the API hub.final ApicreateApi(LocationName parent, Api api, String apiId) Create an API resource in the API hub.final ApiCreate an API resource in the API hub.final UnaryCallable<CreateApiRequest,Api> Create an API resource in the API hub.final ApiOperationCreate an apiOperation in an API version.final ApiOperationcreateApiOperation(VersionName parent, ApiOperation apiOperation, String apiOperationId) Create an apiOperation in an API version.final ApiOperationcreateApiOperation(String parent, ApiOperation apiOperation, String apiOperationId) Create an apiOperation in an API version.Create an apiOperation in an API version.final AttributecreateAttribute(CreateAttributeRequest request) Create a user defined attribute.final AttributecreateAttribute(LocationName parent, Attribute attribute, String attributeId) Create a user defined attribute.final AttributecreateAttribute(String parent, Attribute attribute, String attributeId) Create a user defined attribute.Create a user defined attribute.final DeploymentcreateDeployment(CreateDeploymentRequest request) Create a deployment resource in the API hub.final DeploymentcreateDeployment(LocationName parent, Deployment deployment, String deploymentId) Create a deployment resource in the API hub.final DeploymentcreateDeployment(String parent, Deployment deployment, String deploymentId) Create a deployment resource in the API hub.Create a deployment resource in the API hub.final ExternalApiCreate an External API resource in the API hub.final ExternalApicreateExternalApi(LocationName parent, ExternalApi externalApi, String externalApiId) Create an External API resource in the API hub.final ExternalApicreateExternalApi(String parent, ExternalApi externalApi, String externalApiId) Create an External API resource in the API hub.Create an External API resource in the API hub.final SpeccreateSpec(CreateSpecRequest request) Add a spec to an API version in the API hub.final SpeccreateSpec(VersionName parent, Spec spec, String specId) Add a spec to an API version in the API hub.final SpeccreateSpec(String parent, Spec spec, String specId) Add a spec to an API version in the API hub.final UnaryCallable<CreateSpecRequest,Spec> Add a spec to an API version in the API hub.final VersioncreateVersion(ApiName parent, Version version, String versionId) Create an API version for an API resource in the API hub.final VersioncreateVersion(CreateVersionRequest request) Create an API version for an API resource in the API hub.final VersioncreateVersion(String parent, Version version, String versionId) Create an API version for an API resource in the API hub.Create an API version for an API resource in the API hub.final voidDelete an API resource in the API hub.final voiddeleteApi(DeleteApiRequest request) Delete an API resource in the API hub.final voidDelete an API resource in the API hub.final UnaryCallable<DeleteApiRequest,com.google.protobuf.Empty> Delete an API resource in the API hub.final voidDelete an operation in an API version and we can delete only the operations created via create API.final voidDelete an operation in an API version and we can delete only the operations created via create API.final voiddeleteApiOperation(String name) Delete an operation in an API version and we can delete only the operations created via create API.final UnaryCallable<DeleteApiOperationRequest,com.google.protobuf.Empty> Delete an operation in an API version and we can delete only the operations created via create API.final voiddeleteAttribute(AttributeName name) Delete an attribute.final voiddeleteAttribute(DeleteAttributeRequest request) Delete an attribute.final voiddeleteAttribute(String name) Delete an attribute.final UnaryCallable<DeleteAttributeRequest,com.google.protobuf.Empty> Delete an attribute.final voiddeleteDeployment(DeleteDeploymentRequest request) Delete a deployment resource in the API hub.final voidDelete a deployment resource in the API hub.final voiddeleteDeployment(String name) Delete a deployment resource in the API hub.final UnaryCallable<DeleteDeploymentRequest,com.google.protobuf.Empty> Delete a deployment resource in the API hub.final voidDelete an External API resource in the API hub.final voidDelete an External API resource in the API hub.final voiddeleteExternalApi(String name) Delete an External API resource in the API hub.final UnaryCallable<DeleteExternalApiRequest,com.google.protobuf.Empty> Delete an External API resource in the API hub.final voiddeleteSpec(DeleteSpecRequest request) Delete a spec.final voiddeleteSpec(SpecName name) Delete a spec.final voiddeleteSpec(String name) Delete a spec.final UnaryCallable<DeleteSpecRequest,com.google.protobuf.Empty> Delete a spec.final voiddeleteVersion(DeleteVersionRequest request) Delete an API version.final voiddeleteVersion(VersionName name) Delete an API version.final voiddeleteVersion(String name) Delete an API version.final UnaryCallable<DeleteVersionRequest,com.google.protobuf.Empty> Delete an API version.final ApiGet API resource details including the API versions contained in it.final ApigetApi(GetApiRequest request) Get API resource details including the API versions contained in it.final ApiGet API resource details including the API versions contained in it.final UnaryCallable<GetApiRequest,Api> Get API resource details including the API versions contained in it.final ApiOperationGet details about a particular operation in API version.final ApiOperationgetApiOperation(GetApiOperationRequest request) Get details about a particular operation in API version.final ApiOperationgetApiOperation(String name) Get details about a particular operation in API version.Get details about a particular operation in API version.final AttributegetAttribute(AttributeName name) Get details about the attribute.final AttributegetAttribute(GetAttributeRequest request) Get details about the attribute.final AttributegetAttribute(String name) Get details about the attribute.Get details about the attribute.final DefinitiongetDefinition(DefinitionName name) Get details about a definition in an API version.final DefinitiongetDefinition(GetDefinitionRequest request) Get details about a definition in an API version.final DefinitiongetDefinition(String name) Get details about a definition in an API version.Get details about a definition in an API version.final DeploymentgetDeployment(DeploymentName name) Get details about a deployment and the API versions linked to it.final DeploymentgetDeployment(GetDeploymentRequest request) Get details about a deployment and the API versions linked to it.final DeploymentgetDeployment(String name) Get details about a deployment and the API versions linked to it.Get details about a deployment and the API versions linked to it.final ExternalApiGet details about an External API resource in the API hub.final ExternalApigetExternalApi(GetExternalApiRequest request) Get details about an External API resource in the API hub.final ExternalApigetExternalApi(String name) Get details about an External API resource in the API hub.Get details about an External API resource in the API hub.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final ApiHubSettingsfinal SpecgetSpec(GetSpecRequest request) Get details about the information parsed from a spec.final SpecGet details about the information parsed from a spec.final SpecGet details about the information parsed from a spec.final UnaryCallable<GetSpecRequest,Spec> Get details about the information parsed from a spec.final SpecContentsgetSpecContents(GetSpecContentsRequest request) Get spec contents.final SpecContentsgetSpecContents(SpecName name) Get spec contents.final SpecContentsgetSpecContents(String name) Get spec contents.Get spec contents.getStub()final VersiongetVersion(GetVersionRequest request) Get details about the API version of an API resource.final VersiongetVersion(VersionName name) Get details about the API version of an API resource.final VersiongetVersion(String name) Get details about the API version of an API resource.Get details about the API version of an API resource.booleanbooleanList operations in an API version.listApiOperations(VersionName parent) List operations in an API version.listApiOperations(String parent) List operations in an API version.List operations in an API version.List operations in an API version.listApis(ListApisRequest request) List API resources in the API hub.listApis(LocationName parent) List API resources in the API hub.List API resources in the API hub.List API resources in the API hub.List API resources in the API hub.listAttributes(ListAttributesRequest request) List all attributes.listAttributes(LocationName parent) List all attributes.listAttributes(String parent) List all attributes.List all attributes.List all attributes.listDeployments(ListDeploymentsRequest request) List deployment resources in the API hub.listDeployments(LocationName parent) List deployment resources in the API hub.listDeployments(String parent) List deployment resources in the API hub.List deployment resources in the API hub.List deployment resources in the API hub.listExternalApis(ListExternalApisRequest request) List External API resources in the API hub.listExternalApis(LocationName parent) List External API resources in the API hub.listExternalApis(String parent) List External API resources in the API hub.List External API resources in the API hub.List External API resources in the API hub.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.listSpecs(ListSpecsRequest request) List specs corresponding to a particular API resource.listSpecs(VersionName parent) List specs corresponding to a particular API resource.List specs corresponding to a particular API resource.List specs corresponding to a particular API resource.List specs corresponding to a particular API resource.listVersions(ApiName parent) List API versions of an API resource in the API hub.listVersions(ListVersionsRequest request) List API versions of an API resource in the API hub.listVersions(String parent) List API versions of an API resource in the API hub.List API versions of an API resource in the API hub.List API versions of an API resource in the API hub.searchResources(LocationName location, String query) Search across API-Hub resources.searchResources(SearchResourcesRequest request) Search across API-Hub resources.searchResources(String location, String query) Search across API-Hub resources.Search across API-Hub resources.Search across API-Hub resources.voidshutdown()voidfinal ApiUpdate an API resource in the API hub.final ApiupdateApi(UpdateApiRequest request) Update an API resource in the API hub.final UnaryCallable<UpdateApiRequest,Api> Update an API resource in the API hub.final ApiOperationupdateApiOperation(ApiOperation apiOperation, com.google.protobuf.FieldMask updateMask) Update an operation in an API version.final ApiOperationUpdate an operation in an API version.Update an operation in an API version.final AttributeupdateAttribute(Attribute attribute, com.google.protobuf.FieldMask updateMask) Update the attribute.final AttributeupdateAttribute(UpdateAttributeRequest request) Update the attribute.Update the attribute.final DeploymentupdateDeployment(Deployment deployment, com.google.protobuf.FieldMask updateMask) Update a deployment resource in the API hub.final DeploymentupdateDeployment(UpdateDeploymentRequest request) Update a deployment resource in the API hub.Update a deployment resource in the API hub.final ExternalApiupdateExternalApi(ExternalApi externalApi, com.google.protobuf.FieldMask updateMask) Update an External API resource in the API hub.final ExternalApiUpdate an External API resource in the API hub.Update an External API resource in the API hub.final SpecupdateSpec(Spec spec, com.google.protobuf.FieldMask updateMask) Update spec.final SpecupdateSpec(UpdateSpecRequest request) Update spec.final UnaryCallable<UpdateSpecRequest,Spec> Update spec.final VersionupdateVersion(UpdateVersionRequest request) Update API version.final VersionupdateVersion(Version version, com.google.protobuf.FieldMask updateMask) Update API version.Update API version.
-
Constructor Details
-
ApiHubClient
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
-
-
Method Details
-
create
Constructs an instance of ApiHubClient with default settings.- Throws:
IOException
-
create
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
Constructs an instance of ApiHubClient, using the given stub for making calls. This is for advanced usage - prefer using create(ApiHubSettings). -
getSettings
-
getStub
-
createApi
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
public final UnaryCallable<ListVersionsRequest,ApiHubClient.ListVersionsPagedResponse> listVersionsPagedCallable()List API versions of an API resource in the API hub.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubClient apiHubClient = ApiHubClient.create()) { ListVersionsRequest request = ListVersionsRequest.newBuilder() .setParent(ApiName.of("[PROJECT]", "[LOCATION]", "[API]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Version> future = apiHubClient.listVersionsPagedCallable().futureCall(request); // Do something. for (Version element : future.get().iterateAll()) { // doThingsWith(element); } } -
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
public final ApiHubClient.ListApiOperationsPagedResponse listApiOperations(ListApiOperationsRequest request) List operations in an API version.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubClient apiHubClient = ApiHubClient.create()) { ListApiOperationsRequest request = ListApiOperationsRequest.newBuilder() .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (ApiOperation element : apiHubClient.listApiOperations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listApiOperationsPagedCallable
public final UnaryCallable<ListApiOperationsRequest,ApiHubClient.ListApiOperationsPagedResponse> listApiOperationsPagedCallable()List operations in an API version.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubClient apiHubClient = ApiHubClient.create()) { ListApiOperationsRequest request = ListApiOperationsRequest.newBuilder() .setParent(VersionName.of("[PROJECT]", "[LOCATION]", "[API]", "[VERSION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<ApiOperation> future = apiHubClient.listApiOperationsPagedCallable().futureCall(request); // Do something. for (ApiOperation element : future.get().iterateAll()) { // doThingsWith(element); } } -
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
public final UnaryCallable<ListDeploymentsRequest,ApiHubClient.ListDeploymentsPagedResponse> listDeploymentsPagedCallable()List deployment resources in the API hub.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubClient apiHubClient = ApiHubClient.create()) { ListDeploymentsRequest request = ListDeploymentsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Deployment> future = apiHubClient.listDeploymentsPagedCallable().futureCall(request); // Do something. for (Deployment element : future.get().iterateAll()) { // doThingsWith(element); } } -
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
public final UnaryCallable<ListAttributesRequest,ApiHubClient.ListAttributesPagedResponse> listAttributesPagedCallable()List all attributes.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubClient apiHubClient = ApiHubClient.create()) { ListAttributesRequest request = ListAttributesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Attribute> future = apiHubClient.listAttributesPagedCallable().futureCall(request); // Do something. for (Attribute element : future.get().iterateAll()) { // doThingsWith(element); } } -
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
public final UnaryCallable<SearchResourcesRequest,ApiHubClient.SearchResourcesPagedResponse> searchResourcesPagedCallable()Search across API-Hub resources.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubClient apiHubClient = ApiHubClient.create()) { SearchResourcesRequest request = SearchResourcesRequest.newBuilder() .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setQuery("query107944136") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<SearchResult> future = apiHubClient.searchResourcesPagedCallable().futureCall(request); // Do something. for (SearchResult element : future.get().iterateAll()) { // doThingsWith(element); } } -
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
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
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
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
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
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
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
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
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
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
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
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
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
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
public final ApiHubClient.ListExternalApisPagedResponse listExternalApis(ListExternalApisRequest request) List External API resources in the API hub.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubClient apiHubClient = ApiHubClient.create()) { ListExternalApisRequest request = ListExternalApisRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (ExternalApi element : apiHubClient.listExternalApis(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listExternalApisPagedCallable
public final UnaryCallable<ListExternalApisRequest,ApiHubClient.ListExternalApisPagedResponse> listExternalApisPagedCallable()List External API resources in the API hub.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubClient apiHubClient = ApiHubClient.create()) { ListExternalApisRequest request = ListExternalApisRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<ExternalApi> future = apiHubClient.listExternalApisPagedCallable().futureCall(request); // Do something. for (ExternalApi element : future.get().iterateAll()) { // doThingsWith(element); } } -
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
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
public final UnaryCallable<ListLocationsRequest,ApiHubClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubClient apiHubClient = ApiHubClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = apiHubClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
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
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
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:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-