Dialogflow API C++ Client 2.13.0
A C++ Client Library for the Dialogflow API
|
Service for managing Test Cases and Test Case Results. More...
#include <google/cloud/dialogflow_cx/test_cases_client.h>
Public Member Functions | |
TestCasesClient (std::shared_ptr< TestCasesConnection > connection, Options opts={}) | |
~TestCasesClient () | |
StreamRange< google::cloud::dialogflow::cx::v3::TestCase > | ListTestCases (std::string const &parent, Options opts={}) |
Fetches a list of test cases for a given agent. More... | |
StreamRange< google::cloud::dialogflow::cx::v3::TestCase > | ListTestCases (google::cloud::dialogflow::cx::v3::ListTestCasesRequest request, Options opts={}) |
Fetches a list of test cases for a given agent. More... | |
Status | BatchDeleteTestCases (std::string const &parent, Options opts={}) |
Batch deletes test cases. More... | |
Status | BatchDeleteTestCases (google::cloud::dialogflow::cx::v3::BatchDeleteTestCasesRequest const &request, Options opts={}) |
Batch deletes test cases. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::TestCase > | GetTestCase (std::string const &name, Options opts={}) |
Gets a test case. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::TestCase > | GetTestCase (google::cloud::dialogflow::cx::v3::GetTestCaseRequest const &request, Options opts={}) |
Gets a test case. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::TestCase > | CreateTestCase (std::string const &parent, google::cloud::dialogflow::cx::v3::TestCase const &test_case, Options opts={}) |
Creates a test case for the given agent. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::TestCase > | CreateTestCase (google::cloud::dialogflow::cx::v3::CreateTestCaseRequest const &request, Options opts={}) |
Creates a test case for the given agent. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::TestCase > | UpdateTestCase (google::cloud::dialogflow::cx::v3::TestCase const &test_case, google::protobuf::FieldMask const &update_mask, Options opts={}) |
Updates the specified test case. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::TestCase > | UpdateTestCase (google::cloud::dialogflow::cx::v3::UpdateTestCaseRequest const &request, Options opts={}) |
Updates the specified test case. More... | |
future< StatusOr< google::cloud::dialogflow::cx::v3::RunTestCaseResponse > > | RunTestCase (google::cloud::dialogflow::cx::v3::RunTestCaseRequest const &request, Options opts={}) |
Kicks off a test case run. More... | |
future< StatusOr< google::cloud::dialogflow::cx::v3::BatchRunTestCasesResponse > > | BatchRunTestCases (google::cloud::dialogflow::cx::v3::BatchRunTestCasesRequest const &request, Options opts={}) |
Kicks off a batch run of test cases. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::CalculateCoverageResponse > | CalculateCoverage (google::cloud::dialogflow::cx::v3::CalculateCoverageRequest const &request, Options opts={}) |
Calculates the test coverage for an agent. More... | |
future< StatusOr< google::cloud::dialogflow::cx::v3::ImportTestCasesResponse > > | ImportTestCases (google::cloud::dialogflow::cx::v3::ImportTestCasesRequest const &request, Options opts={}) |
Imports the test cases from a Cloud Storage bucket or a local file. More... | |
future< StatusOr< google::cloud::dialogflow::cx::v3::ExportTestCasesResponse > > | ExportTestCases (google::cloud::dialogflow::cx::v3::ExportTestCasesRequest const &request, Options opts={}) |
Exports the test cases under the agent to a Cloud Storage bucket or a local file. More... | |
StreamRange< google::cloud::dialogflow::cx::v3::TestCaseResult > | ListTestCaseResults (std::string const &parent, Options opts={}) |
Fetches a list of results for a given test case. More... | |
StreamRange< google::cloud::dialogflow::cx::v3::TestCaseResult > | ListTestCaseResults (google::cloud::dialogflow::cx::v3::ListTestCaseResultsRequest request, Options opts={}) |
Fetches a list of results for a given test case. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::TestCaseResult > | GetTestCaseResult (std::string const &name, Options opts={}) |
Gets a test case result. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::TestCaseResult > | GetTestCaseResult (google::cloud::dialogflow::cx::v3::GetTestCaseResultRequest const &request, Options opts={}) |
Gets a test case result. More... | |
Copy and move support | |
TestCasesClient (TestCasesClient const &)=default | |
TestCasesClient & | operator= (TestCasesClient const &)=default |
TestCasesClient (TestCasesClient &&)=default | |
TestCasesClient & | operator= (TestCasesClient &&)=default |
Friends | |
Equality | |
bool | operator== (TestCasesClient const &a, TestCasesClient const &b) |
bool | operator!= (TestCasesClient const &a, TestCasesClient const &b) |
Service for managing Test Cases and Test Case Results.
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
|
explicit |
google::cloud::dialogflow_cx::TestCasesClient::~TestCasesClient | ( | ) |
|
default |
|
default |
Status google::cloud::dialogflow_cx::TestCasesClient::BatchDeleteTestCases | ( | google::cloud::dialogflow::cx::v3::BatchDeleteTestCasesRequest const & | request, |
Options | opts = {} |
||
) |
Batch deletes test cases.
request | Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dialogflow.cx.v3.BatchDeleteTestCasesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
Status google::cloud::dialogflow_cx::TestCasesClient::BatchDeleteTestCases | ( | std::string const & | parent, |
Options | opts = {} |
||
) |
Batch deletes test cases.
parent | Required. The agent to delete test cases from. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID> . |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
future< StatusOr< google::cloud::dialogflow::cx::v3::BatchRunTestCasesResponse > > google::cloud::dialogflow_cx::TestCasesClient::BatchRunTestCases | ( | google::cloud::dialogflow::cx::v3::BatchRunTestCasesRequest const & | request, |
Options | opts = {} |
||
) |
Kicks off a batch run of test cases.
This method is a long-running operation. The returned Operation
type has the following method-specific fields:
metadata
: BatchRunTestCasesMetadataresponse
: BatchRunTestCasesResponserequest | Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dialogflow.cx.v3.BatchRunTestCasesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::cloud::dialogflow::cx::v3::CalculateCoverageResponse > google::cloud::dialogflow_cx::TestCasesClient::CalculateCoverage | ( | google::cloud::dialogflow::cx::v3::CalculateCoverageRequest const & | request, |
Options | opts = {} |
||
) |
Calculates the test coverage for an agent.
request | Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dialogflow.cx.v3.CalculateCoverageRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::cloud::dialogflow::cx::v3::TestCase > google::cloud::dialogflow_cx::TestCasesClient::CreateTestCase | ( | google::cloud::dialogflow::cx::v3::CreateTestCaseRequest const & | request, |
Options | opts = {} |
||
) |
Creates a test case for the given agent.
request | Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dialogflow.cx.v3.CreateTestCaseRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::cloud::dialogflow::cx::v3::TestCase > google::cloud::dialogflow_cx::TestCasesClient::CreateTestCase | ( | std::string const & | parent, |
google::cloud::dialogflow::cx::v3::TestCase const & | test_case, | ||
Options | opts = {} |
||
) |
Creates a test case for the given agent.
parent | Required. The agent to create the test case for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID> . |
test_case | Required. The test case to create. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
future< StatusOr< google::cloud::dialogflow::cx::v3::ExportTestCasesResponse > > google::cloud::dialogflow_cx::TestCasesClient::ExportTestCases | ( | google::cloud::dialogflow::cx::v3::ExportTestCasesRequest const & | request, |
Options | opts = {} |
||
) |
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. The returned Operation
type has the following method-specific fields:
metadata
: ExportTestCasesMetadataresponse
: ExportTestCasesResponserequest | Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dialogflow.cx.v3.ExportTestCasesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::cloud::dialogflow::cx::v3::TestCase > google::cloud::dialogflow_cx::TestCasesClient::GetTestCase | ( | google::cloud::dialogflow::cx::v3::GetTestCaseRequest const & | request, |
Options | opts = {} |
||
) |
Gets a test case.
request | Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dialogflow.cx.v3.GetTestCaseRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::cloud::dialogflow::cx::v3::TestCase > google::cloud::dialogflow_cx::TestCasesClient::GetTestCase | ( | std::string const & | name, |
Options | opts = {} |
||
) |
Gets a test case.
name | Required. The name of the testcase. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/testCases/<TestCase ID> . |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::cloud::dialogflow::cx::v3::TestCaseResult > google::cloud::dialogflow_cx::TestCasesClient::GetTestCaseResult | ( | google::cloud::dialogflow::cx::v3::GetTestCaseResultRequest const & | request, |
Options | opts = {} |
||
) |
Gets a test case result.
request | Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dialogflow.cx.v3.GetTestCaseResultRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::cloud::dialogflow::cx::v3::TestCaseResult > google::cloud::dialogflow_cx::TestCasesClient::GetTestCaseResult | ( | std::string const & | name, |
Options | opts = {} |
||
) |
Gets a test case result.
name | Required. The name of the testcase. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/testCases/<TestCase ID>/results/<TestCaseResult ID> . |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
future< StatusOr< google::cloud::dialogflow::cx::v3::ImportTestCasesResponse > > google::cloud::dialogflow_cx::TestCasesClient::ImportTestCases | ( | google::cloud::dialogflow::cx::v3::ImportTestCasesRequest const & | request, |
Options | opts = {} |
||
) |
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. The returned Operation
type has the following method-specific fields:
metadata
: ImportTestCasesMetadataresponse
: ImportTestCasesResponserequest | Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dialogflow.cx.v3.ImportTestCasesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StreamRange< google::cloud::dialogflow::cx::v3::TestCaseResult > google::cloud::dialogflow_cx::TestCasesClient::ListTestCaseResults | ( | google::cloud::dialogflow::cx::v3::ListTestCaseResultsRequest | request, |
Options | opts = {} |
||
) |
Fetches a list of results for a given test case.
request | Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
begin()
and end()
member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T>
contains elements of type google.cloud.dialogflow.cx.v3.TestCaseResult, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules. StreamRange< google::cloud::dialogflow::cx::v3::TestCaseResult > google::cloud::dialogflow_cx::TestCasesClient::ListTestCaseResults | ( | std::string const & | parent, |
Options | opts = {} |
||
) |
Fetches a list of results for a given test case.
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. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
begin()
and end()
member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T>
contains elements of type google.cloud.dialogflow.cx.v3.TestCaseResult, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules. StreamRange< google::cloud::dialogflow::cx::v3::TestCase > google::cloud::dialogflow_cx::TestCasesClient::ListTestCases | ( | google::cloud::dialogflow::cx::v3::ListTestCasesRequest | request, |
Options | opts = {} |
||
) |
Fetches a list of test cases for a given agent.
request | Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dialogflow.cx.v3.ListTestCasesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
begin()
and end()
member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T>
contains elements of type google.cloud.dialogflow.cx.v3.TestCase, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules. StreamRange< google::cloud::dialogflow::cx::v3::TestCase > google::cloud::dialogflow_cx::TestCasesClient::ListTestCases | ( | std::string const & | parent, |
Options | opts = {} |
||
) |
Fetches a list of test cases for a given agent.
parent | Required. The agent to list all pages for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID> . |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
begin()
and end()
member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T>
contains elements of type google.cloud.dialogflow.cx.v3.TestCase, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.
|
default |
|
default |
future< StatusOr< google::cloud::dialogflow::cx::v3::RunTestCaseResponse > > google::cloud::dialogflow_cx::TestCasesClient::RunTestCase | ( | google::cloud::dialogflow::cx::v3::RunTestCaseRequest const & | request, |
Options | opts = {} |
||
) |
Kicks off a test case run.
This method is a long-running operation. The returned Operation
type has the following method-specific fields:
metadata
: RunTestCaseMetadataresponse
: RunTestCaseResponserequest | Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dialogflow.cx.v3.RunTestCaseRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::cloud::dialogflow::cx::v3::TestCase > google::cloud::dialogflow_cx::TestCasesClient::UpdateTestCase | ( | google::cloud::dialogflow::cx::v3::TestCase const & | test_case, |
google::protobuf::FieldMask const & | update_mask, | ||
Options | opts = {} |
||
) |
Updates the specified test case.
test_case | Required. The test case to update. |
update_mask | Required. The mask to specify which fields should be updated. The [creationTime ][google.cloud.dialogflow.cx.v3.TestCase.creation_time] and [lastTestResult ][google.cloud.dialogflow.cx.v3.TestCase.last_test_result] cannot be updated. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::cloud::dialogflow::cx::v3::TestCase > google::cloud::dialogflow_cx::TestCasesClient::UpdateTestCase | ( | google::cloud::dialogflow::cx::v3::UpdateTestCaseRequest const & | request, |
Options | opts = {} |
||
) |
Updates the specified test case.
request | Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dialogflow.cx.v3.UpdateTestCaseRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
|
friend |
|
friend |