Class: Google::Apis::DialogflowV2::GoogleCloudDialogflowV2Context

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/dialogflow_v2/classes.rb,
generated/google/apis/dialogflow_v2/representations.rb,
generated/google/apis/dialogflow_v2/representations.rb

Overview

Represents a context.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ GoogleCloudDialogflowV2Context

Returns a new instance of GoogleCloudDialogflowV2Context.



482
483
484
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 482

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#lifespan_countFixnum

Optional. The number of conversational query requests after which the context expires. If set to 0 (the default) the context expires immediately. Contexts expire automatically after 20 minutes if there are no matching queries. Corresponds to the JSON property lifespanCount

Returns:

  • (Fixnum)


459
460
461
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 459

def lifespan_count
  @lifespan_count
end

#nameString

Required. The unique identifier of the context. Format: projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>. The Context ID is always converted to lowercase, may only contain characters in [a-zA-Z0-9_-%] and may be at most 250 bytes long. The following context names are reserved for internal use by Dialogflow. You should not use these contexts or create contexts with these names:

  • __system_counters__
  • *_id_dialog_context
  • *_dialog_params_size Corresponds to the JSON property name

Returns:

  • (String)


472
473
474
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 472

def name
  @name
end

#parametersHash<String,Object>

Optional. The collection of parameters associated with this context. Refer to this doc for syntax. Corresponds to the JSON property parameters

Returns:

  • (Hash<String,Object>)


480
481
482
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 480

def parameters
  @parameters
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



487
488
489
490
491
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 487

def update!(**args)
  @lifespan_count = args[:lifespan_count] if args.key?(:lifespan_count)
  @name = args[:name] if args.key?(:name)
  @parameters = args[:parameters] if args.key?(:parameters)
end