@BetaApi @Generated(value="by gapic-generator-java") public class TestCasesClient extends Object implements com.google.api.gax.core.BackgroundResource
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
testCasesClient.batchDeleteTestCases(parent);
}
Note: close() needs to be called on the TestCasesClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListTestCases |
Fetches a list of test cases for a given agent. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchDeleteTestCases |
Batch deletes test cases. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetTestCase |
Gets a test case. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateTestCase |
Creates a test case for the given agent. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateTestCase |
Updates the specified test case. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RunTestCase |
Kicks off a test case run. This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields: - `metadata`: [RunTestCaseMetadata][google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata] - `response`: [RunTestCaseResponse][google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse] |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchRunTestCases |
Kicks off a batch run of test cases. This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields: - `metadata`: [BatchRunTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata] - `response`: [BatchRunTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse] |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CalculateCoverage |
Calculates the test coverage for an agent. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ImportTestCases |
Imports the test cases from a Cloud Storage bucket or a local file. It always creates new test cases and won't overwrite any existing ones. The provided ID in the imported test case is neglected. This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields: - `metadata`: [ImportTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata] - `response`: [ImportTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse] |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ExportTestCases |
Exports the test cases under the agent to a Cloud Storage bucket or a local file. Filter can be applied to export a subset of test cases. This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields: - `metadata`: [ExportTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata] - `response`: [ExportTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse] |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListTestCaseResults |
Fetches the list of run results for the given test case. A maximum of 100 results are kept for each test case. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetTestCaseResult |
Gets a test case result. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return 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 TestCasesSettings 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
TestCasesSettings testCasesSettings =
TestCasesSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
TestCasesClient testCasesClient = TestCasesClient.create(testCasesSettings);
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
TestCasesSettings testCasesSettings =
TestCasesSettings.newBuilder().setEndpoint(myEndpoint).build();
TestCasesClient testCasesClient = TestCasesClient.create(testCasesSettings);
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
TestCasesSettings testCasesSettings = TestCasesSettings.newHttpJsonBuilder().build();
TestCasesClient testCasesClient = TestCasesClient.create(testCasesSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
TestCasesClient.ListLocationsFixedSizeCollection |
static class |
TestCasesClient.ListLocationsPage |
static class |
TestCasesClient.ListLocationsPagedResponse |
static class |
TestCasesClient.ListTestCaseResultsFixedSizeCollection |
static class |
TestCasesClient.ListTestCaseResultsPage |
static class |
TestCasesClient.ListTestCaseResultsPagedResponse |
static class |
TestCasesClient.ListTestCasesFixedSizeCollection |
static class |
TestCasesClient.ListTestCasesPage |
static class |
TestCasesClient.ListTestCasesPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
TestCasesClient(TestCasesSettings settings)
Constructs an instance of TestCasesClient, using the given settings.
|
protected |
TestCasesClient(TestCasesStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
batchDeleteTestCases(AgentName parent)
Batch deletes test cases.
|
void |
batchDeleteTestCases(BatchDeleteTestCasesRequest request)
Batch deletes test cases.
|
void |
batchDeleteTestCases(String parent)
Batch deletes test cases.
|
com.google.api.gax.rpc.UnaryCallable<BatchDeleteTestCasesRequest,com.google.protobuf.Empty> |
batchDeleteTestCasesCallable()
Batch deletes test cases.
|
com.google.api.gax.longrunning.OperationFuture<BatchRunTestCasesResponse,BatchRunTestCasesMetadata> |
batchRunTestCasesAsync(BatchRunTestCasesRequest request)
Kicks off a batch run of test cases.
|
com.google.api.gax.rpc.UnaryCallable<BatchRunTestCasesRequest,com.google.longrunning.Operation> |
batchRunTestCasesCallable()
Kicks off a batch run of test cases.
|
com.google.api.gax.rpc.OperationCallable<BatchRunTestCasesRequest,BatchRunTestCasesResponse,BatchRunTestCasesMetadata> |
batchRunTestCasesOperationCallable()
Kicks off a batch run of test cases.
|
CalculateCoverageResponse |
calculateCoverage(CalculateCoverageRequest request)
Calculates the test coverage for an agent.
|
com.google.api.gax.rpc.UnaryCallable<CalculateCoverageRequest,CalculateCoverageResponse> |
calculateCoverageCallable()
Calculates the test coverage for an agent.
|
void |
close() |
static TestCasesClient |
create()
Constructs an instance of TestCasesClient with default settings.
|
static TestCasesClient |
create(TestCasesSettings settings)
Constructs an instance of TestCasesClient, using the given settings.
|
static TestCasesClient |
create(TestCasesStub stub)
Constructs an instance of TestCasesClient, using the given stub for making calls.
|
TestCase |
createTestCase(AgentName parent,
TestCase testCase)
Creates a test case for the given agent.
|
TestCase |
createTestCase(CreateTestCaseRequest request)
Creates a test case for the given agent.
|
TestCase |
createTestCase(String parent,
TestCase testCase)
Creates a test case for the given agent.
|
com.google.api.gax.rpc.UnaryCallable<CreateTestCaseRequest,TestCase> |
createTestCaseCallable()
Creates a test case for the given agent.
|
com.google.api.gax.longrunning.OperationFuture<ExportTestCasesResponse,ExportTestCasesMetadata> |
exportTestCasesAsync(ExportTestCasesRequest request)
Exports the test cases under the agent to a Cloud Storage bucket or a local file.
|
com.google.api.gax.rpc.UnaryCallable<ExportTestCasesRequest,com.google.longrunning.Operation> |
exportTestCasesCallable()
Exports the test cases under the agent to a Cloud Storage bucket or a local file.
|
com.google.api.gax.rpc.OperationCallable<ExportTestCasesRequest,ExportTestCasesResponse,ExportTestCasesMetadata> |
exportTestCasesOperationCallable()
Exports the test cases under the agent to a Cloud Storage bucket or a local file.
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
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.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
TestCasesSettings |
getSettings() |
TestCasesStub |
getStub() |
TestCase |
getTestCase(GetTestCaseRequest request)
Gets a test case.
|
TestCase |
getTestCase(String name)
Gets a test case.
|
TestCase |
getTestCase(TestCaseName name)
Gets a test case.
|
com.google.api.gax.rpc.UnaryCallable<GetTestCaseRequest,TestCase> |
getTestCaseCallable()
Gets a test case.
|
TestCaseResult |
getTestCaseResult(GetTestCaseResultRequest request)
Gets a test case result.
|
TestCaseResult |
getTestCaseResult(String name)
Gets a test case result.
|
TestCaseResult |
getTestCaseResult(TestCaseResultName name)
Gets a test case result.
|
com.google.api.gax.rpc.UnaryCallable<GetTestCaseResultRequest,TestCaseResult> |
getTestCaseResultCallable()
Gets a test case result.
|
com.google.api.gax.longrunning.OperationFuture<ImportTestCasesResponse,ImportTestCasesMetadata> |
importTestCasesAsync(ImportTestCasesRequest request)
Imports the test cases from a Cloud Storage bucket or a local file.
|
com.google.api.gax.rpc.UnaryCallable<ImportTestCasesRequest,com.google.longrunning.Operation> |
importTestCasesCallable()
Imports the test cases from a Cloud Storage bucket or a local file.
|
com.google.api.gax.rpc.OperationCallable<ImportTestCasesRequest,ImportTestCasesResponse,ImportTestCasesMetadata> |
importTestCasesOperationCallable()
Imports the test cases from a Cloud Storage bucket or a local file.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
TestCasesClient.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,TestCasesClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
TestCasesClient.ListTestCaseResultsPagedResponse |
listTestCaseResults(ListTestCaseResultsRequest request)
Fetches the list of run results for the given test case.
|
TestCasesClient.ListTestCaseResultsPagedResponse |
listTestCaseResults(String parent)
Fetches the list of run results for the given test case.
|
TestCasesClient.ListTestCaseResultsPagedResponse |
listTestCaseResults(TestCaseName parent)
Fetches the list of run results for the given test case.
|
com.google.api.gax.rpc.UnaryCallable<ListTestCaseResultsRequest,ListTestCaseResultsResponse> |
listTestCaseResultsCallable()
Fetches the list of run results for the given test case.
|
com.google.api.gax.rpc.UnaryCallable<ListTestCaseResultsRequest,TestCasesClient.ListTestCaseResultsPagedResponse> |
listTestCaseResultsPagedCallable()
Fetches the list of run results for the given test case.
|
TestCasesClient.ListTestCasesPagedResponse |
listTestCases(AgentName parent)
Fetches a list of test cases for a given agent.
|
TestCasesClient.ListTestCasesPagedResponse |
listTestCases(ListTestCasesRequest request)
Fetches a list of test cases for a given agent.
|
TestCasesClient.ListTestCasesPagedResponse |
listTestCases(String parent)
Fetches a list of test cases for a given agent.
|
com.google.api.gax.rpc.UnaryCallable<ListTestCasesRequest,ListTestCasesResponse> |
listTestCasesCallable()
Fetches a list of test cases for a given agent.
|
com.google.api.gax.rpc.UnaryCallable<ListTestCasesRequest,TestCasesClient.ListTestCasesPagedResponse> |
listTestCasesPagedCallable()
Fetches a list of test cases for a given agent.
|
com.google.api.gax.longrunning.OperationFuture<RunTestCaseResponse,RunTestCaseMetadata> |
runTestCaseAsync(RunTestCaseRequest request)
Kicks off a test case run.
|
com.google.api.gax.rpc.UnaryCallable<RunTestCaseRequest,com.google.longrunning.Operation> |
runTestCaseCallable()
Kicks off a test case run.
|
com.google.api.gax.rpc.OperationCallable<RunTestCaseRequest,RunTestCaseResponse,RunTestCaseMetadata> |
runTestCaseOperationCallable()
Kicks off a test case run.
|
void |
shutdown() |
void |
shutdownNow() |
TestCase |
updateTestCase(TestCase testCase,
com.google.protobuf.FieldMask updateMask)
Updates the specified test case.
|
TestCase |
updateTestCase(UpdateTestCaseRequest request)
Updates the specified test case.
|
com.google.api.gax.rpc.UnaryCallable<UpdateTestCaseRequest,TestCase> |
updateTestCaseCallable()
Updates the specified test case.
|
protected TestCasesClient(TestCasesSettings settings) throws IOException
IOExceptionprotected TestCasesClient(TestCasesStub stub)
public static final TestCasesClient create() throws IOException
IOExceptionpublic static final TestCasesClient create(TestCasesSettings settings) throws IOException
IOExceptionpublic static final TestCasesClient create(TestCasesStub stub)
public final TestCasesSettings getSettings()
public TestCasesStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final TestCasesClient.ListTestCasesPagedResponse listTestCases(AgentName parent)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
for (TestCase element : testCasesClient.listTestCases(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The agent to list all pages for. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TestCasesClient.ListTestCasesPagedResponse listTestCases(String parent)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString();
for (TestCase element : testCasesClient.listTestCases(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The agent to list all pages for. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TestCasesClient.ListTestCasesPagedResponse listTestCases(ListTestCasesRequest request)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListTestCasesRequest request =
ListTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (TestCase element : testCasesClient.listTestCases(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListTestCasesRequest,TestCasesClient.ListTestCasesPagedResponse> listTestCasesPagedCallable()
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListTestCasesRequest request =
ListTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<TestCase> future = testCasesClient.listTestCasesPagedCallable().futureCall(request);
// Do something.
for (TestCase element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListTestCasesRequest,ListTestCasesResponse> listTestCasesCallable()
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListTestCasesRequest request =
ListTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListTestCasesResponse response = testCasesClient.listTestCasesCallable().call(request);
for (TestCase element : response.getTestCasesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void batchDeleteTestCases(AgentName parent)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
testCasesClient.batchDeleteTestCases(parent);
}
parent - Required. The agent to delete test cases from. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void batchDeleteTestCases(String parent)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString();
testCasesClient.batchDeleteTestCases(parent);
}
parent - Required. The agent to delete test cases from. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void batchDeleteTestCases(BatchDeleteTestCasesRequest request)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
BatchDeleteTestCasesRequest request =
BatchDeleteTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.addAllNames(new ArrayList<String>())
.build();
testCasesClient.batchDeleteTestCases(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<BatchDeleteTestCasesRequest,com.google.protobuf.Empty> batchDeleteTestCasesCallable()
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
BatchDeleteTestCasesRequest request =
BatchDeleteTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.addAllNames(new ArrayList<String>())
.build();
ApiFuture<Empty> future = testCasesClient.batchDeleteTestCasesCallable().futureCall(request);
// Do something.
future.get();
}
public final TestCase getTestCase(TestCaseName name)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
TestCaseName name = TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]");
TestCase response = testCasesClient.getTestCase(name);
}
name - Required. The name of the testcase. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/testCases/<TestCaseID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TestCase getTestCase(String name)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
String name = TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString();
TestCase response = testCasesClient.getTestCase(name);
}
name - Required. The name of the testcase. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/testCases/<TestCaseID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TestCase getTestCase(GetTestCaseRequest request)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
GetTestCaseRequest request =
GetTestCaseRequest.newBuilder()
.setName(
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString())
.build();
TestCase response = testCasesClient.getTestCase(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetTestCaseRequest,TestCase> getTestCaseCallable()
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
GetTestCaseRequest request =
GetTestCaseRequest.newBuilder()
.setName(
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString())
.build();
ApiFuture<TestCase> future = testCasesClient.getTestCaseCallable().futureCall(request);
// Do something.
TestCase response = future.get();
}
public final TestCase createTestCase(AgentName parent, TestCase testCase)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
TestCase testCase = TestCase.newBuilder().build();
TestCase response = testCasesClient.createTestCase(parent, testCase);
}
parent - Required. The agent to create the test case for. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.testCase - Required. The test case to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TestCase createTestCase(String parent, TestCase testCase)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString();
TestCase testCase = TestCase.newBuilder().build();
TestCase response = testCasesClient.createTestCase(parent, testCase);
}
parent - Required. The agent to create the test case for. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.testCase - Required. The test case to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TestCase createTestCase(CreateTestCaseRequest request)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
CreateTestCaseRequest request =
CreateTestCaseRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setTestCase(TestCase.newBuilder().build())
.build();
TestCase response = testCasesClient.createTestCase(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateTestCaseRequest,TestCase> createTestCaseCallable()
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
CreateTestCaseRequest request =
CreateTestCaseRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setTestCase(TestCase.newBuilder().build())
.build();
ApiFuture<TestCase> future = testCasesClient.createTestCaseCallable().futureCall(request);
// Do something.
TestCase response = future.get();
}
public final TestCase updateTestCase(TestCase testCase, com.google.protobuf.FieldMask updateMask)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
TestCase testCase = TestCase.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
TestCase response = testCasesClient.updateTestCase(testCase, updateMask);
}
testCase - Required. The test case to update.updateMask - Required. The mask to specify which fields should be updated. The
[`creationTime`][google.cloud.dialogflow.cx.v3beta1.TestCase.creation_time] and
[`lastTestResult`][google.cloud.dialogflow.cx.v3beta1.TestCase.last_test_result] cannot be
updated.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TestCase updateTestCase(UpdateTestCaseRequest request)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
UpdateTestCaseRequest request =
UpdateTestCaseRequest.newBuilder()
.setTestCase(TestCase.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
TestCase response = testCasesClient.updateTestCase(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateTestCaseRequest,TestCase> updateTestCaseCallable()
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
UpdateTestCaseRequest request =
UpdateTestCaseRequest.newBuilder()
.setTestCase(TestCase.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<TestCase> future = testCasesClient.updateTestCaseCallable().futureCall(request);
// Do something.
TestCase response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<RunTestCaseResponse,RunTestCaseMetadata> runTestCaseAsync(RunTestCaseRequest request)
This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:
- `metadata`: [RunTestCaseMetadata][google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata] - `response`: [RunTestCaseResponse][google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse]
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
RunTestCaseRequest request =
RunTestCaseRequest.newBuilder()
.setName(
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString())
.setEnvironment(
EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]")
.toString())
.build();
RunTestCaseResponse response = testCasesClient.runTestCaseAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RunTestCaseRequest,RunTestCaseResponse,RunTestCaseMetadata> runTestCaseOperationCallable()
This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:
- `metadata`: [RunTestCaseMetadata][google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata] - `response`: [RunTestCaseResponse][google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse]
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
RunTestCaseRequest request =
RunTestCaseRequest.newBuilder()
.setName(
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString())
.setEnvironment(
EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]")
.toString())
.build();
OperationFuture<RunTestCaseResponse, RunTestCaseMetadata> future =
testCasesClient.runTestCaseOperationCallable().futureCall(request);
// Do something.
RunTestCaseResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<RunTestCaseRequest,com.google.longrunning.Operation> runTestCaseCallable()
This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:
- `metadata`: [RunTestCaseMetadata][google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata] - `response`: [RunTestCaseResponse][google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse]
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
RunTestCaseRequest request =
RunTestCaseRequest.newBuilder()
.setName(
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString())
.setEnvironment(
EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]")
.toString())
.build();
ApiFuture<Operation> future = testCasesClient.runTestCaseCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<BatchRunTestCasesResponse,BatchRunTestCasesMetadata> batchRunTestCasesAsync(BatchRunTestCasesRequest request)
This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:
- `metadata`: [BatchRunTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata] - `response`: [BatchRunTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse]
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
BatchRunTestCasesRequest request =
BatchRunTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setEnvironment(
EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]")
.toString())
.addAllTestCases(new ArrayList<String>())
.build();
BatchRunTestCasesResponse response = testCasesClient.batchRunTestCasesAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<BatchRunTestCasesRequest,BatchRunTestCasesResponse,BatchRunTestCasesMetadata> batchRunTestCasesOperationCallable()
This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:
- `metadata`: [BatchRunTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata] - `response`: [BatchRunTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse]
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
BatchRunTestCasesRequest request =
BatchRunTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setEnvironment(
EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]")
.toString())
.addAllTestCases(new ArrayList<String>())
.build();
OperationFuture<BatchRunTestCasesResponse, BatchRunTestCasesMetadata> future =
testCasesClient.batchRunTestCasesOperationCallable().futureCall(request);
// Do something.
BatchRunTestCasesResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<BatchRunTestCasesRequest,com.google.longrunning.Operation> batchRunTestCasesCallable()
This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:
- `metadata`: [BatchRunTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata] - `response`: [BatchRunTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse]
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
BatchRunTestCasesRequest request =
BatchRunTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setEnvironment(
EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]")
.toString())
.addAllTestCases(new ArrayList<String>())
.build();
ApiFuture<Operation> future = testCasesClient.batchRunTestCasesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final CalculateCoverageResponse calculateCoverage(CalculateCoverageRequest request)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
CalculateCoverageRequest request =
CalculateCoverageRequest.newBuilder()
.setAgent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.build();
CalculateCoverageResponse response = testCasesClient.calculateCoverage(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CalculateCoverageRequest,CalculateCoverageResponse> calculateCoverageCallable()
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
CalculateCoverageRequest request =
CalculateCoverageRequest.newBuilder()
.setAgent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.build();
ApiFuture<CalculateCoverageResponse> future =
testCasesClient.calculateCoverageCallable().futureCall(request);
// Do something.
CalculateCoverageResponse response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<ImportTestCasesResponse,ImportTestCasesMetadata> importTestCasesAsync(ImportTestCasesRequest request)
This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:
- `metadata`: [ImportTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata] - `response`: [ImportTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse]
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ImportTestCasesRequest request =
ImportTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.build();
ImportTestCasesResponse response = testCasesClient.importTestCasesAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ImportTestCasesRequest,ImportTestCasesResponse,ImportTestCasesMetadata> importTestCasesOperationCallable()
This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:
- `metadata`: [ImportTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata] - `response`: [ImportTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse]
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ImportTestCasesRequest request =
ImportTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.build();
OperationFuture<ImportTestCasesResponse, ImportTestCasesMetadata> future =
testCasesClient.importTestCasesOperationCallable().futureCall(request);
// Do something.
ImportTestCasesResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ImportTestCasesRequest,com.google.longrunning.Operation> importTestCasesCallable()
This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:
- `metadata`: [ImportTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata] - `response`: [ImportTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse]
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ImportTestCasesRequest request =
ImportTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.build();
ApiFuture<Operation> future = testCasesClient.importTestCasesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<ExportTestCasesResponse,ExportTestCasesMetadata> exportTestCasesAsync(ExportTestCasesRequest request)
This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:
- `metadata`: [ExportTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata] - `response`: [ExportTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse]
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ExportTestCasesRequest request =
ExportTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setFilter("filter-1274492040")
.build();
ExportTestCasesResponse response = testCasesClient.exportTestCasesAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ExportTestCasesRequest,ExportTestCasesResponse,ExportTestCasesMetadata> exportTestCasesOperationCallable()
This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:
- `metadata`: [ExportTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata] - `response`: [ExportTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse]
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ExportTestCasesRequest request =
ExportTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setFilter("filter-1274492040")
.build();
OperationFuture<ExportTestCasesResponse, ExportTestCasesMetadata> future =
testCasesClient.exportTestCasesOperationCallable().futureCall(request);
// Do something.
ExportTestCasesResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ExportTestCasesRequest,com.google.longrunning.Operation> exportTestCasesCallable()
This method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:
- `metadata`: [ExportTestCasesMetadata][google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata] - `response`: [ExportTestCasesResponse][google.cloud.dialogflow.cx.v3beta1.ExportTestCasesResponse]
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ExportTestCasesRequest request =
ExportTestCasesRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setFilter("filter-1274492040")
.build();
ApiFuture<Operation> future = testCasesClient.exportTestCasesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final TestCasesClient.ListTestCaseResultsPagedResponse listTestCaseResults(TestCaseName parent)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
TestCaseName parent = TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]");
for (TestCaseResult element : testCasesClient.listTestCaseResults(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The test case to list results for. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/testCases/<TestCaseID>`.
Specify a `-` as a wildcard for TestCase ID to list results across multiple test cases.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TestCasesClient.ListTestCaseResultsPagedResponse listTestCaseResults(String parent)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
String parent =
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString();
for (TestCaseResult element : testCasesClient.listTestCaseResults(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The test case to list results for. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/testCases/<TestCaseID>`.
Specify a `-` as a wildcard for TestCase ID to list results across multiple test cases.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TestCasesClient.ListTestCaseResultsPagedResponse listTestCaseResults(ListTestCaseResultsRequest request)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListTestCaseResultsRequest request =
ListTestCaseResultsRequest.newBuilder()
.setParent(
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
for (TestCaseResult element : testCasesClient.listTestCaseResults(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListTestCaseResultsRequest,TestCasesClient.ListTestCaseResultsPagedResponse> listTestCaseResultsPagedCallable()
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListTestCaseResultsRequest request =
ListTestCaseResultsRequest.newBuilder()
.setParent(
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
ApiFuture<TestCaseResult> future =
testCasesClient.listTestCaseResultsPagedCallable().futureCall(request);
// Do something.
for (TestCaseResult element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListTestCaseResultsRequest,ListTestCaseResultsResponse> listTestCaseResultsCallable()
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListTestCaseResultsRequest request =
ListTestCaseResultsRequest.newBuilder()
.setParent(
TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
while (true) {
ListTestCaseResultsResponse response =
testCasesClient.listTestCaseResultsCallable().call(request);
for (TestCaseResult element : response.getTestCaseResultsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final TestCaseResult getTestCaseResult(TestCaseResultName name)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
TestCaseResultName name =
TestCaseResultName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]", "[RESULT]");
TestCaseResult response = testCasesClient.getTestCaseResult(name);
}
name - Required. The name of the testcase. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/testCases/<TestCaseID>/results/<TestCaseResultID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TestCaseResult getTestCaseResult(String name)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
String name =
TestCaseResultName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]", "[RESULT]")
.toString();
TestCaseResult response = testCasesClient.getTestCaseResult(name);
}
name - Required. The name of the testcase. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/testCases/<TestCaseID>/results/<TestCaseResultID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TestCaseResult getTestCaseResult(GetTestCaseResultRequest request)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
GetTestCaseResultRequest request =
GetTestCaseResultRequest.newBuilder()
.setName(
TestCaseResultName.of(
"[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]", "[RESULT]")
.toString())
.build();
TestCaseResult response = testCasesClient.getTestCaseResult(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetTestCaseResultRequest,TestCaseResult> getTestCaseResultCallable()
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
GetTestCaseResultRequest request =
GetTestCaseResultRequest.newBuilder()
.setName(
TestCaseResultName.of(
"[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]", "[RESULT]")
.toString())
.build();
ApiFuture<TestCaseResult> future =
testCasesClient.getTestCaseResultCallable().futureCall(request);
// Do something.
TestCaseResult response = future.get();
}
public final TestCasesClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : testCasesClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,TestCasesClient.ListLocationsPagedResponse> listLocationsPagedCallable()
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future = testCasesClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response = testCasesClient.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;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = testCasesClient.getLocation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
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 (TestCasesClient testCasesClient = TestCasesClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = testCasesClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2025 Google LLC. All rights reserved.