Dialogflow V2 API - Class Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client (v0.33.0)

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

REST client for the SessionEntityTypes service.

Service for managing SessionEntityTypes.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the SessionEntityTypes 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_session_entity_type

def create_session_entity_type(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::SessionEntityType
def create_session_entity_type(parent: nil, session_entity_type: nil) -> ::Google::Cloud::Dialogflow::V2::SessionEntityType

Creates a session entity type.

If the specified session entity type already exists, overrides the session entity type.

This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

Overloads
def create_session_entity_type(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::SessionEntityType
Pass arguments to create_session_entity_type via a request object, either of type CreateSessionEntityTypeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest, ::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_session_entity_type(parent: nil, session_entity_type: nil) -> ::Google::Cloud::Dialogflow::V2::SessionEntityType
Pass arguments to create_session_entity_type 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 session to create a session entity type for. Format: projects/<Project ID>/agent/sessions/<Session ID> or projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>. If Environment ID is not specified, we assume default 'draft' environment. If User ID is not specified, we assume default '-' user.
  • session_entity_type (::Google::Cloud::Dialogflow::V2::SessionEntityType, ::Hash) — Required. The session entity type to create.
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::SessionEntityTypes::Rest::Client.new

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

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

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

#delete_session_entity_type

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

Deletes the specified session entity type.

This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

Overloads
def delete_session_entity_type(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_session_entity_type via a request object, either of type DeleteSessionEntityTypeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest, ::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_session_entity_type(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_session_entity_type 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 entity type to delete. Format: projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name> or projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>. If Environment ID is not specified, we assume default 'draft' environment. If User ID is not specified, we assume default '-' user.
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::SessionEntityTypes::Rest::Client.new

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

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

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

#get_session_entity_type

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

Retrieves the specified session entity type.

This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

Overloads
def get_session_entity_type(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::SessionEntityType
Pass arguments to get_session_entity_type via a request object, either of type GetSessionEntityTypeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest, ::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_session_entity_type(name: nil) -> ::Google::Cloud::Dialogflow::V2::SessionEntityType
Pass arguments to get_session_entity_type 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 session entity type. Format: projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name> or projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>. If Environment ID is not specified, we assume default 'draft' environment. If User ID is not specified, we assume default '-' user.
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::SessionEntityTypes::Rest::Client.new

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

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

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

#initialize

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

Create a new SessionEntityTypes REST client object.

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

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

#list_session_entity_types

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

Returns the list of all session entity types in the specified session.

This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

Overloads
def list_session_entity_types(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SessionEntityType>
Pass arguments to list_session_entity_types via a request object, either of type ListSessionEntityTypesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest, ::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_session_entity_types(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SessionEntityType>
Pass arguments to list_session_entity_types 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 session to list all session entity types from. Format: projects/<Project ID>/agent/sessions/<Session ID> or projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>. If Environment ID is not specified, we assume default 'draft' environment. If User ID is not specified, we assume default '-' user.
  • page_size (::Integer) — Optional. The maximum number of items 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::SessionEntityTypes::Rest::Client.new

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

# Call the list_session_entity_types method.
result = client.list_session_entity_types 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::SessionEntityType.
  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)

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_session_entity_type

def update_session_entity_type(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::SessionEntityType
def update_session_entity_type(session_entity_type: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::V2::SessionEntityType

Updates the specified session entity type.

This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

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

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

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

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

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