Class CloudLocationFinderClient

java.lang.Object
com.google.cloud.locationfinder.v1.CloudLocationFinderClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class CloudLocationFinderClient extends Object implements BackgroundResource
Service Description: Service describing handlers for resources

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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
   CloudLocationName name = CloudLocationName.of("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]");
   CloudLocation response = cloudLocationFinderClient.getCloudLocation(name);
 }
 

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

ListCloudLocations

Lists cloud locations under a given project and location.

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

  • listCloudLocations(ListCloudLocationsRequest request)

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

  • listCloudLocations(LocationName parent)

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

  • listCloudLocationsPagedCallable()

  • listCloudLocationsCallable()

GetCloudLocation

Retrieves a resource containing information about a cloud location.

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

  • getCloudLocation(GetCloudLocationRequest request)

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

  • getCloudLocation(CloudLocationName name)

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

  • getCloudLocationCallable()

SearchCloudLocations

Searches for cloud locations from a given source location.

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

  • searchCloudLocations(SearchCloudLocationsRequest request)

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

  • searchCloudLocations(LocationName parent, CloudLocationName sourceCloudLocation, String query)

  • searchCloudLocations(LocationName parent, String sourceCloudLocation, String query)

  • searchCloudLocations(String parent, CloudLocationName sourceCloudLocation, String query)

  • searchCloudLocations(String parent, String sourceCloudLocation, String query)

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

  • searchCloudLocationsPagedCallable()

  • searchCloudLocationsCallable()

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 CloudLocationFinderSettings 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
 CloudLocationFinderSettings cloudLocationFinderSettings =
     CloudLocationFinderSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 CloudLocationFinderClient cloudLocationFinderClient =
     CloudLocationFinderClient.create(cloudLocationFinderSettings);
 

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
 CloudLocationFinderSettings cloudLocationFinderSettings =
     CloudLocationFinderSettings.newBuilder().setEndpoint(myEndpoint).build();
 CloudLocationFinderClient cloudLocationFinderClient =
     CloudLocationFinderClient.create(cloudLocationFinderSettings);
 

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
 CloudLocationFinderSettings cloudLocationFinderSettings =
     CloudLocationFinderSettings.newHttpJsonBuilder().build();
 CloudLocationFinderClient cloudLocationFinderClient =
     CloudLocationFinderClient.create(cloudLocationFinderSettings);
 

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

  • Constructor Details

    • CloudLocationFinderClient

      protected CloudLocationFinderClient(CloudLocationFinderSettings settings) throws IOException
      Constructs an instance of CloudLocationFinderClient, 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
    • CloudLocationFinderClient

      protected CloudLocationFinderClient(CloudLocationFinderStub stub)
  • Method Details

    • create

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

      public static final CloudLocationFinderClient create(CloudLocationFinderSettings settings) throws IOException
      Constructs an instance of CloudLocationFinderClient, 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 CloudLocationFinderClient create(CloudLocationFinderStub stub)
      Constructs an instance of CloudLocationFinderClient, using the given stub for making calls. This is for advanced usage - prefer using create(CloudLocationFinderSettings).
    • getSettings

      public final CloudLocationFinderSettings getSettings()
    • getStub

      public CloudLocationFinderStub getStub()
    • listCloudLocations

      Lists cloud locations under a given project and 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (CloudLocation element :
             cloudLocationFinderClient.listCloudLocations(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}
      Throws:
      ApiException - if the remote call fails
    • listCloudLocations

      public final CloudLocationFinderClient.ListCloudLocationsPagedResponse listCloudLocations(String parent)
      Lists cloud locations under a given project and 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (CloudLocation element :
             cloudLocationFinderClient.listCloudLocations(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}
      Throws:
      ApiException - if the remote call fails
    • listCloudLocations

      Lists cloud locations under a given project and 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         ListCloudLocationsRequest request =
             ListCloudLocationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         for (CloudLocation element :
             cloudLocationFinderClient.listCloudLocations(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
    • listCloudLocationsPagedCallable

      Lists cloud locations under a given project and 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         ListCloudLocationsRequest request =
             ListCloudLocationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         ApiFuture<CloudLocation> future =
             cloudLocationFinderClient.listCloudLocationsPagedCallable().futureCall(request);
         // Do something.
         for (CloudLocation element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listCloudLocationsCallable

      public final UnaryCallable<ListCloudLocationsRequest,ListCloudLocationsResponse> listCloudLocationsCallable()
      Lists cloud locations under a given project and 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         ListCloudLocationsRequest request =
             ListCloudLocationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         while (true) {
           ListCloudLocationsResponse response =
               cloudLocationFinderClient.listCloudLocationsCallable().call(request);
           for (CloudLocation element : response.getCloudLocationsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getCloudLocation

      public final CloudLocation getCloudLocation(CloudLocationName name)
      Retrieves a resource containing information about a cloud 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         CloudLocationName name = CloudLocationName.of("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]");
         CloudLocation response = cloudLocationFinderClient.getCloudLocation(name);
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • getCloudLocation

      public final CloudLocation getCloudLocation(String name)
      Retrieves a resource containing information about a cloud 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         String name = CloudLocationName.of("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]").toString();
         CloudLocation response = cloudLocationFinderClient.getCloudLocation(name);
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • getCloudLocation

      public final CloudLocation getCloudLocation(GetCloudLocationRequest request)
      Retrieves a resource containing information about a cloud 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         GetCloudLocationRequest request =
             GetCloudLocationRequest.newBuilder()
                 .setName(
                     CloudLocationName.of("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]").toString())
                 .build();
         CloudLocation response = cloudLocationFinderClient.getCloudLocation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getCloudLocationCallable

      public final UnaryCallable<GetCloudLocationRequest,CloudLocation> getCloudLocationCallable()
      Retrieves a resource containing information about a cloud 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         GetCloudLocationRequest request =
             GetCloudLocationRequest.newBuilder()
                 .setName(
                     CloudLocationName.of("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]").toString())
                 .build();
         ApiFuture<CloudLocation> future =
             cloudLocationFinderClient.getCloudLocationCallable().futureCall(request);
         // Do something.
         CloudLocation response = future.get();
       }
       
    • searchCloudLocations

      public final CloudLocationFinderClient.SearchCloudLocationsPagedResponse searchCloudLocations(LocationName parent, CloudLocationName sourceCloudLocation, String query)
      Searches for cloud locations from a given source 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         CloudLocationName sourceCloudLocation =
             CloudLocationName.of("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]");
         String query = "query107944136";
         for (CloudLocation element :
             cloudLocationFinderClient
                 .searchCloudLocations(parent, sourceCloudLocation, query)
                 .iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}
      sourceCloudLocation - Required. The source cloud location to search from. Example search can be searching nearby cloud locations from the source cloud location by latency.
      query - Optional. The query string in search query syntax. While filter is used to filter the search results by attributes, query is used to specify the search requirements.
      Throws:
      ApiException - if the remote call fails
    • searchCloudLocations

      public final CloudLocationFinderClient.SearchCloudLocationsPagedResponse searchCloudLocations(LocationName parent, String sourceCloudLocation, String query)
      Searches for cloud locations from a given source 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         String sourceCloudLocation =
             CloudLocationName.of("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]").toString();
         String query = "query107944136";
         for (CloudLocation element :
             cloudLocationFinderClient
                 .searchCloudLocations(parent, sourceCloudLocation, query)
                 .iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}
      sourceCloudLocation - Required. The source cloud location to search from. Example search can be searching nearby cloud locations from the source cloud location by latency.
      query - Optional. The query string in search query syntax. While filter is used to filter the search results by attributes, query is used to specify the search requirements.
      Throws:
      ApiException - if the remote call fails
    • searchCloudLocations

      public final CloudLocationFinderClient.SearchCloudLocationsPagedResponse searchCloudLocations(String parent, CloudLocationName sourceCloudLocation, String query)
      Searches for cloud locations from a given source 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         CloudLocationName sourceCloudLocation =
             CloudLocationName.of("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]");
         String query = "query107944136";
         for (CloudLocation element :
             cloudLocationFinderClient
                 .searchCloudLocations(parent, sourceCloudLocation, query)
                 .iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}
      sourceCloudLocation - Required. The source cloud location to search from. Example search can be searching nearby cloud locations from the source cloud location by latency.
      query - Optional. The query string in search query syntax. While filter is used to filter the search results by attributes, query is used to specify the search requirements.
      Throws:
      ApiException - if the remote call fails
    • searchCloudLocations

      public final CloudLocationFinderClient.SearchCloudLocationsPagedResponse searchCloudLocations(String parent, String sourceCloudLocation, String query)
      Searches for cloud locations from a given source 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         String sourceCloudLocation =
             CloudLocationName.of("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]").toString();
         String query = "query107944136";
         for (CloudLocation element :
             cloudLocationFinderClient
                 .searchCloudLocations(parent, sourceCloudLocation, query)
                 .iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}
      sourceCloudLocation - Required. The source cloud location to search from. Example search can be searching nearby cloud locations from the source cloud location by latency.
      query - Optional. The query string in search query syntax. While filter is used to filter the search results by attributes, query is used to specify the search requirements.
      Throws:
      ApiException - if the remote call fails
    • searchCloudLocations

      Searches for cloud locations from a given source 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         SearchCloudLocationsRequest request =
             SearchCloudLocationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setSourceCloudLocation(
                     CloudLocationName.of("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setQuery("query107944136")
                 .build();
         for (CloudLocation element :
             cloudLocationFinderClient.searchCloudLocations(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
    • searchCloudLocationsPagedCallable

      Searches for cloud locations from a given source 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         SearchCloudLocationsRequest request =
             SearchCloudLocationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setSourceCloudLocation(
                     CloudLocationName.of("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setQuery("query107944136")
                 .build();
         ApiFuture<CloudLocation> future =
             cloudLocationFinderClient.searchCloudLocationsPagedCallable().futureCall(request);
         // Do something.
         for (CloudLocation element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • searchCloudLocationsCallable

      public final UnaryCallable<SearchCloudLocationsRequest,SearchCloudLocationsResponse> searchCloudLocationsCallable()
      Searches for cloud locations from a given source 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 (CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.create()) {
         SearchCloudLocationsRequest request =
             SearchCloudLocationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setSourceCloudLocation(
                     CloudLocationName.of("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setQuery("query107944136")
                 .build();
         while (true) {
           SearchCloudLocationsResponse response =
               cloudLocationFinderClient.searchCloudLocationsCallable().call(request);
           for (CloudLocation element : response.getCloudLocationsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • 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