Class: Twilio::REST::Assistants::V1::AssistantContext::MessageList::AssistantsV1ServiceAssistantSendMessageRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/twilio-ruby/rest/assistants/v1/assistant/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ AssistantsV1ServiceAssistantSendMessageRequest

Returns a new instance of AssistantsV1ServiceAssistantSendMessageRequest.



31
32
33
34
35
36
37
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 31

def initialize(payload)
        @identity = payload["identity"]
        @session_id = payload["session_id"]
        @body = payload["body"]
        @webhook = payload["webhook"]
        @mode = payload["mode"]
end

Instance Attribute Details

#bodyObject

Parameters:

  • : (identity)
    String

    The unique identity of user for the session.

  • : (session_id)
    String

    The unique name for the session.

  • : (body)
    String

    The query to ask the assistant.

  • : (webhook)
    String

    The webhook url to call after the assistant has generated a response or report an error.

  • : (mode)
    String

    one of the modes ‘chat’, ‘email’ or ‘voice’



30
31
32
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 30

def body
  @body
end

#identityObject

Parameters:

  • : (identity)
    String

    The unique identity of user for the session.

  • : (session_id)
    String

    The unique name for the session.

  • : (body)
    String

    The query to ask the assistant.

  • : (webhook)
    String

    The webhook url to call after the assistant has generated a response or report an error.

  • : (mode)
    String

    one of the modes ‘chat’, ‘email’ or ‘voice’



30
31
32
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 30

def identity
  @identity
end

#modeObject

Parameters:

  • : (identity)
    String

    The unique identity of user for the session.

  • : (session_id)
    String

    The unique name for the session.

  • : (body)
    String

    The query to ask the assistant.

  • : (webhook)
    String

    The webhook url to call after the assistant has generated a response or report an error.

  • : (mode)
    String

    one of the modes ‘chat’, ‘email’ or ‘voice’



30
31
32
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 30

def mode
  @mode
end

#session_idObject

Parameters:

  • : (identity)
    String

    The unique identity of user for the session.

  • : (session_id)
    String

    The unique name for the session.

  • : (body)
    String

    The query to ask the assistant.

  • : (webhook)
    String

    The webhook url to call after the assistant has generated a response or report an error.

  • : (mode)
    String

    one of the modes ‘chat’, ‘email’ or ‘voice’



30
31
32
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 30

def session_id
  @session_id
end

#webhookObject

Parameters:

  • : (identity)
    String

    The unique identity of user for the session.

  • : (session_id)
    String

    The unique name for the session.

  • : (body)
    String

    The query to ask the assistant.

  • : (webhook)
    String

    The webhook url to call after the assistant has generated a response or report an error.

  • : (mode)
    String

    one of the modes ‘chat’, ‘email’ or ‘voice’



30
31
32
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 30

def webhook
  @webhook
end

Instance Method Details

#to_json(options = {}) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 38

def to_json(options = {})
{
        "identity": @identity,
        "session_id": @session_id,
        "body": @body,
        "webhook": @webhook,
        "mode": @mode,
}.to_json(options)
end