Class ApiHubCurateClient
- 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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Curation curation = Curation.newBuilder().build();
String curationId = "curationId1428017328";
Curation response = apiHubCurateClient.createCuration(parent, curation, curationId);
}
Note: close() needs to be called on the ApiHubCurateClient 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 |
|---|---|---|
CreateCuration |
Create a curation resource in the API hub. Once a curation resource is created, plugin instances can start using 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.
|
GetCuration |
Get curation resource details. |
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.
|
ListCurations |
List curation 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.
|
UpdateCuration |
Update a curation resource in the API hub. The following fields in the [curation][google.cloud.apihub.v1.Curation] can be updated:
The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.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.
|
DeleteCuration |
Delete a curation resource in the API hub. A curation can only be deleted if it's not being used by any plugin instance. |
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 ApiHubCurateSettings 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
ApiHubCurateSettings apiHubCurateSettings =
ApiHubCurateSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create(apiHubCurateSettings);
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
ApiHubCurateSettings apiHubCurateSettings =
ApiHubCurateSettings.newBuilder().setEndpoint(myEndpoint).build();
ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create(apiHubCurateSettings);
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 class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedApiHubCurateClient(ApiHubCurateSettings settings) Constructs an instance of ApiHubCurateClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final ApiHubCurateClientcreate()Constructs an instance of ApiHubCurateClient with default settings.static final ApiHubCurateClientcreate(ApiHubCurateSettings settings) Constructs an instance of ApiHubCurateClient, using the given settings.static final ApiHubCurateClientcreate(ApiHubCurateStub stub) Constructs an instance of ApiHubCurateClient, using the given stub for making calls.final CurationcreateCuration(CreateCurationRequest request) Create a curation resource in the API hub.final CurationcreateCuration(LocationName parent, Curation curation, String curationId) Create a curation resource in the API hub.final CurationcreateCuration(String parent, Curation curation, String curationId) Create a curation resource in the API hub.Create a curation resource in the API hub.final voiddeleteCuration(CurationName name) Delete a curation resource in the API hub.final voiddeleteCuration(DeleteCurationRequest request) Delete a curation resource in the API hub.final voiddeleteCuration(String name) Delete a curation resource in the API hub.final UnaryCallable<DeleteCurationRequest,com.google.protobuf.Empty> Delete a curation resource in the API hub.final CurationgetCuration(CurationName name) Get curation resource details.final CurationgetCuration(GetCurationRequest request) Get curation resource details.final CurationgetCuration(String name) Get curation resource details.Get curation resource details.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final ApiHubCurateSettingsgetStub()booleanbooleanlistCurations(ListCurationsRequest request) List curation resources in the API hub.listCurations(LocationName parent) List curation resources in the API hub.listCurations(String parent) List curation resources in the API hub.List curation resources in the API hub.List curation 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.voidshutdown()voidfinal CurationupdateCuration(Curation curation, com.google.protobuf.FieldMask updateMask) Update a curation resource in the API hub.final CurationupdateCuration(UpdateCurationRequest request) Update a curation resource in the API hub.Update a curation resource in the API hub.
-
Constructor Details
-
ApiHubCurateClient
Constructs an instance of ApiHubCurateClient, 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
-
ApiHubCurateClient
-
-
Method Details
-
create
Constructs an instance of ApiHubCurateClient with default settings.- Throws:
IOException
-
create
Constructs an instance of ApiHubCurateClient, 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 ApiHubCurateClient, using the given stub for making calls. This is for advanced usage - prefer using create(ApiHubCurateSettings). -
getSettings
-
getStub
-
createCuration
Create a curation resource in the API hub. Once a curation resource is created, plugin instances can start using 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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Curation curation = Curation.newBuilder().build(); String curationId = "curationId1428017328"; Curation response = apiHubCurateClient.createCuration(parent, curation, curationId); }- Parameters:
parent- Required. The parent resource for the curation resource. Format: `projects/{project}/locations/{location}`curation- Required. The curation resource to create.curationId- Optional. The ID to use for the curation resource, which will become the final component of the curations'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 curation 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
-
createCuration
Create a curation resource in the API hub. Once a curation resource is created, plugin instances can start using 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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Curation curation = Curation.newBuilder().build(); String curationId = "curationId1428017328"; Curation response = apiHubCurateClient.createCuration(parent, curation, curationId); }- Parameters:
parent- Required. The parent resource for the curation resource. Format: `projects/{project}/locations/{location}`curation- Required. The curation resource to create.curationId- Optional. The ID to use for the curation resource, which will become the final component of the curations'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 curation 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
-
createCuration
Create a curation resource in the API hub. Once a curation resource is created, plugin instances can start using 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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { CreateCurationRequest request = CreateCurationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setCurationId("curationId1428017328") .setCuration(Curation.newBuilder().build()) .build(); Curation response = apiHubCurateClient.createCuration(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createCurationCallable
Create a curation resource in the API hub. Once a curation resource is created, plugin instances can start using 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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { CreateCurationRequest request = CreateCurationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setCurationId("curationId1428017328") .setCuration(Curation.newBuilder().build()) .build(); ApiFuture<Curation> future = apiHubCurateClient.createCurationCallable().futureCall(request); // Do something. Curation response = future.get(); } -
getCuration
Get curation resource details.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { CurationName name = CurationName.of("[PROJECT]", "[LOCATION]", "[CURATION]"); Curation response = apiHubCurateClient.getCuration(name); }- Parameters:
name- Required. The name of the curation resource to retrieve. Format: `projects/{project}/locations/{location}/curations/{curation}`- Throws:
ApiException- if the remote call fails
-
getCuration
Get curation resource details.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { String name = CurationName.of("[PROJECT]", "[LOCATION]", "[CURATION]").toString(); Curation response = apiHubCurateClient.getCuration(name); }- Parameters:
name- Required. The name of the curation resource to retrieve. Format: `projects/{project}/locations/{location}/curations/{curation}`- Throws:
ApiException- if the remote call fails
-
getCuration
Get curation resource details.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { GetCurationRequest request = GetCurationRequest.newBuilder() .setName(CurationName.of("[PROJECT]", "[LOCATION]", "[CURATION]").toString()) .build(); Curation response = apiHubCurateClient.getCuration(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getCurationCallable
Get curation resource details.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { GetCurationRequest request = GetCurationRequest.newBuilder() .setName(CurationName.of("[PROJECT]", "[LOCATION]", "[CURATION]").toString()) .build(); ApiFuture<Curation> future = apiHubCurateClient.getCurationCallable().futureCall(request); // Do something. Curation response = future.get(); } -
listCurations
List curation 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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Curation element : apiHubCurateClient.listCurations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of curation resources. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listCurations
List curation 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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Curation element : apiHubCurateClient.listCurations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of curation resources. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listCurations
public final ApiHubCurateClient.ListCurationsPagedResponse listCurations(ListCurationsRequest request) List curation 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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { ListCurationsRequest request = ListCurationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Curation element : apiHubCurateClient.listCurations(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
-
listCurationsPagedCallable
public final UnaryCallable<ListCurationsRequest,ApiHubCurateClient.ListCurationsPagedResponse> listCurationsPagedCallable()List curation 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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { ListCurationsRequest request = ListCurationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Curation> future = apiHubCurateClient.listCurationsPagedCallable().futureCall(request); // Do something. for (Curation element : future.get().iterateAll()) { // doThingsWith(element); } } -
listCurationsCallable
List curation 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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { ListCurationsRequest request = ListCurationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListCurationsResponse response = apiHubCurateClient.listCurationsCallable().call(request); for (Curation element : response.getCurationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
updateCuration
Update a curation resource in the API hub. The following fields in the [curation][google.cloud.apihub.v1.Curation] can be updated:- [display_name][google.cloud.apihub.v1.Curation.display_name]
- [description][google.cloud.apihub.v1.Curation.description]
The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { Curation curation = Curation.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Curation response = apiHubCurateClient.updateCuration(curation, updateMask); }- Parameters:
curation- Required. The curation resource to update.The curation resource's `name` field is used to identify the curation resource to update. Format: `projects/{project}/locations/{location}/curations/{curation}`
updateMask- Optional. The list of fields to update.- Throws:
ApiException- if the remote call fails
-
updateCuration
Update a curation resource in the API hub. The following fields in the [curation][google.cloud.apihub.v1.Curation] can be updated:- [display_name][google.cloud.apihub.v1.Curation.display_name]
- [description][google.cloud.apihub.v1.Curation.description]
The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { UpdateCurationRequest request = UpdateCurationRequest.newBuilder() .setCuration(Curation.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Curation response = apiHubCurateClient.updateCuration(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateCurationCallable
Update a curation resource in the API hub. The following fields in the [curation][google.cloud.apihub.v1.Curation] can be updated:- [display_name][google.cloud.apihub.v1.Curation.display_name]
- [description][google.cloud.apihub.v1.Curation.description]
The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { UpdateCurationRequest request = UpdateCurationRequest.newBuilder() .setCuration(Curation.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Curation> future = apiHubCurateClient.updateCurationCallable().futureCall(request); // Do something. Curation response = future.get(); } -
deleteCuration
Delete a curation resource in the API hub. A curation can only be deleted if it's not being used by any plugin instance.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { CurationName name = CurationName.of("[PROJECT]", "[LOCATION]", "[CURATION]"); apiHubCurateClient.deleteCuration(name); }- Parameters:
name- Required. The name of the curation resource to delete. Format: `projects/{project}/locations/{location}/curations/{curation}`- Throws:
ApiException- if the remote call fails
-
deleteCuration
Delete a curation resource in the API hub. A curation can only be deleted if it's not being used by any plugin instance.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { String name = CurationName.of("[PROJECT]", "[LOCATION]", "[CURATION]").toString(); apiHubCurateClient.deleteCuration(name); }- Parameters:
name- Required. The name of the curation resource to delete. Format: `projects/{project}/locations/{location}/curations/{curation}`- Throws:
ApiException- if the remote call fails
-
deleteCuration
Delete a curation resource in the API hub. A curation can only be deleted if it's not being used by any plugin instance.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { DeleteCurationRequest request = DeleteCurationRequest.newBuilder() .setName(CurationName.of("[PROJECT]", "[LOCATION]", "[CURATION]").toString()) .build(); apiHubCurateClient.deleteCuration(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteCurationCallable
public final UnaryCallable<DeleteCurationRequest,com.google.protobuf.Empty> deleteCurationCallable()Delete a curation resource in the API hub. A curation can only be deleted if it's not being used by any plugin instance.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { DeleteCurationRequest request = DeleteCurationRequest.newBuilder() .setName(CurationName.of("[PROJECT]", "[LOCATION]", "[CURATION]").toString()) .build(); ApiFuture<Empty> future = apiHubCurateClient.deleteCurationCallable().futureCall(request); // Do something. future.get(); } -
listLocations
public final ApiHubCurateClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : apiHubCurateClient.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,ApiHubCurateClient.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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = apiHubCurateClient.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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = apiHubCurateClient.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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = apiHubCurateClient.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 (ApiHubCurateClient apiHubCurateClient = ApiHubCurateClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = apiHubCurateClient.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
-