Class TestCasesClient
- java.lang.Object
-
- com.google.cloud.dialogflow.cx.v3beta1.TestCasesClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@BetaApi @Generated("by gapic-generator-java") public class TestCasesClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: Service for managing [Test Cases][google.cloud.dialogflow.cx.v3beta1.TestCase] and [Test Case Results][google.cloud.dialogflow.cx.v3beta1.TestCaseResult].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().
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 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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
-
Constructor Summary
Constructors Modifier Constructor Description protected
TestCasesClient(TestCasesStub stub)
protected
TestCasesClient(TestCasesSettings settings)
Constructs an instance of TestCasesClient, using the given settings.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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(TestCasesStub stub)
Constructs an instance of TestCasesClient, using the given stub for making calls.static TestCasesClient
create(TestCasesSettings settings)
Constructs an instance of TestCasesClient, using the given settings.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(TestCaseName name)
Gets a test case.TestCase
getTestCase(String 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(TestCaseResultName name)
Gets a test case result.TestCaseResult
getTestCaseResult(String 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(TestCaseName parent)
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.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.
-
-
-
Constructor Detail
-
TestCasesClient
protected TestCasesClient(TestCasesSettings settings) throws IOException
Constructs an instance of TestCasesClient, 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
-
TestCasesClient
protected TestCasesClient(TestCasesStub stub)
-
-
Method Detail
-
create
public static final TestCasesClient create() throws IOException
Constructs an instance of TestCasesClient with default settings.- Throws:
IOException
-
create
public static final TestCasesClient create(TestCasesSettings settings) throws IOException
Constructs an instance of TestCasesClient, 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 TestCasesClient create(TestCasesStub stub)
Constructs an instance of TestCasesClient, using the given stub for making calls. This is for advanced usage - prefer using create(TestCasesSettings).
-
getSettings
public final TestCasesSettings getSettings()
-
getStub
public TestCasesStub getStub()
-
getOperationsClient
public final 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.
-
getHttpJsonOperationsClient
@BetaApi public final 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.
-
listTestCases
public final TestCasesClient.ListTestCasesPagedResponse listTestCases(AgentName parent)
Fetches a list of test cases for a given agent.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); } }
- Parameters:
parent
- Required. The agent to list all pages for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listTestCases
public final TestCasesClient.ListTestCasesPagedResponse listTestCases(String parent)
Fetches a list of test cases for a given agent.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); } }
- Parameters:
parent
- Required. The agent to list all pages for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listTestCases
public final TestCasesClient.ListTestCasesPagedResponse listTestCases(ListTestCasesRequest request)
Fetches a list of test cases for a given agent.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); } }
- 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
-
listTestCasesPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListTestCasesRequest,TestCasesClient.ListTestCasesPagedResponse> listTestCasesPagedCallable()
Fetches a list of test cases for a given agent.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); } }
-
listTestCasesCallable
public final com.google.api.gax.rpc.UnaryCallable<ListTestCasesRequest,ListTestCasesResponse> listTestCasesCallable()
Fetches a list of test cases for a given agent.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; } } }
-
batchDeleteTestCases
public final void batchDeleteTestCases(AgentName parent)
Batch deletes test cases.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); }
- Parameters:
parent
- Required. The agent to delete test cases from. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteTestCases
public final void batchDeleteTestCases(String parent)
Batch deletes test cases.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); }
- Parameters:
parent
- Required. The agent to delete test cases from. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteTestCases
public final void batchDeleteTestCases(BatchDeleteTestCasesRequest request)
Batch deletes test cases.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); }
- 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
-
batchDeleteTestCasesCallable
public final com.google.api.gax.rpc.UnaryCallable<BatchDeleteTestCasesRequest,com.google.protobuf.Empty> batchDeleteTestCasesCallable()
Batch deletes test cases.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(); }
-
getTestCase
public final TestCase getTestCase(TestCaseName name)
Gets a test case.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); }
- Parameters:
name
- Required. The name of the testcase. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/testCases/<TestCase ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getTestCase
public final TestCase getTestCase(String name)
Gets a test case.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); }
- Parameters:
name
- Required. The name of the testcase. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/testCases/<TestCase ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getTestCase
public final TestCase getTestCase(GetTestCaseRequest request)
Gets a test case.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); }
- 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
-
getTestCaseCallable
public final com.google.api.gax.rpc.UnaryCallable<GetTestCaseRequest,TestCase> getTestCaseCallable()
Gets a test case.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(); }
-
createTestCase
public final TestCase createTestCase(AgentName parent, TestCase testCase)
Creates a test case for the given agent.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); }
- Parameters:
parent
- Required. The agent to create the test case for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.testCase
- Required. The test case to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createTestCase
public final TestCase createTestCase(String parent, TestCase testCase)
Creates a test case for the given agent.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); }
- Parameters:
parent
- Required. The agent to create the test case for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.testCase
- Required. The test case to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createTestCase
public final TestCase createTestCase(CreateTestCaseRequest request)
Creates a test case for the given agent.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); }
- 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
-
createTestCaseCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateTestCaseRequest,TestCase> createTestCaseCallable()
Creates a test case for the given agent.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(); }
-
updateTestCase
public final TestCase updateTestCase(TestCase testCase, com.google.protobuf.FieldMask updateMask)
Updates the specified test case.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); }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateTestCase
public final TestCase updateTestCase(UpdateTestCaseRequest request)
Updates the specified test case.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); }
- 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
-
updateTestCaseCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateTestCaseRequest,TestCase> updateTestCaseCallable()
Updates the specified test case.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(); }
-
runTestCaseAsync
public final com.google.api.gax.longrunning.OperationFuture<RunTestCaseResponse,RunTestCaseMetadata> runTestCaseAsync(RunTestCaseRequest request)
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]
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(); }
- 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
-
runTestCaseOperationCallable
public final com.google.api.gax.rpc.OperationCallable<RunTestCaseRequest,RunTestCaseResponse,RunTestCaseMetadata> runTestCaseOperationCallable()
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]
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(); }
-
runTestCaseCallable
public final com.google.api.gax.rpc.UnaryCallable<RunTestCaseRequest,com.google.longrunning.Operation> runTestCaseCallable()
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]
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(); }
-
batchRunTestCasesAsync
public final com.google.api.gax.longrunning.OperationFuture<BatchRunTestCasesResponse,BatchRunTestCasesMetadata> batchRunTestCasesAsync(BatchRunTestCasesRequest request)
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]
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(); }
- 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
-
batchRunTestCasesOperationCallable
public final com.google.api.gax.rpc.OperationCallable<BatchRunTestCasesRequest,BatchRunTestCasesResponse,BatchRunTestCasesMetadata> batchRunTestCasesOperationCallable()
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]
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(); }
-
batchRunTestCasesCallable
public final com.google.api.gax.rpc.UnaryCallable<BatchRunTestCasesRequest,com.google.longrunning.Operation> batchRunTestCasesCallable()
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]
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(); }
-
calculateCoverage
public final CalculateCoverageResponse calculateCoverage(CalculateCoverageRequest request)
Calculates the test coverage for an agent.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); }
- 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
-
calculateCoverageCallable
public final com.google.api.gax.rpc.UnaryCallable<CalculateCoverageRequest,CalculateCoverageResponse> calculateCoverageCallable()
Calculates the test coverage for an agent.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(); }
-
importTestCasesAsync
public final com.google.api.gax.longrunning.OperationFuture<ImportTestCasesResponse,ImportTestCasesMetadata> importTestCasesAsync(ImportTestCasesRequest request)
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]
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(); }
- 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
-
importTestCasesOperationCallable
public final com.google.api.gax.rpc.OperationCallable<ImportTestCasesRequest,ImportTestCasesResponse,ImportTestCasesMetadata> importTestCasesOperationCallable()
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]
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(); }
-
importTestCasesCallable
public final 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. 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]
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(); }
-
exportTestCasesAsync
public final 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. 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]
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(); }
- 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
-
exportTestCasesOperationCallable
public final 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. 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]
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(); }
-
exportTestCasesCallable
public final 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. 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]
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(); }
-
listTestCaseResults
public final TestCasesClient.ListTestCaseResultsPagedResponse listTestCaseResults(TestCaseName parent)
Fetches the list of run results for the given test case. A maximum of 100 results are kept for each test case.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); } }
- Parameters:
parent
- Required. The test case to list results for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/ testCases/<TestCase ID>`. Specify a `-` as a wildcard for TestCase ID to list results across multiple test cases.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listTestCaseResults
public final TestCasesClient.ListTestCaseResultsPagedResponse listTestCaseResults(String parent)
Fetches the list of run results for the given test case. A maximum of 100 results are kept for each test case.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); } }
- Parameters:
parent
- Required. The test case to list results for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/ testCases/<TestCase ID>`. Specify a `-` as a wildcard for TestCase ID to list results across multiple test cases.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listTestCaseResults
public final TestCasesClient.ListTestCaseResultsPagedResponse listTestCaseResults(ListTestCaseResultsRequest request)
Fetches the list of run results for the given test case. A maximum of 100 results are kept for each test case.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); } }
- 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
-
listTestCaseResultsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListTestCaseResultsRequest,TestCasesClient.ListTestCaseResultsPagedResponse> listTestCaseResultsPagedCallable()
Fetches the list of run results for the given test case. A maximum of 100 results are kept for each test case.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); } }
-
listTestCaseResultsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListTestCaseResultsRequest,ListTestCaseResultsResponse> listTestCaseResultsCallable()
Fetches the list of run results for the given test case. A maximum of 100 results are kept for each test case.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; } } }
-
getTestCaseResult
public final TestCaseResult getTestCaseResult(TestCaseResultName name)
Gets a test case result.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); }
- Parameters:
name
- Required. The name of the testcase. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/testCases/<TestCase ID>/results/<TestCaseResult ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getTestCaseResult
public final TestCaseResult getTestCaseResult(String name)
Gets a test case result.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); }
- Parameters:
name
- Required. The name of the testcase. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/testCases/<TestCase ID>/results/<TestCaseResult ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getTestCaseResult
public final TestCaseResult getTestCaseResult(GetTestCaseResultRequest request)
Gets a test case result.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); }
- 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
-
getTestCaseResultCallable
public final com.google.api.gax.rpc.UnaryCallable<GetTestCaseResultRequest,TestCaseResult> getTestCaseResultCallable()
Gets a test case result.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(); }
-
listLocations
public final TestCasesClient.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 (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); } }
- 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,TestCasesClient.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 (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); } }
-
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 (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; } } }
-
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 (TestCasesClient testCasesClient = TestCasesClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = testCasesClient.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 (TestCasesClient testCasesClient = TestCasesClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = testCasesClient.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
-
-