Dialogflow CX V3 API - Class Google::Cloud::Dialogflow::CX::V3::Pages::Client (v0.9.0)

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

Client for the Pages service.

Service for managing Pages.

Inherits

  • Object

Methods

.configure

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

Configure the Pages 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 Pages clients
::Google::Cloud::Dialogflow::CX::V3::Pages::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the Pages 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_page

def create_page(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Page
def create_page(parent: nil, page: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Page

Creates a page in the specified flow.

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

Overloads
def create_page(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Page
Pass arguments to create_page via a request object, either of type CreatePageRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest, ::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_page(parent: nil, page: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Page
Pass arguments to create_page 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 flow to create a page for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.
  • page (::Google::Cloud::Dialogflow::CX::V3::Page, ::Hash) — Required. The page to create.
  • language_code (::String) — The language of the following fields in page:

    • Page.entry_fulfillment.messages
    • Page.entry_fulfillment.conditional_cases
    • Page.event_handlers.trigger_fulfillment.messages
    • Page.event_handlers.trigger_fulfillment.conditional_cases
    • Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages * Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases
    • Page.form.parameters.fill_behavior.reprompt_event_handlers.messages * Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases
    • Page.transition_routes.trigger_fulfillment.messages
    • Page.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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dialogflow/cx/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new

# Call the create_page method.
result = client.create_page request

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page.
p result

#delete_page

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

Deletes the specified page.

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

Overloads
def delete_page(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_page via a request object, either of type DeletePageRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest, ::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_page(name: nil, force: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_page 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 page to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/Flows/<flow ID>/pages/<Page ID>.
  • force (::Boolean) —

    This field has no effect for pages with no incoming transitions. For pages 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 page, as well as any transitions to the page (i.e. [Target page][EventHandler.target_page] in event handlers or [Target page][TransitionRoute.target_page] in transition routes that point to this page will be cleared).
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dialogflow/cx/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new

# Call the delete_page method.
result = client.delete_page request

# The returned object is of type Google::Protobuf::Empty.
p result

#get_page

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

Retrieves the specified page.

Overloads
def get_page(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Page
Pass arguments to get_page via a request object, either of type GetPageRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::GetPageRequest, ::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_page(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Page
Pass arguments to get_page 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 page. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>.
  • language_code (::String) — The language to retrieve the page for. The following fields are language dependent:

    • Page.entry_fulfillment.messages
    • Page.entry_fulfillment.conditional_cases
    • Page.event_handlers.trigger_fulfillment.messages
    • Page.event_handlers.trigger_fulfillment.conditional_cases
    • Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages * Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases
    • Page.form.parameters.fill_behavior.reprompt_event_handlers.messages * Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases
    • Page.transition_routes.trigger_fulfillment.messages
    • Page.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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dialogflow/cx/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::GetPageRequest.new

# Call the get_page method.
result = client.get_page request

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page.
p result

#initialize

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

Create a new Pages client object.

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

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

#list_pages

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

Returns the list of all pages in the specified flow.

Overloads
def list_pages(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Page>
Pass arguments to list_pages via a request object, either of type ListPagesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest, ::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_pages(parent: nil, language_code: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Page>
Pass arguments to list_pages 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 flow to list all pages for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.
  • language_code (::String) — The language to list pages for. The following fields are language dependent:

    • Page.entry_fulfillment.messages
    • Page.entry_fulfillment.conditional_cases
    • Page.event_handlers.trigger_fulfillment.messages
    • Page.event_handlers.trigger_fulfillment.conditional_cases
    • Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages * Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases
    • Page.form.parameters.fill_behavior.reprompt_event_handlers.messages * Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases
    • Page.transition_routes.trigger_fulfillment.messages
    • Page.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.

  • 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dialogflow/cx/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.new

# Call the list_pages method.
result = client.list_pages request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Page.
  p response
end

#location_client

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

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

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

#update_page

def update_page(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Page
def update_page(page: nil, language_code: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Page

Updates the specified page.

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

Overloads
def update_page(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Page
Pass arguments to update_page via a request object, either of type UpdatePageRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest, ::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_page(page: nil, language_code: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Page
Pass arguments to update_page 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
  • page (::Google::Cloud::Dialogflow::CX::V3::Page, ::Hash) — Required. The page to update.
  • language_code (::String) — The language of the following fields in page:

    • Page.entry_fulfillment.messages
    • Page.entry_fulfillment.conditional_cases
    • Page.event_handlers.trigger_fulfillment.messages
    • Page.event_handlers.trigger_fulfillment.conditional_cases
    • Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages * Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases
    • Page.form.parameters.fill_behavior.reprompt_event_handlers.messages * Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases
    • Page.transition_routes.trigger_fulfillment.messages
    • Page.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.

  • 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dialogflow/cx/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new

# Call the update_page method.
result = client.update_page request

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page.
p result