Dialogflow CX V3 API - Class Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client (v0.16.0)

Reference documentation and code samples for the Dialogflow CX V3 API class Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.

REST client for the Flows service.

Service for managing Flows.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the Flows Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all Flows clients
::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the Flows Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_flow

def create_flow(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Flow
def create_flow(parent: nil, flow: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Flow

Creates a flow in the specified agent.

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

Overloads
def create_flow(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Flow
Pass arguments to create_flow via a request object, either of type CreateFlowRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_flow(parent: nil, flow: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Flow
Pass arguments to create_flow via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The agent to create a flow for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.
  • flow (::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash) — Required. The flow to create.
  • language_code (::String) — The language of the following fields in flow:

    • Flow.event_handlers.trigger_fulfillment.messages
    • Flow.event_handlers.trigger_fulfillment.conditional_cases
    • Flow.transition_routes.trigger_fulfillment.messages
    • Flow.transition_routes.trigger_fulfillment.conditional_cases

    If not specified, the agent's default language is used. Many languages are supported. Note: languages must be enabled in the agent before they can be used.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#delete_flow

def delete_flow(request, options = nil) -> ::Google::Protobuf::Empty
def delete_flow(name: nil, force: nil) -> ::Google::Protobuf::Empty

Deletes a specified flow.

Overloads
def delete_flow(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_flow via a request object, either of type DeleteFlowRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_flow(name: nil, force: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_flow via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The name of the flow to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.
  • force (::Boolean) —

    This field has no effect for flows with no incoming transitions. For flows with incoming transitions:

    • If force is set to false, an error will be returned with message indicating the incoming transitions.
    • If force is set to true, Dialogflow will remove the flow, as well as any transitions to the flow (i.e. [Target flow][EventHandler.target_flow] in event handlers or [Target flow][TransitionRoute.target_flow] in transition routes that point to this flow will be cleared).
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#export_flow

def export_flow(request, options = nil) -> ::Gapic::Operation
def export_flow(name: nil, flow_uri: nil, include_referenced_flows: nil) -> ::Gapic::Operation

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.

Overloads
def export_flow(request, options = nil) -> ::Gapic::Operation
Pass arguments to export_flow via a request object, either of type ExportFlowRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def export_flow(name: nil, flow_uri: nil, include_referenced_flows: nil) -> ::Gapic::Operation
Pass arguments to export_flow via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The name of the flow to export. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.
  • flow_uri (::String) — Optional. The Google Cloud Storage URI to export the flow to. The format of this URI must be gs://<bucket-name>/<object-name>. If left unspecified, the serialized flow is returned inline.

    Dialogflow performs a write operation for the Cloud Storage object on the caller's behalf, so your request authentication must have write permissions for the object. For more information, see Dialogflow access control.

  • include_referenced_flows (::Boolean) — Optional. Whether to export flows referenced by the specified flow.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_flow

def get_flow(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Flow
def get_flow(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Flow

Retrieves the specified flow.

Overloads
def get_flow(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Flow
Pass arguments to get_flow via a request object, either of type GetFlowRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_flow(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Flow
Pass arguments to get_flow via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The name of the flow to get. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.
  • language_code (::String) — The language to retrieve the flow for. The following fields are language dependent:

    • Flow.event_handlers.trigger_fulfillment.messages
    • Flow.event_handlers.trigger_fulfillment.conditional_cases
    • Flow.transition_routes.trigger_fulfillment.messages
    • Flow.transition_routes.trigger_fulfillment.conditional_cases

    If not specified, the agent's default language is used. Many languages are supported. Note: languages must be enabled in the agent before they can be used.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_flow_validation_result

def get_flow_validation_result(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult
def get_flow_validation_result(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult

Gets the latest flow validation result. Flow validation is performed when ValidateFlow is called.

Overloads
def get_flow_validation_result(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult
Pass arguments to get_flow_validation_result via a request object, either of type GetFlowValidationResultRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_flow_validation_result(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult
Pass arguments to get_flow_validation_result via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The flow name. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/validationResult.
  • language_code (::String) — If not specified, the agent's default language is used.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#import_flow

def import_flow(request, options = nil) -> ::Gapic::Operation
def import_flow(parent: nil, flow_uri: nil, flow_content: nil, import_option: nil) -> ::Gapic::Operation

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.

Overloads
def import_flow(request, options = nil) -> ::Gapic::Operation
Pass arguments to import_flow via a request object, either of type ImportFlowRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def import_flow(parent: nil, flow_uri: nil, flow_content: nil, import_option: nil) -> ::Gapic::Operation
Pass arguments to import_flow via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The agent to import the flow into. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.
  • flow_uri (::String) — The Google Cloud Storage URI to import flow from. The format of this URI must be gs://<bucket-name>/<object-name>.

    Dialogflow performs a read operation for the Cloud Storage object on the caller's behalf, so your request authentication must have read permissions for the object. For more information, see Dialogflow access control.

  • flow_content (::String) — Uncompressed raw byte content for flow.
  • import_option (::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest::ImportOption) — Flow import mode. If not specified, KEEP is assumed.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#initialize

def initialize() { |config| ... } -> Client

Create a new Flows REST client object.

Yields
  • (config) — Configure the Flows client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config|
  config.timeout = 10.0
end

#list_flows

def list_flows(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>
def list_flows(parent: nil, page_size: nil, page_token: nil, language_code: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>

Returns the list of all flows in the specified agent.

Overloads
def list_flows(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>
Pass arguments to list_flows via a request object, either of type ListFlowsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_flows(parent: nil, page_size: nil, page_token: nil, language_code: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>
Pass arguments to list_flows via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The agent containing the flows. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.
  • page_size (::Integer) — The maximum number of items to return in a single page. By default 100 and at most 1000.
  • page_token (::String) — The next_page_token value returned from a previous list request.
  • language_code (::String) — The language to list flows for. The following fields are language dependent:

    • Flow.event_handlers.trigger_fulfillment.messages
    • Flow.event_handlers.trigger_fulfillment.conditional_cases
    • Flow.transition_routes.trigger_fulfillment.messages
    • Flow.transition_routes.trigger_fulfillment.conditional_cases

    If not specified, the agent's default language is used. Many languages are supported. Note: languages must be enabled in the agent before they can be used.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#location_client

def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Rest::Client)

#operations_client

def operations_client() -> ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Operations

Get the associated client for long-running operations.

#train_flow

def train_flow(request, options = nil) -> ::Gapic::Operation
def train_flow(name: nil) -> ::Gapic::Operation

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.

Overloads
def train_flow(request, options = nil) -> ::Gapic::Operation
Pass arguments to train_flow via a request object, either of type TrainFlowRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def train_flow(name: nil) -> ::Gapic::Operation
Pass arguments to train_flow via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The flow to train. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#update_flow

def update_flow(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Flow
def update_flow(flow: nil, update_mask: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Flow

Updates the specified flow.

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

Overloads
def update_flow(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Flow
Pass arguments to update_flow via a request object, either of type UpdateFlowRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_flow(flow: nil, update_mask: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Flow
Pass arguments to update_flow via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • flow (::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash) — Required. The flow to update.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — The mask to control which fields get updated. If the mask is not present, all fields will be updated.
  • language_code (::String) — The language of the following fields in flow:

    • Flow.event_handlers.trigger_fulfillment.messages
    • Flow.event_handlers.trigger_fulfillment.conditional_cases
    • Flow.transition_routes.trigger_fulfillment.messages
    • Flow.transition_routes.trigger_fulfillment.conditional_cases

    If not specified, the agent's default language is used. Many languages are supported. Note: languages must be enabled in the agent before they can be used.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#validate_flow

def validate_flow(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult
def validate_flow(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult

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.

Overloads
def validate_flow(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult
Pass arguments to validate_flow via a request object, either of type ValidateFlowRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def validate_flow(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult
Pass arguments to validate_flow via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The flow to validate. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.
  • language_code (::String) — If not specified, the agent's default language is used.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.