Class: Twilio::REST::Assistants::V1::SessionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Assistants::V1::SessionInstance
- Defined in:
- lib/twilio-ruby/rest/assistants/v1/session.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Session resource.
-
#assistant_id ⇒ String
The Assistant ID.
-
#context ⇒ SessionContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the Session was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the Session was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#fetch ⇒ SessionInstance
Fetch the SessionInstance.
-
#id ⇒ String
The Session ID.
-
#identity ⇒ String
The unique identity of user for the session.
-
#initialize(version, payload, id: nil) ⇒ SessionInstance
constructor
Initialize the SessionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#messages ⇒ messages
Access the messages.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#verified ⇒ Boolean
True if the session is verified.
Constructor Details
#initialize(version, payload, id: nil) ⇒ SessionInstance
Initialize the SessionInstance
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 230 def initialize(version, payload , id: nil) super(version) # Marshaled Properties @properties = { 'id' => payload['id'], 'account_sid' => payload['account_sid'], 'assistant_id' => payload['assistant_id'], 'verified' => payload['verified'], 'identity' => payload['identity'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), } # Context @instance_context = nil @params = { 'id' => id || @properties['id'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Session resource.
268 269 270 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 268 def account_sid @properties['account_sid'] end |
#assistant_id ⇒ String
Returns The Assistant ID.
274 275 276 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 274 def assistant_id @properties['assistant_id'] end |
#context ⇒ SessionContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
253 254 255 256 257 258 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 253 def context unless @instance_context @instance_context = SessionContext.new(@version , @params['id']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the Session was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
292 293 294 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 292 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the Session was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
298 299 300 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 298 def date_updated @properties['date_updated'] end |
#fetch ⇒ SessionInstance
Fetch the SessionInstance
305 306 307 308 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 305 def fetch context.fetch end |
#id ⇒ String
Returns The Session ID.
262 263 264 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 262 def id @properties['id'] end |
#identity ⇒ String
Returns The unique identity of user for the session.
286 287 288 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 286 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
326 327 328 329 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 326 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Assistants.V1.SessionInstance #{values}>" end |
#messages ⇒ messages
Access the messages
313 314 315 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 313 def context. end |
#to_s ⇒ Object
Provide a user friendly representation
319 320 321 322 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 319 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Assistants.V1.SessionInstance #{values}>" end |
#verified ⇒ Boolean
Returns True if the session is verified.
280 281 282 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 280 def verified @properties['verified'] end |