Class EntityServiceClient (0.1.0)

GitHub RepositoryProduct Reference

Service Description: EntityService contains apis for finding entities.

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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   WatchlistName name = WatchlistName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[WATCHLIST]");
   Watchlist response = entityServiceClient.getWatchlist(name);
 }
 

Note: close() needs to be called on the EntityServiceClient 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

GetWatchlist

Gets watchlist details for the given watchlist ID.

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

  • getWatchlist(GetWatchlistRequest request)

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

  • getWatchlist(WatchlistName name)

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

  • getWatchlistCallable()

ListWatchlists

Lists all watchlists for the given instance.

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

  • listWatchlists(ListWatchlistsRequest request)

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

  • listWatchlists(InstanceName parent)

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

  • listWatchlistsPagedCallable()

  • listWatchlistsCallable()

CreateWatchlist

Creates a watchlist for the given instance. Note that there can be at most 200 watchlists per instance.

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

  • createWatchlist(CreateWatchlistRequest request)

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

  • createWatchlist(InstanceName parent, Watchlist watchlist, String watchlistId)

  • createWatchlist(String parent, Watchlist watchlist, String watchlistId)

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

  • createWatchlistCallable()

UpdateWatchlist

Updates the watchlist for the given instance.

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

  • updateWatchlist(UpdateWatchlistRequest request)

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

  • updateWatchlist(Watchlist watchlist, 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.

  • updateWatchlistCallable()

DeleteWatchlist

Deletes the watchlist for the given instance.

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

  • deleteWatchlist(DeleteWatchlistRequest request)

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

  • deleteWatchlist(WatchlistName name, boolean force)

  • deleteWatchlist(String name, boolean force)

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

  • deleteWatchlistCallable()

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 EntityServiceSettings 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
 EntityServiceSettings entityServiceSettings =
     EntityServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 EntityServiceClient entityServiceClient = EntityServiceClient.create(entityServiceSettings);
 

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
 EntityServiceSettings entityServiceSettings =
     EntityServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 EntityServiceClient entityServiceClient = EntityServiceClient.create(entityServiceSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 EntityServiceSettings entityServiceSettings =
     EntityServiceSettings.newHttpJsonBuilder().build();
 EntityServiceClient entityServiceClient = EntityServiceClient.create(entityServiceSettings);
 

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

Inheritance

java.lang.Object > EntityServiceClient

Static Methods

create()

public static final EntityServiceClient create()

Constructs an instance of EntityServiceClient with default settings.

Returns
Type Description
EntityServiceClient
Exceptions
Type Description
IOException

create(EntityServiceSettings settings)

public static final EntityServiceClient create(EntityServiceSettings settings)

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

Parameter
Name Description
settings EntityServiceSettings
Returns
Type Description
EntityServiceClient
Exceptions
Type Description
IOException

create(EntityServiceStub stub)

public static final EntityServiceClient create(EntityServiceStub stub)

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

Parameter
Name Description
stub EntityServiceStub
Returns
Type Description
EntityServiceClient

Constructors

EntityServiceClient(EntityServiceSettings settings)

protected EntityServiceClient(EntityServiceSettings settings)

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

Parameter
Name Description
settings EntityServiceSettings

EntityServiceClient(EntityServiceStub stub)

protected EntityServiceClient(EntityServiceStub stub)
Parameter
Name Description
stub EntityServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

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

close()

public final void close()

createWatchlist(CreateWatchlistRequest request)

public final Watchlist createWatchlist(CreateWatchlistRequest request)

Creates a watchlist for the given instance. Note that there can be at most 200 watchlists per 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   CreateWatchlistRequest request =
       CreateWatchlistRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setWatchlistId("watchlistId1560983528")
           .setWatchlist(Watchlist.newBuilder().build())
           .build();
   Watchlist response = entityServiceClient.createWatchlist(request);
 }
 
Parameter
Name Description
request CreateWatchlistRequest

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

Returns
Type Description
Watchlist

createWatchlist(InstanceName parent, Watchlist watchlist, String watchlistId)

public final Watchlist createWatchlist(InstanceName parent, Watchlist watchlist, String watchlistId)

Creates a watchlist for the given instance. Note that there can be at most 200 watchlists per 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   Watchlist watchlist = Watchlist.newBuilder().build();
   String watchlistId = "watchlistId1560983528";
   Watchlist response = entityServiceClient.createWatchlist(parent, watchlist, watchlistId);
 }
 
Parameters
Name Description
parent InstanceName

Required. The parent resource where this watchlist will be created. Format: projects/{project}/locations/{location}/instances/{instance}

watchlist Watchlist

Required. The watchlist to create.

watchlistId String

Optional. The ID to use for the watchlist, which will become the final component of the watchlist's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Returns
Type Description
Watchlist

createWatchlist(String parent, Watchlist watchlist, String watchlistId)

public final Watchlist createWatchlist(String parent, Watchlist watchlist, String watchlistId)

Creates a watchlist for the given instance. Note that there can be at most 200 watchlists per 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   Watchlist watchlist = Watchlist.newBuilder().build();
   String watchlistId = "watchlistId1560983528";
   Watchlist response = entityServiceClient.createWatchlist(parent, watchlist, watchlistId);
 }
 
Parameters
Name Description
parent String

Required. The parent resource where this watchlist will be created. Format: projects/{project}/locations/{location}/instances/{instance}

watchlist Watchlist

Required. The watchlist to create.

watchlistId String

Optional. The ID to use for the watchlist, which will become the final component of the watchlist's resource name.

This value should be 4-63 characters, and valid characters are /a-z-/.

Returns
Type Description
Watchlist

createWatchlistCallable()

public final UnaryCallable<CreateWatchlistRequest,Watchlist> createWatchlistCallable()

Creates a watchlist for the given instance. Note that there can be at most 200 watchlists per 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   CreateWatchlistRequest request =
       CreateWatchlistRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setWatchlistId("watchlistId1560983528")
           .setWatchlist(Watchlist.newBuilder().build())
           .build();
   ApiFuture<Watchlist> future =
       entityServiceClient.createWatchlistCallable().futureCall(request);
   // Do something.
   Watchlist response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateWatchlistRequest,Watchlist>

deleteWatchlist(DeleteWatchlistRequest request)

public final void deleteWatchlist(DeleteWatchlistRequest request)

Deletes the watchlist for the given 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   DeleteWatchlistRequest request =
       DeleteWatchlistRequest.newBuilder()
           .setName(
               WatchlistName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[WATCHLIST]")
                   .toString())
           .setForce(true)
           .build();
   entityServiceClient.deleteWatchlist(request);
 }
 
Parameter
Name Description
request DeleteWatchlistRequest

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

deleteWatchlist(WatchlistName name, boolean force)

public final void deleteWatchlist(WatchlistName name, boolean force)

Deletes the watchlist for the given 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   WatchlistName name = WatchlistName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[WATCHLIST]");
   boolean force = true;
   entityServiceClient.deleteWatchlist(name, force);
 }
 
Parameters
Name Description
name WatchlistName

Required. The name of the watchlist to delete. Format: projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}

force boolean

Optional. If set to true, any entities under this watchlist will also be deleted. (Otherwise, the request will only work if the watchlist has no entities.)

deleteWatchlist(String name, boolean force)

public final void deleteWatchlist(String name, boolean force)

Deletes the watchlist for the given 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   String name =
       WatchlistName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[WATCHLIST]").toString();
   boolean force = true;
   entityServiceClient.deleteWatchlist(name, force);
 }
 
Parameters
Name Description
name String

Required. The name of the watchlist to delete. Format: projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}

force boolean

Optional. If set to true, any entities under this watchlist will also be deleted. (Otherwise, the request will only work if the watchlist has no entities.)

deleteWatchlistCallable()

public final UnaryCallable<DeleteWatchlistRequest,Empty> deleteWatchlistCallable()

Deletes the watchlist for the given 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   DeleteWatchlistRequest request =
       DeleteWatchlistRequest.newBuilder()
           .setName(
               WatchlistName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[WATCHLIST]")
                   .toString())
           .setForce(true)
           .build();
   ApiFuture<Empty> future = entityServiceClient.deleteWatchlistCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteWatchlistRequest,Empty>

getSettings()

public final EntityServiceSettings getSettings()
Returns
Type Description
EntityServiceSettings

getStub()

public EntityServiceStub getStub()
Returns
Type Description
EntityServiceStub

getWatchlist(GetWatchlistRequest request)

public final Watchlist getWatchlist(GetWatchlistRequest request)

Gets watchlist details for the given watchlist ID.

Sample code:


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

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

Returns
Type Description
Watchlist

getWatchlist(WatchlistName name)

public final Watchlist getWatchlist(WatchlistName name)

Gets watchlist details for the given watchlist ID.

Sample code:


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

Required. The parent, which owns this collection of watchlists. The name of the watchlist to retrieve. Format: projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}

Returns
Type Description
Watchlist

getWatchlist(String name)

public final Watchlist getWatchlist(String name)

Gets watchlist details for the given watchlist ID.

Sample code:


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

Required. The parent, which owns this collection of watchlists. The name of the watchlist to retrieve. Format: projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}

Returns
Type Description
Watchlist

getWatchlistCallable()

public final UnaryCallable<GetWatchlistRequest,Watchlist> getWatchlistCallable()

Gets watchlist details for the given watchlist ID.

Sample code:


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

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listWatchlists(InstanceName parent)

public final EntityServiceClient.ListWatchlistsPagedResponse listWatchlists(InstanceName parent)

Lists all watchlists for the given 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   for (Watchlist element : entityServiceClient.listWatchlists(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent InstanceName

Required. The parent, which owns this collection of watchlists. Format: projects/{project}/locations/{location}/instances/{instance}

Returns
Type Description
EntityServiceClient.ListWatchlistsPagedResponse

listWatchlists(ListWatchlistsRequest request)

public final EntityServiceClient.ListWatchlistsPagedResponse listWatchlists(ListWatchlistsRequest request)

Lists all watchlists for the given 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   ListWatchlistsRequest request =
       ListWatchlistsRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   for (Watchlist element : entityServiceClient.listWatchlists(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListWatchlistsRequest

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

Returns
Type Description
EntityServiceClient.ListWatchlistsPagedResponse

listWatchlists(String parent)

public final EntityServiceClient.ListWatchlistsPagedResponse listWatchlists(String parent)

Lists all watchlists for the given 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   for (Watchlist element : entityServiceClient.listWatchlists(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent, which owns this collection of watchlists. Format: projects/{project}/locations/{location}/instances/{instance}

Returns
Type Description
EntityServiceClient.ListWatchlistsPagedResponse

listWatchlistsCallable()

public final UnaryCallable<ListWatchlistsRequest,ListWatchlistsResponse> listWatchlistsCallable()

Lists all watchlists for the given 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   ListWatchlistsRequest request =
       ListWatchlistsRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   while (true) {
     ListWatchlistsResponse response =
         entityServiceClient.listWatchlistsCallable().call(request);
     for (Watchlist element : response.getWatchlistsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListWatchlistsRequest,ListWatchlistsResponse>

listWatchlistsPagedCallable()

public final UnaryCallable<ListWatchlistsRequest,EntityServiceClient.ListWatchlistsPagedResponse> listWatchlistsPagedCallable()

Lists all watchlists for the given 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   ListWatchlistsRequest request =
       ListWatchlistsRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   ApiFuture<Watchlist> future =
       entityServiceClient.listWatchlistsPagedCallable().futureCall(request);
   // Do something.
   for (Watchlist element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListWatchlistsRequest,ListWatchlistsPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateWatchlist(UpdateWatchlistRequest request)

public final Watchlist updateWatchlist(UpdateWatchlistRequest request)

Updates the watchlist for the given 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   UpdateWatchlistRequest request =
       UpdateWatchlistRequest.newBuilder()
           .setWatchlist(Watchlist.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Watchlist response = entityServiceClient.updateWatchlist(request);
 }
 
Parameter
Name Description
request UpdateWatchlistRequest

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

Returns
Type Description
Watchlist

updateWatchlist(Watchlist watchlist, FieldMask updateMask)

public final Watchlist updateWatchlist(Watchlist watchlist, FieldMask updateMask)

Updates the watchlist for the given 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   Watchlist watchlist = Watchlist.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Watchlist response = entityServiceClient.updateWatchlist(watchlist, updateMask);
 }
 
Parameters
Name Description
watchlist Watchlist

Required. The watchlist to update.

The watchlist's name field is used to identify the watchlist to update. Format: projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}

updateMask FieldMask

Optional. The list of fields to update.

Returns
Type Description
Watchlist

updateWatchlistCallable()

public final UnaryCallable<UpdateWatchlistRequest,Watchlist> updateWatchlistCallable()

Updates the watchlist for the given 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 (EntityServiceClient entityServiceClient = EntityServiceClient.create()) {
   UpdateWatchlistRequest request =
       UpdateWatchlistRequest.newBuilder()
           .setWatchlist(Watchlist.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Watchlist> future =
       entityServiceClient.updateWatchlistCallable().futureCall(request);
   // Do something.
   Watchlist response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateWatchlistRequest,Watchlist>