Class SiteSearchEngineServiceClient (0.37.0)

GitHub RepositoryProduct Reference

Service Description: Service for managing site search related 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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   SiteSearchEngineName name =
       SiteSearchEngineName.ofProjectLocationDataStoreName(
           "[PROJECT]", "[LOCATION]", "[DATA_STORE]");
   SiteSearchEngine response = siteSearchEngineServiceClient.getSiteSearchEngine(name);
 }
 

Note: close() needs to be called on the SiteSearchEngineServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
MethodDescriptionMethod Variants

GetSiteSearchEngine

Gets the SiteSearchEngine.

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

  • getSiteSearchEngine(GetSiteSearchEngineRequest request)

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

  • getSiteSearchEngine(SiteSearchEngineName name)

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

  • getSiteSearchEngineCallable()

CreateTargetSite

Creates a TargetSite.

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

  • createTargetSiteAsync(CreateTargetSiteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createTargetSiteAsync(SiteSearchEngineName parent, TargetSite targetSite)

  • createTargetSiteAsync(String parent, TargetSite targetSite)

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

  • createTargetSiteOperationCallable()

  • createTargetSiteCallable()

BatchCreateTargetSites

Creates TargetSite in a batch.

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

  • batchCreateTargetSitesAsync(BatchCreateTargetSitesRequest request)

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

  • batchCreateTargetSitesOperationCallable()

  • batchCreateTargetSitesCallable()

GetTargetSite

Gets a TargetSite.

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

  • getTargetSite(GetTargetSiteRequest request)

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

  • getTargetSite(TargetSiteName name)

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

  • getTargetSiteCallable()

UpdateTargetSite

Updates a TargetSite.

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

  • updateTargetSiteAsync(UpdateTargetSiteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateTargetSiteAsync(TargetSite targetSite)

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

  • updateTargetSiteOperationCallable()

  • updateTargetSiteCallable()

DeleteTargetSite

Deletes a TargetSite.

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

  • deleteTargetSiteAsync(DeleteTargetSiteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteTargetSiteAsync(TargetSiteName name)

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

  • deleteTargetSiteOperationCallable()

  • deleteTargetSiteCallable()

ListTargetSites

Gets a list of TargetSites.

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

  • listTargetSites(ListTargetSitesRequest request)

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

  • listTargetSites(SiteSearchEngineName parent)

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

  • listTargetSitesPagedCallable()

  • listTargetSitesCallable()

EnableAdvancedSiteSearch

Upgrade from basic site search to advanced site search.

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

  • enableAdvancedSiteSearchAsync(EnableAdvancedSiteSearchRequest request)

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

  • enableAdvancedSiteSearchOperationCallable()

  • enableAdvancedSiteSearchCallable()

DisableAdvancedSiteSearch

Downgrade from advanced site search to basic site search.

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

  • disableAdvancedSiteSearchAsync(DisableAdvancedSiteSearchRequest request)

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

  • disableAdvancedSiteSearchOperationCallable()

  • disableAdvancedSiteSearchCallable()

RecrawlUris

Request on-demand recrawl for a list of URIs.

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

  • recrawlUrisAsync(RecrawlUrisRequest request)

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

  • recrawlUrisOperationCallable()

  • recrawlUrisCallable()

BatchVerifyTargetSites

Verify target sites' ownership and validity. This API sends all the target sites under site search engine for verification.

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

  • batchVerifyTargetSitesAsync(BatchVerifyTargetSitesRequest request)

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

  • batchVerifyTargetSitesOperationCallable()

  • batchVerifyTargetSitesCallable()

FetchDomainVerificationStatus

Returns list of target sites with its domain verification status. This method can only be called under data store with BASIC_SITE_SEARCH state at the moment.

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

  • fetchDomainVerificationStatus(FetchDomainVerificationStatusRequest request)

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

  • fetchDomainVerificationStatusPagedCallable()

  • fetchDomainVerificationStatusCallable()

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 SiteSearchEngineServiceSettings 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
 SiteSearchEngineServiceSettings siteSearchEngineServiceSettings =
     SiteSearchEngineServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create(siteSearchEngineServiceSettings);
 

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
 SiteSearchEngineServiceSettings siteSearchEngineServiceSettings =
     SiteSearchEngineServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create(siteSearchEngineServiceSettings);
 

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
 SiteSearchEngineServiceSettings siteSearchEngineServiceSettings =
     SiteSearchEngineServiceSettings.newHttpJsonBuilder().build();
 SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create(siteSearchEngineServiceSettings);
 

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

Inheritance

java.lang.Object > SiteSearchEngineServiceClient

Static Methods

create()

public static final SiteSearchEngineServiceClient create()

Constructs an instance of SiteSearchEngineServiceClient with default settings.

Returns
TypeDescription
SiteSearchEngineServiceClient
Exceptions
TypeDescription
IOException

create(SiteSearchEngineServiceSettings settings)

public static final SiteSearchEngineServiceClient create(SiteSearchEngineServiceSettings settings)

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

Parameter
NameDescription
settingsSiteSearchEngineServiceSettings
Returns
TypeDescription
SiteSearchEngineServiceClient
Exceptions
TypeDescription
IOException

create(SiteSearchEngineServiceStub stub)

public static final SiteSearchEngineServiceClient create(SiteSearchEngineServiceStub stub)

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

Parameter
NameDescription
stubSiteSearchEngineServiceStub
Returns
TypeDescription
SiteSearchEngineServiceClient

Constructors

SiteSearchEngineServiceClient(SiteSearchEngineServiceSettings settings)

protected SiteSearchEngineServiceClient(SiteSearchEngineServiceSettings settings)

Constructs an instance of SiteSearchEngineServiceClient, 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
NameDescription
settingsSiteSearchEngineServiceSettings

SiteSearchEngineServiceClient(SiteSearchEngineServiceStub stub)

protected SiteSearchEngineServiceClient(SiteSearchEngineServiceStub stub)
Parameter
NameDescription
stubSiteSearchEngineServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

batchCreateTargetSitesAsync(BatchCreateTargetSitesRequest request)

public final OperationFuture<BatchCreateTargetSitesResponse,BatchCreateTargetSiteMetadata> batchCreateTargetSitesAsync(BatchCreateTargetSitesRequest request)

Creates TargetSite in a batch.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   BatchCreateTargetSitesRequest request =
       BatchCreateTargetSitesRequest.newBuilder()
           .setParent(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .addAllRequests(new ArrayList<CreateTargetSiteRequest>())
           .build();
   BatchCreateTargetSitesResponse response =
       siteSearchEngineServiceClient.batchCreateTargetSitesAsync(request).get();
 }
 
Parameter
NameDescription
requestBatchCreateTargetSitesRequest

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

Returns
TypeDescription
OperationFuture<BatchCreateTargetSitesResponse,BatchCreateTargetSiteMetadata>

batchCreateTargetSitesCallable()

public final UnaryCallable<BatchCreateTargetSitesRequest,Operation> batchCreateTargetSitesCallable()

Creates TargetSite in a batch.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   BatchCreateTargetSitesRequest request =
       BatchCreateTargetSitesRequest.newBuilder()
           .setParent(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .addAllRequests(new ArrayList<CreateTargetSiteRequest>())
           .build();
   ApiFuture<Operation> future =
       siteSearchEngineServiceClient.batchCreateTargetSitesCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<BatchCreateTargetSitesRequest,Operation>

batchCreateTargetSitesOperationCallable()

public final OperationCallable<BatchCreateTargetSitesRequest,BatchCreateTargetSitesResponse,BatchCreateTargetSiteMetadata> batchCreateTargetSitesOperationCallable()

Creates TargetSite in a batch.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   BatchCreateTargetSitesRequest request =
       BatchCreateTargetSitesRequest.newBuilder()
           .setParent(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .addAllRequests(new ArrayList<CreateTargetSiteRequest>())
           .build();
   OperationFuture<BatchCreateTargetSitesResponse, BatchCreateTargetSiteMetadata> future =
       siteSearchEngineServiceClient
           .batchCreateTargetSitesOperationCallable()
           .futureCall(request);
   // Do something.
   BatchCreateTargetSitesResponse response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<BatchCreateTargetSitesRequest,BatchCreateTargetSitesResponse,BatchCreateTargetSiteMetadata>

batchVerifyTargetSitesAsync(BatchVerifyTargetSitesRequest request)

public final OperationFuture<BatchVerifyTargetSitesResponse,BatchVerifyTargetSitesMetadata> batchVerifyTargetSitesAsync(BatchVerifyTargetSitesRequest request)

Verify target sites' ownership and validity. This API sends all the target sites under site search engine for verification.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   BatchVerifyTargetSitesRequest request =
       BatchVerifyTargetSitesRequest.newBuilder()
           .setParent(
               SiteSearchEngineName.ofProjectLocationCollectionDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
                   .toString())
           .build();
   BatchVerifyTargetSitesResponse response =
       siteSearchEngineServiceClient.batchVerifyTargetSitesAsync(request).get();
 }
 
Parameter
NameDescription
requestBatchVerifyTargetSitesRequest

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

Returns
TypeDescription
OperationFuture<BatchVerifyTargetSitesResponse,BatchVerifyTargetSitesMetadata>

batchVerifyTargetSitesCallable()

public final UnaryCallable<BatchVerifyTargetSitesRequest,Operation> batchVerifyTargetSitesCallable()

Verify target sites' ownership and validity. This API sends all the target sites under site search engine for verification.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   BatchVerifyTargetSitesRequest request =
       BatchVerifyTargetSitesRequest.newBuilder()
           .setParent(
               SiteSearchEngineName.ofProjectLocationCollectionDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
                   .toString())
           .build();
   ApiFuture<Operation> future =
       siteSearchEngineServiceClient.batchVerifyTargetSitesCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<BatchVerifyTargetSitesRequest,Operation>

batchVerifyTargetSitesOperationCallable()

public final OperationCallable<BatchVerifyTargetSitesRequest,BatchVerifyTargetSitesResponse,BatchVerifyTargetSitesMetadata> batchVerifyTargetSitesOperationCallable()

Verify target sites' ownership and validity. This API sends all the target sites under site search engine for verification.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   BatchVerifyTargetSitesRequest request =
       BatchVerifyTargetSitesRequest.newBuilder()
           .setParent(
               SiteSearchEngineName.ofProjectLocationCollectionDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
                   .toString())
           .build();
   OperationFuture<BatchVerifyTargetSitesResponse, BatchVerifyTargetSitesMetadata> future =
       siteSearchEngineServiceClient
           .batchVerifyTargetSitesOperationCallable()
           .futureCall(request);
   // Do something.
   BatchVerifyTargetSitesResponse response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<BatchVerifyTargetSitesRequest,BatchVerifyTargetSitesResponse,BatchVerifyTargetSitesMetadata>

close()

public final void close()

createTargetSiteAsync(CreateTargetSiteRequest request)

public final OperationFuture<TargetSite,CreateTargetSiteMetadata> createTargetSiteAsync(CreateTargetSiteRequest request)

Creates a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   CreateTargetSiteRequest request =
       CreateTargetSiteRequest.newBuilder()
           .setParent(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .setTargetSite(TargetSite.newBuilder().build())
           .build();
   TargetSite response = siteSearchEngineServiceClient.createTargetSiteAsync(request).get();
 }
 
Parameter
NameDescription
requestCreateTargetSiteRequest

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

Returns
TypeDescription
OperationFuture<TargetSite,CreateTargetSiteMetadata>

createTargetSiteAsync(SiteSearchEngineName parent, TargetSite targetSite)

public final OperationFuture<TargetSite,CreateTargetSiteMetadata> createTargetSiteAsync(SiteSearchEngineName parent, TargetSite targetSite)

Creates a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   SiteSearchEngineName parent =
       SiteSearchEngineName.ofProjectLocationDataStoreName(
           "[PROJECT]", "[LOCATION]", "[DATA_STORE]");
   TargetSite targetSite = TargetSite.newBuilder().build();
   TargetSite response =
       siteSearchEngineServiceClient.createTargetSiteAsync(parent, targetSite).get();
 }
 
Parameters
NameDescription
parentSiteSearchEngineName

Required. Parent resource name of TargetSite, such as projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine.

targetSiteTargetSite

Required. The TargetSite to create.

Returns
TypeDescription
OperationFuture<TargetSite,CreateTargetSiteMetadata>

createTargetSiteAsync(String parent, TargetSite targetSite)

public final OperationFuture<TargetSite,CreateTargetSiteMetadata> createTargetSiteAsync(String parent, TargetSite targetSite)

Creates a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   String parent =
       SiteSearchEngineName.ofProjectLocationDataStoreName(
               "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
           .toString();
   TargetSite targetSite = TargetSite.newBuilder().build();
   TargetSite response =
       siteSearchEngineServiceClient.createTargetSiteAsync(parent, targetSite).get();
 }
 
Parameters
NameDescription
parentString

Required. Parent resource name of TargetSite, such as projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine.

targetSiteTargetSite

Required. The TargetSite to create.

Returns
TypeDescription
OperationFuture<TargetSite,CreateTargetSiteMetadata>

createTargetSiteCallable()

public final UnaryCallable<CreateTargetSiteRequest,Operation> createTargetSiteCallable()

Creates a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   CreateTargetSiteRequest request =
       CreateTargetSiteRequest.newBuilder()
           .setParent(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .setTargetSite(TargetSite.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       siteSearchEngineServiceClient.createTargetSiteCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateTargetSiteRequest,Operation>

createTargetSiteOperationCallable()

public final OperationCallable<CreateTargetSiteRequest,TargetSite,CreateTargetSiteMetadata> createTargetSiteOperationCallable()

Creates a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   CreateTargetSiteRequest request =
       CreateTargetSiteRequest.newBuilder()
           .setParent(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .setTargetSite(TargetSite.newBuilder().build())
           .build();
   OperationFuture<TargetSite, CreateTargetSiteMetadata> future =
       siteSearchEngineServiceClient.createTargetSiteOperationCallable().futureCall(request);
   // Do something.
   TargetSite response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<CreateTargetSiteRequest,TargetSite,CreateTargetSiteMetadata>

deleteTargetSiteAsync(DeleteTargetSiteRequest request)

public final OperationFuture<Empty,DeleteTargetSiteMetadata> deleteTargetSiteAsync(DeleteTargetSiteRequest request)

Deletes a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   DeleteTargetSiteRequest request =
       DeleteTargetSiteRequest.newBuilder()
           .setName(
               TargetSiteName.ofProjectLocationDataStoreTargetSiteName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[TARGET_SITE]")
                   .toString())
           .build();
   siteSearchEngineServiceClient.deleteTargetSiteAsync(request).get();
 }
 
Parameter
NameDescription
requestDeleteTargetSiteRequest

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

Returns
TypeDescription
OperationFuture<Empty,DeleteTargetSiteMetadata>

deleteTargetSiteAsync(TargetSiteName name)

public final OperationFuture<Empty,DeleteTargetSiteMetadata> deleteTargetSiteAsync(TargetSiteName name)

Deletes a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   TargetSiteName name =
       TargetSiteName.ofProjectLocationDataStoreTargetSiteName(
           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[TARGET_SITE]");
   siteSearchEngineServiceClient.deleteTargetSiteAsync(name).get();
 }
 
Parameter
NameDescription
nameTargetSiteName

Required. Full resource name of TargetSite, such as projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}.

If the caller does not have permission to access the TargetSite, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested TargetSite does not exist, a NOT_FOUND error is returned.

Returns
TypeDescription
OperationFuture<Empty,DeleteTargetSiteMetadata>

deleteTargetSiteAsync(String name)

public final OperationFuture<Empty,DeleteTargetSiteMetadata> deleteTargetSiteAsync(String name)

Deletes a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   String name =
       TargetSiteName.ofProjectLocationDataStoreTargetSiteName(
               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[TARGET_SITE]")
           .toString();
   siteSearchEngineServiceClient.deleteTargetSiteAsync(name).get();
 }
 
Parameter
NameDescription
nameString

Required. Full resource name of TargetSite, such as projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}.

If the caller does not have permission to access the TargetSite, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested TargetSite does not exist, a NOT_FOUND error is returned.

Returns
TypeDescription
OperationFuture<Empty,DeleteTargetSiteMetadata>

deleteTargetSiteCallable()

public final UnaryCallable<DeleteTargetSiteRequest,Operation> deleteTargetSiteCallable()

Deletes a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   DeleteTargetSiteRequest request =
       DeleteTargetSiteRequest.newBuilder()
           .setName(
               TargetSiteName.ofProjectLocationDataStoreTargetSiteName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[TARGET_SITE]")
                   .toString())
           .build();
   ApiFuture<Operation> future =
       siteSearchEngineServiceClient.deleteTargetSiteCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteTargetSiteRequest,Operation>

deleteTargetSiteOperationCallable()

public final OperationCallable<DeleteTargetSiteRequest,Empty,DeleteTargetSiteMetadata> deleteTargetSiteOperationCallable()

Deletes a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   DeleteTargetSiteRequest request =
       DeleteTargetSiteRequest.newBuilder()
           .setName(
               TargetSiteName.ofProjectLocationDataStoreTargetSiteName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[TARGET_SITE]")
                   .toString())
           .build();
   OperationFuture<Empty, DeleteTargetSiteMetadata> future =
       siteSearchEngineServiceClient.deleteTargetSiteOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
OperationCallable<DeleteTargetSiteRequest,Empty,DeleteTargetSiteMetadata>

disableAdvancedSiteSearchAsync(DisableAdvancedSiteSearchRequest request)

public final OperationFuture<DisableAdvancedSiteSearchResponse,DisableAdvancedSiteSearchMetadata> disableAdvancedSiteSearchAsync(DisableAdvancedSiteSearchRequest request)

Downgrade from advanced site search to basic site search.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   DisableAdvancedSiteSearchRequest request =
       DisableAdvancedSiteSearchRequest.newBuilder()
           .setSiteSearchEngine(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .build();
   DisableAdvancedSiteSearchResponse response =
       siteSearchEngineServiceClient.disableAdvancedSiteSearchAsync(request).get();
 }
 
Parameter
NameDescription
requestDisableAdvancedSiteSearchRequest

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

Returns
TypeDescription
OperationFuture<DisableAdvancedSiteSearchResponse,DisableAdvancedSiteSearchMetadata>

disableAdvancedSiteSearchCallable()

public final UnaryCallable<DisableAdvancedSiteSearchRequest,Operation> disableAdvancedSiteSearchCallable()

Downgrade from advanced site search to basic site search.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   DisableAdvancedSiteSearchRequest request =
       DisableAdvancedSiteSearchRequest.newBuilder()
           .setSiteSearchEngine(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .build();
   ApiFuture<Operation> future =
       siteSearchEngineServiceClient.disableAdvancedSiteSearchCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DisableAdvancedSiteSearchRequest,Operation>

disableAdvancedSiteSearchOperationCallable()

public final OperationCallable<DisableAdvancedSiteSearchRequest,DisableAdvancedSiteSearchResponse,DisableAdvancedSiteSearchMetadata> disableAdvancedSiteSearchOperationCallable()

Downgrade from advanced site search to basic site search.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   DisableAdvancedSiteSearchRequest request =
       DisableAdvancedSiteSearchRequest.newBuilder()
           .setSiteSearchEngine(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .build();
   OperationFuture<DisableAdvancedSiteSearchResponse, DisableAdvancedSiteSearchMetadata> future =
       siteSearchEngineServiceClient
           .disableAdvancedSiteSearchOperationCallable()
           .futureCall(request);
   // Do something.
   DisableAdvancedSiteSearchResponse response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<DisableAdvancedSiteSearchRequest,DisableAdvancedSiteSearchResponse,DisableAdvancedSiteSearchMetadata>

enableAdvancedSiteSearchAsync(EnableAdvancedSiteSearchRequest request)

public final OperationFuture<EnableAdvancedSiteSearchResponse,EnableAdvancedSiteSearchMetadata> enableAdvancedSiteSearchAsync(EnableAdvancedSiteSearchRequest request)

Upgrade from basic site search to advanced site search.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   EnableAdvancedSiteSearchRequest request =
       EnableAdvancedSiteSearchRequest.newBuilder()
           .setSiteSearchEngine(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .build();
   EnableAdvancedSiteSearchResponse response =
       siteSearchEngineServiceClient.enableAdvancedSiteSearchAsync(request).get();
 }
 
Parameter
NameDescription
requestEnableAdvancedSiteSearchRequest

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

Returns
TypeDescription
OperationFuture<EnableAdvancedSiteSearchResponse,EnableAdvancedSiteSearchMetadata>

enableAdvancedSiteSearchCallable()

public final UnaryCallable<EnableAdvancedSiteSearchRequest,Operation> enableAdvancedSiteSearchCallable()

Upgrade from basic site search to advanced site search.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   EnableAdvancedSiteSearchRequest request =
       EnableAdvancedSiteSearchRequest.newBuilder()
           .setSiteSearchEngine(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .build();
   ApiFuture<Operation> future =
       siteSearchEngineServiceClient.enableAdvancedSiteSearchCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<EnableAdvancedSiteSearchRequest,Operation>

enableAdvancedSiteSearchOperationCallable()

public final OperationCallable<EnableAdvancedSiteSearchRequest,EnableAdvancedSiteSearchResponse,EnableAdvancedSiteSearchMetadata> enableAdvancedSiteSearchOperationCallable()

Upgrade from basic site search to advanced site search.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   EnableAdvancedSiteSearchRequest request =
       EnableAdvancedSiteSearchRequest.newBuilder()
           .setSiteSearchEngine(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .build();
   OperationFuture<EnableAdvancedSiteSearchResponse, EnableAdvancedSiteSearchMetadata> future =
       siteSearchEngineServiceClient
           .enableAdvancedSiteSearchOperationCallable()
           .futureCall(request);
   // Do something.
   EnableAdvancedSiteSearchResponse response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<EnableAdvancedSiteSearchRequest,EnableAdvancedSiteSearchResponse,EnableAdvancedSiteSearchMetadata>

fetchDomainVerificationStatus(FetchDomainVerificationStatusRequest request)

public final SiteSearchEngineServiceClient.FetchDomainVerificationStatusPagedResponse fetchDomainVerificationStatus(FetchDomainVerificationStatusRequest request)

Returns list of target sites with its domain verification status. This method can only be called under data store with BASIC_SITE_SEARCH state at the moment.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   FetchDomainVerificationStatusRequest request =
       FetchDomainVerificationStatusRequest.newBuilder()
           .setSiteSearchEngine(
               SiteSearchEngineName.ofProjectLocationCollectionDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (TargetSite element :
       siteSearchEngineServiceClient.fetchDomainVerificationStatus(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestFetchDomainVerificationStatusRequest

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

Returns
TypeDescription
SiteSearchEngineServiceClient.FetchDomainVerificationStatusPagedResponse

fetchDomainVerificationStatusCallable()

public final UnaryCallable<FetchDomainVerificationStatusRequest,FetchDomainVerificationStatusResponse> fetchDomainVerificationStatusCallable()

Returns list of target sites with its domain verification status. This method can only be called under data store with BASIC_SITE_SEARCH state at the moment.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   FetchDomainVerificationStatusRequest request =
       FetchDomainVerificationStatusRequest.newBuilder()
           .setSiteSearchEngine(
               SiteSearchEngineName.ofProjectLocationCollectionDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     FetchDomainVerificationStatusResponse response =
         siteSearchEngineServiceClient.fetchDomainVerificationStatusCallable().call(request);
     for (TargetSite element : response.getTargetSitesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<FetchDomainVerificationStatusRequest,FetchDomainVerificationStatusResponse>

fetchDomainVerificationStatusPagedCallable()

public final UnaryCallable<FetchDomainVerificationStatusRequest,SiteSearchEngineServiceClient.FetchDomainVerificationStatusPagedResponse> fetchDomainVerificationStatusPagedCallable()

Returns list of target sites with its domain verification status. This method can only be called under data store with BASIC_SITE_SEARCH state at the moment.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   FetchDomainVerificationStatusRequest request =
       FetchDomainVerificationStatusRequest.newBuilder()
           .setSiteSearchEngine(
               SiteSearchEngineName.ofProjectLocationCollectionDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<TargetSite> future =
       siteSearchEngineServiceClient
           .fetchDomainVerificationStatusPagedCallable()
           .futureCall(request);
   // Do something.
   for (TargetSite element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<FetchDomainVerificationStatusRequest,FetchDomainVerificationStatusPagedResponse>

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getOperationsClient()

public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getSettings()

public final SiteSearchEngineServiceSettings getSettings()
Returns
TypeDescription
SiteSearchEngineServiceSettings

getSiteSearchEngine(GetSiteSearchEngineRequest request)

public final SiteSearchEngine getSiteSearchEngine(GetSiteSearchEngineRequest request)

Gets the SiteSearchEngine.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   GetSiteSearchEngineRequest request =
       GetSiteSearchEngineRequest.newBuilder()
           .setName(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .build();
   SiteSearchEngine response = siteSearchEngineServiceClient.getSiteSearchEngine(request);
 }
 
Parameter
NameDescription
requestGetSiteSearchEngineRequest

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

Returns
TypeDescription
SiteSearchEngine

getSiteSearchEngine(SiteSearchEngineName name)

public final SiteSearchEngine getSiteSearchEngine(SiteSearchEngineName name)

Gets the SiteSearchEngine.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   SiteSearchEngineName name =
       SiteSearchEngineName.ofProjectLocationDataStoreName(
           "[PROJECT]", "[LOCATION]", "[DATA_STORE]");
   SiteSearchEngine response = siteSearchEngineServiceClient.getSiteSearchEngine(name);
 }
 
Parameter
NameDescription
nameSiteSearchEngineName

Required. Resource name of SiteSearchEngine, such as projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine.

If the caller does not have permission to access the [SiteSearchEngine], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

Returns
TypeDescription
SiteSearchEngine

getSiteSearchEngine(String name)

public final SiteSearchEngine getSiteSearchEngine(String name)

Gets the SiteSearchEngine.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   String name =
       SiteSearchEngineName.ofProjectLocationDataStoreName(
               "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
           .toString();
   SiteSearchEngine response = siteSearchEngineServiceClient.getSiteSearchEngine(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of SiteSearchEngine, such as projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine.

If the caller does not have permission to access the [SiteSearchEngine], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

Returns
TypeDescription
SiteSearchEngine

getSiteSearchEngineCallable()

public final UnaryCallable<GetSiteSearchEngineRequest,SiteSearchEngine> getSiteSearchEngineCallable()

Gets the SiteSearchEngine.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   GetSiteSearchEngineRequest request =
       GetSiteSearchEngineRequest.newBuilder()
           .setName(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .build();
   ApiFuture<SiteSearchEngine> future =
       siteSearchEngineServiceClient.getSiteSearchEngineCallable().futureCall(request);
   // Do something.
   SiteSearchEngine response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetSiteSearchEngineRequest,SiteSearchEngine>

getStub()

public SiteSearchEngineServiceStub getStub()
Returns
TypeDescription
SiteSearchEngineServiceStub

getTargetSite(GetTargetSiteRequest request)

public final TargetSite getTargetSite(GetTargetSiteRequest request)

Gets a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   GetTargetSiteRequest request =
       GetTargetSiteRequest.newBuilder()
           .setName(
               TargetSiteName.ofProjectLocationDataStoreTargetSiteName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[TARGET_SITE]")
                   .toString())
           .build();
   TargetSite response = siteSearchEngineServiceClient.getTargetSite(request);
 }
 
Parameter
NameDescription
requestGetTargetSiteRequest

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

Returns
TypeDescription
TargetSite

getTargetSite(TargetSiteName name)

public final TargetSite getTargetSite(TargetSiteName name)

Gets a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   TargetSiteName name =
       TargetSiteName.ofProjectLocationDataStoreTargetSiteName(
           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[TARGET_SITE]");
   TargetSite response = siteSearchEngineServiceClient.getTargetSite(name);
 }
 
Parameter
NameDescription
nameTargetSiteName

Required. Full resource name of TargetSite, such as projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}.

If the caller does not have permission to access the TargetSite, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested TargetSite does not exist, a NOT_FOUND error is returned.

Returns
TypeDescription
TargetSite

getTargetSite(String name)

public final TargetSite getTargetSite(String name)

Gets a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   String name =
       TargetSiteName.ofProjectLocationDataStoreTargetSiteName(
               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[TARGET_SITE]")
           .toString();
   TargetSite response = siteSearchEngineServiceClient.getTargetSite(name);
 }
 
Parameter
NameDescription
nameString

Required. Full resource name of TargetSite, such as projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}.

If the caller does not have permission to access the TargetSite, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested TargetSite does not exist, a NOT_FOUND error is returned.

Returns
TypeDescription
TargetSite

getTargetSiteCallable()

public final UnaryCallable<GetTargetSiteRequest,TargetSite> getTargetSiteCallable()

Gets a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   GetTargetSiteRequest request =
       GetTargetSiteRequest.newBuilder()
           .setName(
               TargetSiteName.ofProjectLocationDataStoreTargetSiteName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[TARGET_SITE]")
                   .toString())
           .build();
   ApiFuture<TargetSite> future =
       siteSearchEngineServiceClient.getTargetSiteCallable().futureCall(request);
   // Do something.
   TargetSite response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetTargetSiteRequest,TargetSite>

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listTargetSites(ListTargetSitesRequest request)

public final SiteSearchEngineServiceClient.ListTargetSitesPagedResponse listTargetSites(ListTargetSitesRequest request)

Gets a list of TargetSites.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   ListTargetSitesRequest request =
       ListTargetSitesRequest.newBuilder()
           .setParent(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (TargetSite element :
       siteSearchEngineServiceClient.listTargetSites(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListTargetSitesRequest

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

Returns
TypeDescription
SiteSearchEngineServiceClient.ListTargetSitesPagedResponse

listTargetSites(SiteSearchEngineName parent)

public final SiteSearchEngineServiceClient.ListTargetSitesPagedResponse listTargetSites(SiteSearchEngineName parent)

Gets a list of TargetSites.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   SiteSearchEngineName parent =
       SiteSearchEngineName.ofProjectLocationDataStoreName(
           "[PROJECT]", "[LOCATION]", "[DATA_STORE]");
   for (TargetSite element :
       siteSearchEngineServiceClient.listTargetSites(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentSiteSearchEngineName

Required. The parent site search engine resource name, such as projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine.

If the caller does not have permission to list TargetSites under this site search engine, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.

Returns
TypeDescription
SiteSearchEngineServiceClient.ListTargetSitesPagedResponse

listTargetSites(String parent)

public final SiteSearchEngineServiceClient.ListTargetSitesPagedResponse listTargetSites(String parent)

Gets a list of TargetSites.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   String parent =
       SiteSearchEngineName.ofProjectLocationDataStoreName(
               "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
           .toString();
   for (TargetSite element :
       siteSearchEngineServiceClient.listTargetSites(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The parent site search engine resource name, such as projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine.

If the caller does not have permission to list TargetSites under this site search engine, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.

Returns
TypeDescription
SiteSearchEngineServiceClient.ListTargetSitesPagedResponse

listTargetSitesCallable()

public final UnaryCallable<ListTargetSitesRequest,ListTargetSitesResponse> listTargetSitesCallable()

Gets a list of TargetSites.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   ListTargetSitesRequest request =
       ListTargetSitesRequest.newBuilder()
           .setParent(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListTargetSitesResponse response =
         siteSearchEngineServiceClient.listTargetSitesCallable().call(request);
     for (TargetSite element : response.getTargetSitesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListTargetSitesRequest,ListTargetSitesResponse>

listTargetSitesPagedCallable()

public final UnaryCallable<ListTargetSitesRequest,SiteSearchEngineServiceClient.ListTargetSitesPagedResponse> listTargetSitesPagedCallable()

Gets a list of TargetSites.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   ListTargetSitesRequest request =
       ListTargetSitesRequest.newBuilder()
           .setParent(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<TargetSite> future =
       siteSearchEngineServiceClient.listTargetSitesPagedCallable().futureCall(request);
   // Do something.
   for (TargetSite element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListTargetSitesRequest,ListTargetSitesPagedResponse>

recrawlUrisAsync(RecrawlUrisRequest request)

public final OperationFuture<RecrawlUrisResponse,RecrawlUrisMetadata> recrawlUrisAsync(RecrawlUrisRequest request)

Request on-demand recrawl for a list of URIs.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   RecrawlUrisRequest request =
       RecrawlUrisRequest.newBuilder()
           .setSiteSearchEngine(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .addAllUris(new ArrayList<String>())
           .build();
   RecrawlUrisResponse response = siteSearchEngineServiceClient.recrawlUrisAsync(request).get();
 }
 
Parameter
NameDescription
requestRecrawlUrisRequest

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

Returns
TypeDescription
OperationFuture<RecrawlUrisResponse,RecrawlUrisMetadata>

recrawlUrisCallable()

public final UnaryCallable<RecrawlUrisRequest,Operation> recrawlUrisCallable()

Request on-demand recrawl for a list of URIs.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   RecrawlUrisRequest request =
       RecrawlUrisRequest.newBuilder()
           .setSiteSearchEngine(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .addAllUris(new ArrayList<String>())
           .build();
   ApiFuture<Operation> future =
       siteSearchEngineServiceClient.recrawlUrisCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<RecrawlUrisRequest,Operation>

recrawlUrisOperationCallable()

public final OperationCallable<RecrawlUrisRequest,RecrawlUrisResponse,RecrawlUrisMetadata> recrawlUrisOperationCallable()

Request on-demand recrawl for a list of URIs.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   RecrawlUrisRequest request =
       RecrawlUrisRequest.newBuilder()
           .setSiteSearchEngine(
               SiteSearchEngineName.ofProjectLocationDataStoreName(
                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
                   .toString())
           .addAllUris(new ArrayList<String>())
           .build();
   OperationFuture<RecrawlUrisResponse, RecrawlUrisMetadata> future =
       siteSearchEngineServiceClient.recrawlUrisOperationCallable().futureCall(request);
   // Do something.
   RecrawlUrisResponse response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<RecrawlUrisRequest,RecrawlUrisResponse,RecrawlUrisMetadata>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateTargetSiteAsync(TargetSite targetSite)

public final OperationFuture<TargetSite,UpdateTargetSiteMetadata> updateTargetSiteAsync(TargetSite targetSite)

Updates a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   TargetSite targetSite = TargetSite.newBuilder().build();
   TargetSite response = siteSearchEngineServiceClient.updateTargetSiteAsync(targetSite).get();
 }
 
Parameter
NameDescription
targetSiteTargetSite

Required. The target site to update. If the caller does not have permission to update the TargetSite, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the TargetSite to update does not exist, a NOT_FOUND error is returned.

Returns
TypeDescription
OperationFuture<TargetSite,UpdateTargetSiteMetadata>

updateTargetSiteAsync(UpdateTargetSiteRequest request)

public final OperationFuture<TargetSite,UpdateTargetSiteMetadata> updateTargetSiteAsync(UpdateTargetSiteRequest request)

Updates a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   UpdateTargetSiteRequest request =
       UpdateTargetSiteRequest.newBuilder()
           .setTargetSite(TargetSite.newBuilder().build())
           .build();
   TargetSite response = siteSearchEngineServiceClient.updateTargetSiteAsync(request).get();
 }
 
Parameter
NameDescription
requestUpdateTargetSiteRequest

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

Returns
TypeDescription
OperationFuture<TargetSite,UpdateTargetSiteMetadata>

updateTargetSiteCallable()

public final UnaryCallable<UpdateTargetSiteRequest,Operation> updateTargetSiteCallable()

Updates a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   UpdateTargetSiteRequest request =
       UpdateTargetSiteRequest.newBuilder()
           .setTargetSite(TargetSite.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       siteSearchEngineServiceClient.updateTargetSiteCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateTargetSiteRequest,Operation>

updateTargetSiteOperationCallable()

public final OperationCallable<UpdateTargetSiteRequest,TargetSite,UpdateTargetSiteMetadata> updateTargetSiteOperationCallable()

Updates a TargetSite.

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 (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
     SiteSearchEngineServiceClient.create()) {
   UpdateTargetSiteRequest request =
       UpdateTargetSiteRequest.newBuilder()
           .setTargetSite(TargetSite.newBuilder().build())
           .build();
   OperationFuture<TargetSite, UpdateTargetSiteMetadata> future =
       siteSearchEngineServiceClient.updateTargetSiteOperationCallable().futureCall(request);
   // Do something.
   TargetSite response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<UpdateTargetSiteRequest,TargetSite,UpdateTargetSiteMetadata>