Class PagesClient (0.48.0)

GitHub RepositoryProduct ReferenceREST DocumentationRPC Documentation

Service Description: Service for managing Pages.

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 (PagesClient pagesClient = PagesClient.create()) {
   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
   Page response = pagesClient.getPage(name);
 }
 

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

Methods
MethodDescriptionMethod Variants

ListPages

Returns the list of all pages in the specified flow.

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

  • listPages(ListPagesRequest request)

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

  • listPages(FlowName parent)

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

  • listPagesPagedCallable()

  • listPagesCallable()

GetPage

Retrieves the specified page.

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

  • getPage(GetPageRequest request)

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

  • getPage(PageName name)

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

  • getPageCallable()

CreatePage

Creates a page in the specified flow.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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

  • createPage(CreatePageRequest request)

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

  • createPage(FlowName parent, Page page)

  • createPage(String parent, Page page)

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

  • createPageCallable()

UpdatePage

Updates the specified page.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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

  • updatePage(UpdatePageRequest request)

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

  • updatePage(Page page, FieldMask updateMask)

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

  • updatePageCallable()

DeletePage

Deletes the specified page.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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

  • deletePage(DeletePageRequest request)

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

  • deletePage(PageName name)

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

  • deletePageCallable()

ListLocations

Lists information about the supported locations for this service.

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

  • listLocations(ListLocationsRequest request)

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

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

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

  • getLocation(GetLocationRequest request)

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

  • getLocationCallable()

See the individual methods for example code.

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

This class can be customized by passing in a custom instance of PagesSettings 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
 PagesSettings pagesSettings =
     PagesSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 PagesClient pagesClient = PagesClient.create(pagesSettings);
 

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
 PagesSettings pagesSettings = PagesSettings.newBuilder().setEndpoint(myEndpoint).build();
 PagesClient pagesClient = PagesClient.create(pagesSettings);
 

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
 PagesSettings pagesSettings = PagesSettings.newHttpJsonBuilder().build();
 PagesClient pagesClient = PagesClient.create(pagesSettings);
 

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

Inheritance

java.lang.Object > PagesClient

Static Methods

create()

public static final PagesClient create()

Constructs an instance of PagesClient with default settings.

Returns
TypeDescription
PagesClient
Exceptions
TypeDescription
IOException

create(PagesSettings settings)

public static final PagesClient create(PagesSettings settings)

Constructs an instance of PagesClient, 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
settingsPagesSettings
Returns
TypeDescription
PagesClient
Exceptions
TypeDescription
IOException

create(PagesStub stub)

public static final PagesClient create(PagesStub stub)

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

Parameter
NameDescription
stubPagesStub
Returns
TypeDescription
PagesClient

Constructors

PagesClient(PagesSettings settings)

protected PagesClient(PagesSettings settings)

Constructs an instance of PagesClient, 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
settingsPagesSettings

PagesClient(PagesStub stub)

protected PagesClient(PagesStub stub)
Parameter
NameDescription
stubPagesStub

Methods

awaitTermination(long duration, TimeUnit unit)

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

close()

public final void close()

createPage(CreatePageRequest request)

public final Page createPage(CreatePageRequest request)

Creates a page in the specified flow.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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 (PagesClient pagesClient = PagesClient.create()) {
   CreatePageRequest request =
       CreatePageRequest.newBuilder()
           .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString())
           .setPage(Page.newBuilder().build())
           .setLanguageCode("languageCode-2092349083")
           .build();
   Page response = pagesClient.createPage(request);
 }
 
Parameter
NameDescription
requestCreatePageRequest

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

Returns
TypeDescription
Page

createPage(FlowName parent, Page page)

public final Page createPage(FlowName parent, Page page)

Creates a page in the specified flow.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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 (PagesClient pagesClient = PagesClient.create()) {
   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
   Page page = Page.newBuilder().build();
   Page response = pagesClient.createPage(parent, page);
 }
 
Parameters
NameDescription
parentFlowName

Required. The flow to create a page for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.

pagePage

Required. The page to create.

Returns
TypeDescription
Page

createPage(String parent, Page page)

public final Page createPage(String parent, Page page)

Creates a page in the specified flow.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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 (PagesClient pagesClient = PagesClient.create()) {
   String parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString();
   Page page = Page.newBuilder().build();
   Page response = pagesClient.createPage(parent, page);
 }
 
Parameters
NameDescription
parentString

Required. The flow to create a page for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.

pagePage

Required. The page to create.

Returns
TypeDescription
Page

createPageCallable()

public final UnaryCallable<CreatePageRequest,Page> createPageCallable()

Creates a page in the specified flow.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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 (PagesClient pagesClient = PagesClient.create()) {
   CreatePageRequest request =
       CreatePageRequest.newBuilder()
           .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString())
           .setPage(Page.newBuilder().build())
           .setLanguageCode("languageCode-2092349083")
           .build();
   ApiFuture<Page> future = pagesClient.createPageCallable().futureCall(request);
   // Do something.
   Page response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreatePageRequest,Page>

deletePage(DeletePageRequest request)

public final void deletePage(DeletePageRequest request)

Deletes the specified page.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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 (PagesClient pagesClient = PagesClient.create()) {
   DeletePageRequest request =
       DeletePageRequest.newBuilder()
           .setName(
               PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString())
           .setForce(true)
           .build();
   pagesClient.deletePage(request);
 }
 
Parameter
NameDescription
requestDeletePageRequest

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

deletePage(PageName name)

public final void deletePage(PageName name)

Deletes the specified page.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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 (PagesClient pagesClient = PagesClient.create()) {
   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
   pagesClient.deletePage(name);
 }
 
Parameter
NameDescription
namePageName

Required. The name of the page to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/Flows/<flow ID>/pages/<Page ID>.

deletePage(String name)

public final void deletePage(String name)

Deletes the specified page.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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 (PagesClient pagesClient = PagesClient.create()) {
   String name =
       PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString();
   pagesClient.deletePage(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the page to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/Flows/<flow ID>/pages/<Page ID>.

deletePageCallable()

public final UnaryCallable<DeletePageRequest,Empty> deletePageCallable()

Deletes the specified page.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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 (PagesClient pagesClient = PagesClient.create()) {
   DeletePageRequest request =
       DeletePageRequest.newBuilder()
           .setName(
               PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString())
           .setForce(true)
           .build();
   ApiFuture<Empty> future = pagesClient.deletePageCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeletePageRequest,Empty>

getLocation(GetLocationRequest request)

public final Location getLocation(GetLocationRequest request)

Gets information about a location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (PagesClient pagesClient = PagesClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = pagesClient.getLocation(request);
 }
 
Parameter
NameDescription
requestcom.google.cloud.location.GetLocationRequest

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

Returns
TypeDescription
com.google.cloud.location.Location

getLocationCallable()

public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Gets information about a location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (PagesClient pagesClient = PagesClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future = pagesClient.getLocationCallable().futureCall(request);
   // Do something.
   Location response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getPage(GetPageRequest request)

public final Page getPage(GetPageRequest request)

Retrieves the specified page.

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 (PagesClient pagesClient = PagesClient.create()) {
   GetPageRequest request =
       GetPageRequest.newBuilder()
           .setName(
               PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString())
           .setLanguageCode("languageCode-2092349083")
           .build();
   Page response = pagesClient.getPage(request);
 }
 
Parameter
NameDescription
requestGetPageRequest

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

Returns
TypeDescription
Page

getPage(PageName name)

public final Page getPage(PageName name)

Retrieves the specified page.

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 (PagesClient pagesClient = PagesClient.create()) {
   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
   Page response = pagesClient.getPage(name);
 }
 
Parameter
NameDescription
namePageName

Required. The name of the page. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>.

Returns
TypeDescription
Page

getPage(String name)

public final Page getPage(String name)

Retrieves the specified page.

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 (PagesClient pagesClient = PagesClient.create()) {
   String name =
       PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString();
   Page response = pagesClient.getPage(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the page. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>.

Returns
TypeDescription
Page

getPageCallable()

public final UnaryCallable<GetPageRequest,Page> getPageCallable()

Retrieves the specified page.

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 (PagesClient pagesClient = PagesClient.create()) {
   GetPageRequest request =
       GetPageRequest.newBuilder()
           .setName(
               PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString())
           .setLanguageCode("languageCode-2092349083")
           .build();
   ApiFuture<Page> future = pagesClient.getPageCallable().futureCall(request);
   // Do something.
   Page response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetPageRequest,Page>

getSettings()

public final PagesSettings getSettings()
Returns
TypeDescription
PagesSettings

getStub()

public PagesStub getStub()
Returns
TypeDescription
PagesStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listLocations(ListLocationsRequest request)

public final PagesClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (PagesClient pagesClient = PagesClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Location element : pagesClient.listLocations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestcom.google.cloud.location.ListLocationsRequest

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

Returns
TypeDescription
PagesClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (PagesClient pagesClient = PagesClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response = pagesClient.listLocationsCallable().call(request);
     for (Location element : response.getLocationsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,PagesClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Lists information about the supported locations for this service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (PagesClient pagesClient = PagesClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Location> future = pagesClient.listLocationsPagedCallable().futureCall(request);
   // Do something.
   for (Location element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

listPages(FlowName parent)

public final PagesClient.ListPagesPagedResponse listPages(FlowName parent)

Returns the list of all pages in the specified flow.

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 (PagesClient pagesClient = PagesClient.create()) {
   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
   for (Page element : pagesClient.listPages(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentFlowName

Required. The flow to list all pages for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.

Returns
TypeDescription
PagesClient.ListPagesPagedResponse

listPages(ListPagesRequest request)

public final PagesClient.ListPagesPagedResponse listPages(ListPagesRequest request)

Returns the list of all pages in the specified flow.

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 (PagesClient pagesClient = PagesClient.create()) {
   ListPagesRequest request =
       ListPagesRequest.newBuilder()
           .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString())
           .setLanguageCode("languageCode-2092349083")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Page element : pagesClient.listPages(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListPagesRequest

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

Returns
TypeDescription
PagesClient.ListPagesPagedResponse

listPages(String parent)

public final PagesClient.ListPagesPagedResponse listPages(String parent)

Returns the list of all pages in the specified flow.

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 (PagesClient pagesClient = PagesClient.create()) {
   String parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString();
   for (Page element : pagesClient.listPages(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The flow to list all pages for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.

Returns
TypeDescription
PagesClient.ListPagesPagedResponse

listPagesCallable()

public final UnaryCallable<ListPagesRequest,ListPagesResponse> listPagesCallable()

Returns the list of all pages in the specified flow.

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 (PagesClient pagesClient = PagesClient.create()) {
   ListPagesRequest request =
       ListPagesRequest.newBuilder()
           .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString())
           .setLanguageCode("languageCode-2092349083")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListPagesResponse response = pagesClient.listPagesCallable().call(request);
     for (Page element : response.getPagesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListPagesRequest,ListPagesResponse>

listPagesPagedCallable()

public final UnaryCallable<ListPagesRequest,PagesClient.ListPagesPagedResponse> listPagesPagedCallable()

Returns the list of all pages in the specified flow.

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 (PagesClient pagesClient = PagesClient.create()) {
   ListPagesRequest request =
       ListPagesRequest.newBuilder()
           .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString())
           .setLanguageCode("languageCode-2092349083")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Page> future = pagesClient.listPagesPagedCallable().futureCall(request);
   // Do something.
   for (Page element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListPagesRequest,ListPagesPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updatePage(Page page, FieldMask updateMask)

public final Page updatePage(Page page, FieldMask updateMask)

Updates the specified page.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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 (PagesClient pagesClient = PagesClient.create()) {
   Page page = Page.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Page response = pagesClient.updatePage(page, updateMask);
 }
 
Parameters
NameDescription
pagePage

Required. The page to update.

updateMaskFieldMask

The mask to control which fields get updated. If the mask is not present, all fields will be updated.

Returns
TypeDescription
Page

updatePage(UpdatePageRequest request)

public final Page updatePage(UpdatePageRequest request)

Updates the specified page.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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 (PagesClient pagesClient = PagesClient.create()) {
   UpdatePageRequest request =
       UpdatePageRequest.newBuilder()
           .setPage(Page.newBuilder().build())
           .setLanguageCode("languageCode-2092349083")
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Page response = pagesClient.updatePage(request);
 }
 
Parameter
NameDescription
requestUpdatePageRequest

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

Returns
TypeDescription
Page

updatePageCallable()

public final UnaryCallable<UpdatePageRequest,Page> updatePageCallable()

Updates the specified page.

Note: You should always train a flow prior to sending it queries. See the training documentation.

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 (PagesClient pagesClient = PagesClient.create()) {
   UpdatePageRequest request =
       UpdatePageRequest.newBuilder()
           .setPage(Page.newBuilder().build())
           .setLanguageCode("languageCode-2092349083")
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Page> future = pagesClient.updatePageCallable().futureCall(request);
   // Do something.
   Page response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdatePageRequest,Page>