Class ApiHubCurateClient

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

@Generated("by gapic-generator-java") public class ApiHubCurateClient extends Object implements BackgroundResource
Service Description: This service is used for managing curations for processing API data consumed from collect layer.

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

Methods
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.

  • createCuration(CreateCurationRequest request)

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

  • createCuration(LocationName parent, Curation curation, String curationId)

  • createCuration(String parent, Curation curation, String curationId)

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

  • createCurationCallable()

GetCuration

Get curation resource details.

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

  • getCuration(GetCurationRequest request)

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

  • getCuration(CurationName name)

  • getCuration(String name)

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

  • getCurationCallable()

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.

  • listCurations(ListCurationsRequest request)

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

  • listCurations(LocationName parent)

  • listCurations(String parent)

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

  • listCurationsPagedCallable()

  • listCurationsCallable()

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.

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

  • updateCuration(UpdateCurationRequest request)

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

  • updateCuration(Curation curation, FieldMask updateMask)

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

  • updateCurationCallable()

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.

  • deleteCuration(DeleteCurationRequest request)

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

  • deleteCuration(CurationName name)

  • deleteCuration(String name)

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

  • deleteCurationCallable()

ListLocations

Lists information about the supported locations for this service.

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

  • listLocations(ListLocationsRequest request)

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

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

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

  • getLocation(GetLocationRequest request)

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

  • getLocationCallable()

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of 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.

  • Constructor Details

    • ApiHubCurateClient

      protected ApiHubCurateClient(ApiHubCurateSettings settings) throws IOException
      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

      protected ApiHubCurateClient(ApiHubCurateStub stub)
  • Method Details

    • create

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

      public static final ApiHubCurateClient create(ApiHubCurateSettings settings) throws IOException
      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

      public static final ApiHubCurateClient create(ApiHubCurateStub stub)
      Constructs an instance of ApiHubCurateClient, using the given stub for making calls. This is for advanced usage - prefer using create(ApiHubCurateSettings).
    • getSettings

      public final ApiHubCurateSettings getSettings()
    • getStub

      public ApiHubCurateStub getStub()
    • createCuration

      public final Curation createCuration(LocationName parent, Curation curation, String curationId)
      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

      public final Curation createCuration(String parent, Curation curation, String curationId)
      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

      public final Curation createCuration(CreateCurationRequest request)
      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

      public final UnaryCallable<CreateCurationRequest,Curation> 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

      public final Curation getCuration(CurationName name)
      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

      public final Curation getCuration(String name)
      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

      public final Curation getCuration(GetCurationRequest request)
      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

      public final UnaryCallable<GetCurationRequest,Curation> 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

      public final ApiHubCurateClient.ListCurationsPagedResponse listCurations(LocationName parent)
      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

      public final ApiHubCurateClient.ListCurationsPagedResponse listCurations(String parent)
      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

      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

      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

      public final UnaryCallable<ListCurationsRequest,ListCurationsResponse> 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

      public final Curation updateCuration(Curation curation, com.google.protobuf.FieldMask updateMask)
      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

      public final Curation updateCuration(UpdateCurationRequest request)
      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

      public final UnaryCallable<UpdateCurationRequest,Curation> 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

      public final void deleteCuration(CurationName name)
      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

      public final void deleteCuration(String name)
      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

      public final void deleteCuration(DeleteCurationRequest request)
      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

      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

      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

      public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()
      Lists information about the supported locations for this service.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (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

      public final Location getLocation(GetLocationRequest request)
      Gets information about a location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (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

      public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
      Gets information about a location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (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:
      close in interface AutoCloseable
    • shutdown

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

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

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

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

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