Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.
REST client for the Contexts service.
Service for managing Contexts.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the Contexts Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all Contexts clients ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the Contexts 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_context
def create_context(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::Context
def create_context(parent: nil, context: nil) -> ::Google::Cloud::Dialogflow::V2::Context
Creates a context.
If the specified context already exists, overrides the context.
def create_context(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::Context
create_context
via a request object, either of type
Google::Cloud::Dialogflow::V2::CreateContextRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::CreateContextRequest, ::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_context(parent: nil, context: nil) -> ::Google::Cloud::Dialogflow::V2::Context
create_context
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).
-
parent (::String) — Required. The session to create a context for.
Format:
projects/<Project ID>/agent/sessions/<Session ID>
orprojects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>
. IfEnvironment ID
is not specified, we assume default 'draft' environment. IfUser ID
is not specified, we assume default '-' user. - context (::Google::Cloud::Dialogflow::V2::Context, ::Hash) — Required. The context to create.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::V2::Context)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#delete_all_contexts
def delete_all_contexts(request, options = nil) -> ::Google::Protobuf::Empty
def delete_all_contexts(parent: nil) -> ::Google::Protobuf::Empty
Deletes all active contexts in the specified session.
def delete_all_contexts(request, options = nil) -> ::Google::Protobuf::Empty
delete_all_contexts
via a request object, either of type
DeleteAllContextsRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest, ::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_all_contexts(parent: nil) -> ::Google::Protobuf::Empty
delete_all_contexts
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).
-
parent (::String) — Required. The name of the session to delete all contexts from. Format:
projects/<Project ID>/agent/sessions/<Session ID>
orprojects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>
. IfEnvironment ID
is not specified we assume default 'draft' environment. IfUser ID
is not specified, we assume default '-' user.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#delete_context
def delete_context(request, options = nil) -> ::Google::Protobuf::Empty
def delete_context(name: nil) -> ::Google::Protobuf::Empty
Deletes the specified context.
def delete_context(request, options = nil) -> ::Google::Protobuf::Empty
delete_context
via a request object, either of type
DeleteContextRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::DeleteContextRequest, ::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_context(name: nil) -> ::Google::Protobuf::Empty
delete_context
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).
-
name (::String) — Required. The name of the context to delete. Format:
projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>
orprojects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>
. IfEnvironment ID
is not specified, we assume default 'draft' environment. IfUser ID
is not specified, we assume default '-' user.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#get_context
def get_context(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::Context
def get_context(name: nil) -> ::Google::Cloud::Dialogflow::V2::Context
Retrieves the specified context.
def get_context(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::Context
get_context
via a request object, either of type
GetContextRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::GetContextRequest, ::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_context(name: nil) -> ::Google::Cloud::Dialogflow::V2::Context
get_context
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).
-
name (::String) — Required. The name of the context. Format:
projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>
orprojects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/contexts/<Context ID>
. IfEnvironment ID
is not specified, we assume default 'draft' environment. IfUser ID
is not specified, we assume default '-' user.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::V2::Context)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#initialize
def initialize() { |config| ... } -> Client
Create a new Contexts REST client object.
- (config) — Configure the Contexts client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| config.timeout = 10.0 end
#list_contexts
def list_contexts(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>
def list_contexts(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>
Returns the list of all contexts in the specified session.
def list_contexts(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>
list_contexts
via a request object, either of type
ListContextsRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::ListContextsRequest, ::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_contexts(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>
list_contexts
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).
-
parent (::String) — Required. The session to list all contexts from.
Format:
projects/<Project ID>/agent/sessions/<Session ID>
orprojects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>
. IfEnvironment ID
is not specified, we assume default 'draft' environment. IfUser 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.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>)
- (::Google::Cloud::Error) — if the REST call is aborted.
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::Client
Get the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#update_context
def update_context(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::Context
def update_context(context: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::V2::Context
Updates the specified context.
def update_context(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::Context
update_context
via a request object, either of type
UpdateContextRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::UpdateContextRequest, ::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_context(context: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::V2::Context
update_context
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).
- context (::Google::Cloud::Dialogflow::V2::Context, ::Hash) — Required. The context to update.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. The mask to control which fields get updated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::V2::Context)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.