Dialogflow API C++ Client 2.13.0
A C++ Client Library for the Dialogflow API
|
Service for managing Flows. More...
#include <google/cloud/dialogflow_cx/flows_client.h>
Public Member Functions | |
FlowsClient (std::shared_ptr< FlowsConnection > connection, Options opts={}) | |
~FlowsClient () | |
StatusOr< google::cloud::dialogflow::cx::v3::Flow > | CreateFlow (std::string const &parent, google::cloud::dialogflow::cx::v3::Flow const &flow, Options opts={}) |
Creates a flow in the specified agent. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::Flow > | CreateFlow (google::cloud::dialogflow::cx::v3::CreateFlowRequest const &request, Options opts={}) |
Creates a flow in the specified agent. More... | |
Status | DeleteFlow (std::string const &name, Options opts={}) |
Deletes a specified flow. More... | |
Status | DeleteFlow (google::cloud::dialogflow::cx::v3::DeleteFlowRequest const &request, Options opts={}) |
Deletes a specified flow. More... | |
StreamRange< google::cloud::dialogflow::cx::v3::Flow > | ListFlows (std::string const &parent, Options opts={}) |
Returns the list of all flows in the specified agent. More... | |
StreamRange< google::cloud::dialogflow::cx::v3::Flow > | ListFlows (google::cloud::dialogflow::cx::v3::ListFlowsRequest request, Options opts={}) |
Returns the list of all flows in the specified agent. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::Flow > | GetFlow (std::string const &name, Options opts={}) |
Retrieves the specified flow. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::Flow > | GetFlow (google::cloud::dialogflow::cx::v3::GetFlowRequest const &request, Options opts={}) |
Retrieves the specified flow. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::Flow > | UpdateFlow (google::cloud::dialogflow::cx::v3::Flow const &flow, google::protobuf::FieldMask const &update_mask, Options opts={}) |
Updates the specified flow. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::Flow > | UpdateFlow (google::cloud::dialogflow::cx::v3::UpdateFlowRequest const &request, Options opts={}) |
Updates the specified flow. More... | |
future< StatusOr< google::protobuf::Struct > > | TrainFlow (std::string const &name, Options opts={}) |
Trains the specified flow. More... | |
future< StatusOr< google::protobuf::Struct > > | TrainFlow (google::cloud::dialogflow::cx::v3::TrainFlowRequest const &request, Options opts={}) |
Trains the specified flow. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::FlowValidationResult > | ValidateFlow (google::cloud::dialogflow::cx::v3::ValidateFlowRequest const &request, Options opts={}) |
Validates the specified flow and creates or updates validation results. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::FlowValidationResult > | GetFlowValidationResult (std::string const &name, Options opts={}) |
Gets the latest flow validation result. More... | |
StatusOr< google::cloud::dialogflow::cx::v3::FlowValidationResult > | GetFlowValidationResult (google::cloud::dialogflow::cx::v3::GetFlowValidationResultRequest const &request, Options opts={}) |
Gets the latest flow validation result. More... | |
future< StatusOr< google::cloud::dialogflow::cx::v3::ImportFlowResponse > > | ImportFlow (google::cloud::dialogflow::cx::v3::ImportFlowRequest const &request, Options opts={}) |
Imports the specified flow to the specified agent from a binary file. More... | |
future< StatusOr< google::cloud::dialogflow::cx::v3::ExportFlowResponse > > | ExportFlow (google::cloud::dialogflow::cx::v3::ExportFlowRequest const &request, Options opts={}) |
Exports the specified flow to a binary file. More... | |
Copy and move support | |
FlowsClient (FlowsClient const &)=default | |
FlowsClient & | operator= (FlowsClient const &)=default |
FlowsClient (FlowsClient &&)=default | |
FlowsClient & | operator= (FlowsClient &&)=default |
Friends | |
Equality | |
bool | operator== (FlowsClient const &a, FlowsClient const &b) |
bool | operator!= (FlowsClient const &a, FlowsClient const &b) |
Service for managing Flows.
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::FlowsClient::~FlowsClient | ( | ) |
|
default |
|
default |
StatusOr< google::cloud::dialogflow::cx::v3::Flow > google::cloud::dialogflow_cx::FlowsClient::CreateFlow | ( | google::cloud::dialogflow::cx::v3::CreateFlowRequest const & | request, |
Options | opts = {} |
||
) |
Creates a flow in the specified agent.
Note: You should always train a flow prior to sending it queries. See the training documentation.
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.CreateFlowRequest. 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::Flow > google::cloud::dialogflow_cx::FlowsClient::CreateFlow | ( | std::string const & | parent, |
google::cloud::dialogflow::cx::v3::Flow const & | flow, | ||
Options | opts = {} |
||
) |
Creates a flow in the specified agent.
Note: You should always train a flow prior to sending it queries. See the training documentation.
parent | Required. The agent to create a flow for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID> . |
flow | Required. The flow to create. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
Status google::cloud::dialogflow_cx::FlowsClient::DeleteFlow | ( | google::cloud::dialogflow::cx::v3::DeleteFlowRequest const & | request, |
Options | opts = {} |
||
) |
Deletes a specified flow.
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.DeleteFlowRequest. 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::FlowsClient::DeleteFlow | ( | std::string const & | name, |
Options | opts = {} |
||
) |
Deletes a specified flow.
name | Required. The name of the flow to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID> . |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
future< StatusOr< google::cloud::dialogflow::cx::v3::ExportFlowResponse > > google::cloud::dialogflow_cx::FlowsClient::ExportFlow | ( | google::cloud::dialogflow::cx::v3::ExportFlowRequest const & | request, |
Options | opts = {} |
||
) |
Exports the specified flow to a binary file.
This method is a long-running operation. The returned Operation
type has the following method-specific fields:
metadata
: An empty Struct messageresponse
: ExportFlowResponseNote that resources (e.g. intents, entities, webhooks) that the flow references will also be exported.
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.ExportFlowRequest. 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::Flow > google::cloud::dialogflow_cx::FlowsClient::GetFlow | ( | google::cloud::dialogflow::cx::v3::GetFlowRequest const & | request, |
Options | opts = {} |
||
) |
Retrieves the specified flow.
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.GetFlowRequest. 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::Flow > google::cloud::dialogflow_cx::FlowsClient::GetFlow | ( | std::string const & | name, |
Options | opts = {} |
||
) |
Retrieves the specified flow.
name | Required. The name of the flow to get. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID> . |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::cloud::dialogflow::cx::v3::FlowValidationResult > google::cloud::dialogflow_cx::FlowsClient::GetFlowValidationResult | ( | google::cloud::dialogflow::cx::v3::GetFlowValidationResultRequest const & | request, |
Options | opts = {} |
||
) |
Gets the latest flow validation result.
Flow validation is performed when ValidateFlow is called.
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.GetFlowValidationResultRequest. 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::FlowValidationResult > google::cloud::dialogflow_cx::FlowsClient::GetFlowValidationResult | ( | std::string const & | name, |
Options | opts = {} |
||
) |
Gets the latest flow validation result.
Flow validation is performed when ValidateFlow is called.
name | Required. The flow name. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/validationResult . |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
future< StatusOr< google::cloud::dialogflow::cx::v3::ImportFlowResponse > > google::cloud::dialogflow_cx::FlowsClient::ImportFlow | ( | google::cloud::dialogflow::cx::v3::ImportFlowRequest const & | request, |
Options | opts = {} |
||
) |
Imports the specified flow to the specified agent from a binary file.
This method is a long-running operation. The returned Operation
type has the following method-specific fields:
metadata
: An empty Struct messageresponse
: ImportFlowResponseNote: You should always train a flow prior to sending it queries. See the training documentation.
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.ImportFlowRequest. 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::Flow > google::cloud::dialogflow_cx::FlowsClient::ListFlows | ( | google::cloud::dialogflow::cx::v3::ListFlowsRequest | request, |
Options | opts = {} |
||
) |
Returns the list of all flows in the specified 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.ListFlowsRequest. 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.Flow, 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::Flow > google::cloud::dialogflow_cx::FlowsClient::ListFlows | ( | std::string const & | parent, |
Options | opts = {} |
||
) |
Returns the list of all flows in the specified agent.
parent | Required. The agent containing the flows. 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.Flow, 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::protobuf::Struct > > google::cloud::dialogflow_cx::FlowsClient::TrainFlow | ( | google::cloud::dialogflow::cx::v3::TrainFlowRequest const & | request, |
Options | opts = {} |
||
) |
Trains the specified flow.
Note that only the flow in 'draft' environment is trained.
This method is a long-running operation. The returned Operation
type has the following method-specific fields:
metadata
: An empty Struct messageresponse
: An Empty messageNote: You should always train a flow prior to sending it queries. See the training documentation.
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.TrainFlowRequest. 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. |
future< StatusOr< google::protobuf::Struct > > google::cloud::dialogflow_cx::FlowsClient::TrainFlow | ( | std::string const & | name, |
Options | opts = {} |
||
) |
Trains the specified flow.
Note that only the flow in 'draft' environment is trained.
This method is a long-running operation. The returned Operation
type has the following method-specific fields:
metadata
: An empty Struct messageresponse
: An Empty messageNote: You should always train a flow prior to sending it queries. See the training documentation.
name | Required. The flow to train. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID> . |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::cloud::dialogflow::cx::v3::Flow > google::cloud::dialogflow_cx::FlowsClient::UpdateFlow | ( | google::cloud::dialogflow::cx::v3::Flow const & | flow, |
google::protobuf::FieldMask const & | update_mask, | ||
Options | opts = {} |
||
) |
Updates the specified flow.
Note: You should always train a flow prior to sending it queries. See the training documentation.
flow | Required. The flow to update. |
update_mask | The mask to control which fields get updated. If the mask is not present, all fields will be updated. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::cloud::dialogflow::cx::v3::Flow > google::cloud::dialogflow_cx::FlowsClient::UpdateFlow | ( | google::cloud::dialogflow::cx::v3::UpdateFlowRequest const & | request, |
Options | opts = {} |
||
) |
Updates the specified flow.
Note: You should always train a flow prior to sending it queries. See the training documentation.
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.UpdateFlowRequest. 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::FlowValidationResult > google::cloud::dialogflow_cx::FlowsClient::ValidateFlow | ( | google::cloud::dialogflow::cx::v3::ValidateFlowRequest const & | request, |
Options | opts = {} |
||
) |
Validates the specified flow and creates or updates validation results.
Please call this API after the training is completed to get the complete validation results.
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.ValidateFlowRequest. 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 |