Dialogflow V2 API - Class Google::Cloud::Dialogflow::V2::ConversationProfiles::Client (v0.21.0)

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

Client for the ConversationProfiles service.

Service for managing ConversationProfiles.

Inherits

  • Object

Methods

.configure

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

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

#clear_suggestion_feature_config

def clear_suggestion_feature_config(request, options = nil) -> ::Gapic::Operation
def clear_suggestion_feature_config(conversation_profile: nil, participant_role: nil, suggestion_feature_type: nil) -> ::Gapic::Operation

Clears a suggestion feature from a conversation profile for the given participant role.

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

Overloads
def clear_suggestion_feature_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to clear_suggestion_feature_config via a request object, either of type Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest, ::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 clear_suggestion_feature_config(conversation_profile: nil, participant_role: nil, suggestion_feature_type: nil) -> ::Gapic::Operation
Pass arguments to clear_suggestion_feature_config 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
  • conversation_profile (::String) — Required. The Conversation Profile to add or update the suggestion feature config. Format: projects/<Project ID>/locations/<Location ID>/conversationProfiles/<Conversation Profile ID>.
  • participant_role (::Google::Cloud::Dialogflow::V2::Participant::Role) — Required. The participant role to remove the suggestion feature config. Only HUMAN_AGENT or END_USER can be used.
  • suggestion_feature_type (::Google::Cloud::Dialogflow::V2::SuggestionFeature::Type) — Required. The type of the suggestion feature to remove.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC 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::ConversationProfiles::Client.new

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

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

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

#configure

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

Configure the ConversationProfiles 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_profile

def create_conversation_profile(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::ConversationProfile
def create_conversation_profile(parent: nil, conversation_profile: nil) -> ::Google::Cloud::Dialogflow::V2::ConversationProfile

Creates a conversation profile in the specified project.

[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via GetConversationProfile API.

Overloads
def create_conversation_profile(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::ConversationProfile
Pass arguments to create_conversation_profile via a request object, either of type Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest, ::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_profile(parent: nil, conversation_profile: nil) -> ::Google::Cloud::Dialogflow::V2::ConversationProfile
Pass arguments to create_conversation_profile 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 a conversation profile for. Format: projects/<Project ID>/locations/<Location ID>.
  • conversation_profile (::Google::Cloud::Dialogflow::V2::ConversationProfile, ::Hash) — Required. The conversation profile to create.
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/v2"

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

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

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

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

#delete_conversation_profile

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

Deletes the specified conversation profile.

Overloads
def delete_conversation_profile(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_conversation_profile via a request object, either of type DeleteConversationProfileRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest, ::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_profile(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_conversation_profile 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 name of the conversation profile to delete. Format: projects/<Project ID>/locations/<Location ID>/conversationProfiles/<Conversation Profile ID>.
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/v2"

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

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

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

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

#get_conversation_profile

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

Retrieves the specified conversation profile.

Overloads
def get_conversation_profile(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::ConversationProfile
Pass arguments to get_conversation_profile via a request object, either of type GetConversationProfileRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest, ::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_profile(name: nil) -> ::Google::Cloud::Dialogflow::V2::ConversationProfile
Pass arguments to get_conversation_profile 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 resource name of the conversation profile. Format: projects/<Project ID>/locations/<Location ID>/conversationProfiles/<Conversation Profile ID>.
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/v2"

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

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

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

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

#initialize

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

Create a new ConversationProfiles client object.

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

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

#list_conversation_profiles

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

Returns the list of all conversation profiles in the specified project.

Overloads
def list_conversation_profiles(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationProfile>
Pass arguments to list_conversation_profiles via a request object, either of type ListConversationProfilesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest, ::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_profiles(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationProfile>
Pass arguments to list_conversation_profiles 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 list all conversation profiles from. Format: projects/<Project ID>/locations/<Location 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.
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/v2"

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

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

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

#operations_client

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

Get the associated client for long-running operations.

#set_suggestion_feature_config

def set_suggestion_feature_config(request, options = nil) -> ::Gapic::Operation
def set_suggestion_feature_config(conversation_profile: nil, participant_role: nil, suggestion_feature_config: nil) -> ::Gapic::Operation

Adds or updates a suggestion feature in a conversation profile. If the conversation profile contains the type of suggestion feature for the participant role, it will update it. Otherwise it will insert the suggestion feature.

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

If a long running operation to add or update suggestion feature config for the same conversation profile, participant role and suggestion feature type exists, please cancel the existing long running operation before sending such request, otherwise the request will be rejected.

Overloads
def set_suggestion_feature_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to set_suggestion_feature_config via a request object, either of type SetSuggestionFeatureConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest, ::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 set_suggestion_feature_config(conversation_profile: nil, participant_role: nil, suggestion_feature_config: nil) -> ::Gapic::Operation
Pass arguments to set_suggestion_feature_config 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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC 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::ConversationProfiles::Client.new

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

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

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

#update_conversation_profile

def update_conversation_profile(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::ConversationProfile
def update_conversation_profile(conversation_profile: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::V2::ConversationProfile

Updates the specified conversation profile.

[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via GetConversationProfile API.

Overloads
def update_conversation_profile(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::ConversationProfile
Pass arguments to update_conversation_profile via a request object, either of type UpdateConversationProfileRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest, ::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_conversation_profile(conversation_profile: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::V2::ConversationProfile
Pass arguments to update_conversation_profile 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
  • (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/v2"

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

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

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

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