Dialogflow API C++ Client  2.4.0
A C++ Client Library for the Dialogflow API
Public Member Functions | Friends | List of all members
google::cloud::dialogflow_cx::FlowsClient Class Reference

Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow]. More...

#include <google/cloud/dialogflow_cx/flows_client.h>

Public Member Functions

 FlowsClient (std::shared_ptr< FlowsConnection > connection, Options opts={})
 
 ~FlowsClient ()
 
 FlowsClient (FlowsClient const &)=default
 
FlowsClientoperator= (FlowsClient const &)=default
 
 FlowsClient (FlowsClient &&)=default
 
FlowsClientoperator= (FlowsClient &&)=default
 
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...
 

Friends

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

Detailed Description

Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow].

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.

Definition at line 62 of file flows_client.h.

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
requestgoogle::cloud::dialogflow::cx::v3::CreateFlowRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::dialogflow::cx::v3::Flow

◆ 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
google::cloud::dialogflow::cx::v3::Flow

◆ 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
requestgoogle::cloud::dialogflow::cx::v3::DeleteFlowRequest
optsOptional. Override the class-level options, such as retry and backoff policies.

◆ 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.

◆ 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
requestgoogle::cloud::dialogflow::cx::v3::ExportFlowRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::dialogflow::cx::v3::ExportFlowResponse

◆ 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
requestgoogle::cloud::dialogflow::cx::v3::GetFlowRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::dialogflow::cx::v3::Flow

◆ 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
google::cloud::dialogflow::cx::v3::Flow

◆ 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
requestgoogle::cloud::dialogflow::cx::v3::GetFlowValidationResultRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::dialogflow::cx::v3::FlowValidationResult

◆ 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
google::cloud::dialogflow::cx::v3::FlowValidationResult

◆ 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
requestgoogle::cloud::dialogflow::cx::v3::ImportFlowRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::dialogflow::cx::v3::ImportFlowResponse

◆ 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
requestgoogle::cloud::dialogflow::cx::v3::ListFlowsRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::dialogflow::cx::v3::Flow

◆ 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
google::cloud::dialogflow::cx::v3::Flow

◆ 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
requestgoogle::cloud::dialogflow::cx::v3::TrainFlowRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::protobuf::Struct

◆ 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
google::protobuf::Struct

◆ 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
google::cloud::dialogflow::cx::v3::Flow

◆ 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
requestgoogle::cloud::dialogflow::cx::v3::UpdateFlowRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::dialogflow::cx::v3::Flow

◆ 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
requestgoogle::cloud::dialogflow::cx::v3::ValidateFlowRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::dialogflow::cx::v3::FlowValidationResult

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 81 of file flows_client.h.

◆ operator==

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

Definition at line 78 of file flows_client.h.