Dialogflow API C++ Client 2.13.0
A C++ Client Library for the Dialogflow API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
google::cloud::dialogflow_cx::FlowsClient Class Reference

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
 
FlowsClientoperator= (FlowsClient const &)=default
 
 FlowsClient (FlowsClient &&)=default
 
FlowsClientoperator= (FlowsClient &&)=default
 

Friends

Equality
bool operator== (FlowsClient const &a, FlowsClient const &b)
 
bool operator!= (FlowsClient const &a, FlowsClient const &b)
 

Detailed Description

Service for managing Flows.

Equality

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.

Performance

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.

Thread Safety

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.

Constructor & Destructor Documentation

◆ FlowsClient() [1/3]

google::cloud::dialogflow_cx::FlowsClient::FlowsClient ( std::shared_ptr< FlowsConnection connection,
Options  opts = {} 
)
explicit

◆ ~FlowsClient()

google::cloud::dialogflow_cx::FlowsClient::~FlowsClient ( )

◆ FlowsClient() [2/3]

google::cloud::dialogflow_cx::FlowsClient::FlowsClient ( FlowsClient const &  )
default

◆ FlowsClient() [3/3]

google::cloud::dialogflow_cx::FlowsClient::FlowsClient ( FlowsClient &&  )
default

Member Function Documentation

◆ CreateFlow() [1/2]

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.

Parameters
requestUnary 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.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.dialogflow.cx.v3.Flow) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ CreateFlow() [2/2]

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.

Parameters
parentRequired. The agent to create a flow for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.
flowRequired. The flow to create.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.dialogflow.cx.v3.Flow) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ DeleteFlow() [1/2]

Status google::cloud::dialogflow_cx::FlowsClient::DeleteFlow ( google::cloud::dialogflow::cx::v3::DeleteFlowRequest const &  request,
Options  opts = {} 
)

Deletes a specified flow.

Parameters
requestUnary 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.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a `Status` object. If the request failed, the status contains the details of the failure.

◆ DeleteFlow() [2/2]

Status google::cloud::dialogflow_cx::FlowsClient::DeleteFlow ( std::string const &  name,
Options  opts = {} 
)

Deletes a specified flow.

Parameters
nameRequired. The name of the flow to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a `Status` object. If the request failed, the status contains the details of the failure.

◆ ExportFlow()

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:

Note that resources (e.g. intents, entities, webhooks) that the flow references will also be exported.

Parameters
requestUnary 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.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.dialogflow.cx.v3.ExportFlowResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ GetFlow() [1/2]

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.

Parameters
requestUnary 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.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.dialogflow.cx.v3.Flow) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetFlow() [2/2]

StatusOr< google::cloud::dialogflow::cx::v3::Flow > google::cloud::dialogflow_cx::FlowsClient::GetFlow ( std::string const &  name,
Options  opts = {} 
)

Retrieves the specified flow.

Parameters
nameRequired. The name of the flow to get. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.dialogflow.cx.v3.Flow) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetFlowValidationResult() [1/2]

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.

Parameters
requestUnary 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.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.dialogflow.cx.v3.FlowValidationResult) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetFlowValidationResult() [2/2]

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.

Parameters
nameRequired. The flow name. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/validationResult.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.dialogflow.cx.v3.FlowValidationResult) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ ImportFlow()

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:

Note: You should always train a flow prior to sending it queries. See the training documentation.

Parameters
requestUnary 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.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.dialogflow.cx.v3.ImportFlowResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ ListFlows() [1/2]

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.

Parameters
requestUnary 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.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has 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.

◆ ListFlows() [2/2]

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.

Parameters
parentRequired. The agent containing the flows. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has 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.

◆ operator=() [1/2]

FlowsClient & google::cloud::dialogflow_cx::FlowsClient::operator= ( FlowsClient &&  )
default

◆ operator=() [2/2]

FlowsClient & google::cloud::dialogflow_cx::FlowsClient::operator= ( FlowsClient const &  )
default

◆ TrainFlow() [1/2]

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:

Note: You should always train a flow prior to sending it queries. See the training documentation.

Parameters
requestUnary 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.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.protobuf.Struct proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ TrainFlow() [2/2]

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:

Note: You should always train a flow prior to sending it queries. See the training documentation.

Parameters
nameRequired. The flow to train. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.protobuf.Struct proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ UpdateFlow() [1/2]

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.

Parameters
flowRequired. The flow to update.
update_maskThe mask to control which fields get updated. If the mask is not present, all fields will be updated.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.dialogflow.cx.v3.Flow) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ UpdateFlow() [2/2]

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.

Parameters
requestUnary 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.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.dialogflow.cx.v3.Flow) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ ValidateFlow()

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.

Parameters
requestUnary 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.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.cloud.dialogflow.cx.v3.FlowValidationResult) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( FlowsClient const &  a,
FlowsClient const &  b 
)
friend

◆ operator==

bool operator== ( FlowsClient const &  a,
FlowsClient const &  b 
)
friend