Class PagesClient
- java.lang.Object
-
- com.google.cloud.dialogflow.cx.v3beta1.PagesClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@BetaApi @Generated("by gapic-generator-java") public class PagesClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].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().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PagesClient.ListLocationsFixedSizeCollection
static class
PagesClient.ListLocationsPage
static class
PagesClient.ListLocationsPagedResponse
static class
PagesClient.ListPagesFixedSizeCollection
static class
PagesClient.ListPagesPage
static class
PagesClient.ListPagesPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protected
PagesClient(PagesSettings settings)
Constructs an instance of PagesClient, using the given settings.protected
PagesClient(PagesStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
void
close()
static PagesClient
create()
Constructs an instance of PagesClient with default settings.static PagesClient
create(PagesSettings settings)
Constructs an instance of PagesClient, using the given settings.static PagesClient
create(PagesStub stub)
Constructs an instance of PagesClient, using the given stub for making calls.Page
createPage(CreatePageRequest request)
Creates a page in the specified flow.Page
createPage(FlowName parent, Page page)
Creates a page in the specified flow.Page
createPage(String parent, Page page)
Creates a page in the specified flow.com.google.api.gax.rpc.UnaryCallable<CreatePageRequest,Page>
createPageCallable()
Creates a page in the specified flow.void
deletePage(DeletePageRequest request)
Deletes the specified page.void
deletePage(PageName name)
Deletes the specified page.void
deletePage(String name)
Deletes the specified page.com.google.api.gax.rpc.UnaryCallable<DeletePageRequest,com.google.protobuf.Empty>
deletePageCallable()
Deletes the specified page.com.google.cloud.location.Location
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>
getLocationCallable()
Gets information about a location.Page
getPage(GetPageRequest request)
Retrieves the specified page.Page
getPage(PageName name)
Retrieves the specified page.Page
getPage(String name)
Retrieves the specified page.com.google.api.gax.rpc.UnaryCallable<GetPageRequest,Page>
getPageCallable()
Retrieves the specified page.PagesSettings
getSettings()
PagesStub
getStub()
boolean
isShutdown()
boolean
isTerminated()
PagesClient.ListLocationsPagedResponse
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>
listLocationsCallable()
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,PagesClient.ListLocationsPagedResponse>
listLocationsPagedCallable()
Lists information about the supported locations for this service.PagesClient.ListPagesPagedResponse
listPages(FlowName parent)
Returns the list of all pages in the specified flow.PagesClient.ListPagesPagedResponse
listPages(ListPagesRequest request)
Returns the list of all pages in the specified flow.PagesClient.ListPagesPagedResponse
listPages(String parent)
Returns the list of all pages in the specified flow.com.google.api.gax.rpc.UnaryCallable<ListPagesRequest,ListPagesResponse>
listPagesCallable()
Returns the list of all pages in the specified flow.com.google.api.gax.rpc.UnaryCallable<ListPagesRequest,PagesClient.ListPagesPagedResponse>
listPagesPagedCallable()
Returns the list of all pages in the specified flow.void
shutdown()
void
shutdownNow()
Page
updatePage(Page page, com.google.protobuf.FieldMask updateMask)
Updates the specified page.Page
updatePage(UpdatePageRequest request)
Updates the specified page.com.google.api.gax.rpc.UnaryCallable<UpdatePageRequest,Page>
updatePageCallable()
Updates the specified page.
-
-
-
Constructor Detail
-
PagesClient
protected PagesClient(PagesSettings settings) throws IOException
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.- Throws:
IOException
-
PagesClient
protected PagesClient(PagesStub stub)
-
-
Method Detail
-
create
public static final PagesClient create() throws IOException
Constructs an instance of PagesClient with default settings.- Throws:
IOException
-
create
public static final PagesClient create(PagesSettings settings) throws IOException
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.- Throws:
IOException
-
create
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).
-
getSettings
public final PagesSettings getSettings()
-
getStub
public PagesStub getStub()
-
listPages
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); } }
- Parameters:
parent
- Required. The flow to list all pages for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listPages
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); } }
- Parameters:
parent
- Required. The flow to list all pages for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listPages
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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listPagesPagedCallable
public final com.google.api.gax.rpc.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); } }
-
listPagesCallable
public final com.google.api.gax.rpc.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; } } }
-
getPage
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); }
- Parameters:
name
- Required. The name of the page. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getPage
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); }
- Parameters:
name
- Required. The name of the page. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getPage
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getPageCallable
public final com.google.api.gax.rpc.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(); }
-
createPage
public final Page createPage(FlowName parent, Page page)
Creates a page 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]"); Page page = Page.newBuilder().build(); Page response = pagesClient.createPage(parent, page); }
- Parameters:
parent
- Required. The flow to create a page for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.page
- Required. The page to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createPage
public final Page createPage(String parent, Page page)
Creates a page 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(); Page page = Page.newBuilder().build(); Page response = pagesClient.createPage(parent, page); }
- Parameters:
parent
- Required. The flow to create a page for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.page
- Required. The page to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createPage
public final Page createPage(CreatePageRequest request)
Creates a page 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()) { 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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createPageCallable
public final com.google.api.gax.rpc.UnaryCallable<CreatePageRequest,Page> createPageCallable()
Creates a page 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()) { 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(); }
-
updatePage
public final Page updatePage(Page page, com.google.protobuf.FieldMask updateMask)
Updates 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()) { Page page = Page.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Page response = pagesClient.updatePage(page, updateMask); }
- Parameters:
page
- Required. The page to update.updateMask
- The mask to control which fields get updated. If the mask is not present, all fields will be updated.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updatePage
public final Page updatePage(UpdatePageRequest request)
Updates 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()) { UpdatePageRequest request = UpdatePageRequest.newBuilder() .setPage(Page.newBuilder().build()) .setLanguageCode("languageCode-2092349083") .setUpdateMask(FieldMask.newBuilder().build()) .build(); Page response = pagesClient.updatePage(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updatePageCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdatePageRequest,Page> updatePageCallable()
Updates 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()) { 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(); }
-
deletePage
public final void deletePage(PageName name)
Deletes 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]"); pagesClient.deletePage(name); }
- Parameters:
name
- Required. The name of the page to delete. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/Flows/<flow ID>/pages/<Page ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deletePage
public final void deletePage(String name)
Deletes 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(); pagesClient.deletePage(name); }
- Parameters:
name
- Required. The name of the page to delete. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/Flows/<flow ID>/pages/<Page ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deletePage
public final void deletePage(DeletePageRequest request)
Deletes 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()) { DeletePageRequest request = DeletePageRequest.newBuilder() .setName( PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) .setForce(true) .build(); pagesClient.deletePage(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deletePageCallable
public final com.google.api.gax.rpc.UnaryCallable<DeletePageRequest,com.google.protobuf.Empty> deletePageCallable()
Deletes 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()) { 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(); }
-
listLocations
public final PagesClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listLocationsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.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); } }
-
listLocationsCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.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; } } }
-
getLocation
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getLocationCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.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(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-