Dialogflow CX V3 API - Class Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client (v0.23.0)

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

REST client for the Generators service.

Service for managing Generators

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the Generators 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_generator

def create_generator(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Generator
def create_generator(parent: nil, generator: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Generator

Creates a generator in the specified agent.

Overloads
def create_generator(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Generator
Pass arguments to create_generator via a request object, either of type CreateGeneratorRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest, ::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_generator(parent: nil, generator: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Generator
Pass arguments to create_generator 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 generator for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.
  • generator (::Google::Cloud::Dialogflow::CX::V3::Generator, ::Hash) — Required. The generator to create.
  • language_code (::String) —

    The language to create generators for the following fields:

    • Generator.prompt_text.text 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.
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::Generators::Rest::Client.new

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

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

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

#delete_generator

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

Deletes the specified generators.

Overloads
def delete_generator(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_generator via a request object, either of type DeleteGeneratorRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest, ::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_generator(name: nil, force: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_generator 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 generator to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/generators/<Generator ID>.
  • force (::Boolean) —

    This field has no effect for generators not being used. For generators that are used by pages/flows/transition route groups:

    • If force is set to false, an error will be returned with message indicating the referenced resources.
    • If force is set to true, Dialogflow will remove the generator, as well as any references to the generator (i.e. [Generator][Fulfillment.generator]) in fulfillments.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Generators::Rest::Client.new

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

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

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

#get_generator

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

Retrieves the specified generator.

Overloads
def get_generator(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Generator
Pass arguments to get_generator via a request object, either of type Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest, ::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_generator(name: nil, language_code: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Generator
Pass arguments to get_generator 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 generator. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/generators/<Generator ID>.
  • language_code (::String) — The language to list generators for.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Generators::Rest::Client.new

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

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

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

#initialize

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

Create a new Generators REST client object.

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

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

#list_generators

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

Returns the list of all generators in the specified agent.

Overloads
def list_generators(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Generator>
Pass arguments to list_generators via a request object, either of type ListGeneratorsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest, ::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_generators(parent: nil, language_code: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Generator>
Pass arguments to list_generators 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 list all generators for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.
  • language_code (::String) — The language to list generators for.
  • 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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Generators::Rest::Client.new

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

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Generator.
  p item
end

#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)

#update_generator

def update_generator(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Generator
def update_generator(generator: nil, language_code: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Generator

Update the specified generator.

Overloads
def update_generator(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Generator
Pass arguments to update_generator via a request object, either of type UpdateGeneratorRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest, ::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_generator(generator: nil, language_code: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Generator
Pass arguments to update_generator 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
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Generators::Rest::Client.new

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

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

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