Dialogflow V2 API - Class Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client (v0.30.0)

Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.

REST client for the ConversationDatasets service.

Conversation datasets.

Conversation datasets contain raw conversation files and their customizable metadata that can be used for model training.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the ConversationDatasets 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_conversation_dataset

def create_conversation_dataset(request, options = nil) -> ::Gapic::Operation
def create_conversation_dataset(parent: nil, conversation_dataset: nil) -> ::Gapic::Operation

Creates a new conversation dataset.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

Overloads
def create_conversation_dataset(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_conversation_dataset via a request object, either of type Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest, ::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_conversation_dataset(parent: nil, conversation_dataset: nil) -> ::Gapic::Operation
Pass arguments to create_conversation_dataset 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 project to create conversation dataset for. Format: projects/<Project ID>/locations/<Location ID>
  • conversation_dataset (::Google::Cloud::Dialogflow::V2::ConversationDataset, ::Hash) — Required. The conversation dataset to create.
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.
Example

Basic example

require "google/cloud/dialogflow/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_conversation_dataset

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

Deletes the specified conversation dataset.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

Overloads
def delete_conversation_dataset(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_conversation_dataset via a request object, either of type DeleteConversationDatasetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest, ::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_conversation_dataset(name: nil) -> ::Gapic::Operation
Pass arguments to delete_conversation_dataset 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 conversation dataset to delete. Format: projects/<Project ID>/locations/<Location ID>/conversationDatasets/<Conversation Dataset 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.
Example

Basic example

require "google/cloud/dialogflow/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#get_conversation_dataset

def get_conversation_dataset(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::ConversationDataset
def get_conversation_dataset(name: nil) -> ::Google::Cloud::Dialogflow::V2::ConversationDataset

Retrieves the specified conversation dataset.

Overloads
def get_conversation_dataset(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::ConversationDataset
Pass arguments to get_conversation_dataset via a request object, either of type GetConversationDatasetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest, ::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_conversation_dataset(name: nil) -> ::Google::Cloud::Dialogflow::V2::ConversationDataset
Pass arguments to get_conversation_dataset 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 conversation dataset to retrieve. Format: projects/<Project ID>/locations/<Location ID>/conversationDatasets/<Conversation Dataset ID>
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/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new

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

# The returned object is of type Google::Cloud::Dialogflow::V2::ConversationDataset.
p result

#import_conversation_data

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

Import data into the specified conversation dataset. Note that it is not allowed to import data to a conversation dataset that already has data in it.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

Overloads
def import_conversation_data(request, options = nil) -> ::Gapic::Operation
Pass arguments to import_conversation_data via a request object, either of type ImportConversationDataRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest, ::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_conversation_data(name: nil, input_config: nil) -> ::Gapic::Operation
Pass arguments to import_conversation_data 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. Dataset resource name. Format: projects/<Project ID>/locations/<Location ID>/conversationDatasets/<Conversation Dataset ID>
  • input_config (::Google::Cloud::Dialogflow::V2::InputConfig, ::Hash) — Required. Configuration describing where to import data from.
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.
Example

Basic example

require "google/cloud/dialogflow/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#initialize

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

Create a new ConversationDatasets REST client object.

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

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

#list_conversation_datasets

def list_conversation_datasets(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>
def list_conversation_datasets(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>

Returns the list of all conversation datasets in the specified project and location.

Overloads
def list_conversation_datasets(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>
Pass arguments to list_conversation_datasets via a request object, either of type ListConversationDatasetsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest, ::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_conversation_datasets(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>
Pass arguments to list_conversation_datasets 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 project and location name to list all conversation datasets for. Format: projects/<Project ID>/locations/<Location ID>
  • page_size (::Integer) — Optional. Maximum number of conversation datasets to return in a single page. By default 100 and at most 1000.
  • page_token (::String) — Optional. 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/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.new

# Call the list_conversation_datasets method.
result = client.list_conversation_datasets 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::V2::ConversationDataset.
  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)

#operations_client

def operations_client() -> ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Operations

Get the associated client for long-running operations.