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

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

Defined Under Namespace

Classes: AssistantsV1ServiceAssistantSendMessageRequest

Instance Method Summary collapse

Constructor Details

#initialize(version, id: nil) ⇒ MessageList

Initialize the MessageList

Parameters:

  • version (Version)

    Version that contains the resource



54
55
56
57
58
59
60
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 54

def initialize(version, id: nil)
    super(version)
    # Path Solution
    @solution = { id: id }
    @uri = "/Assistants/#{@solution[:id]}/Messages"
    
end

Instance Method Details

#create(assistants_v1_service_assistant_send_message_request: nil) ⇒ MessageInstance

Create the MessageInstance

Parameters:

Returns:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 65

def create(assistants_v1_service_assistant_send_message_request: nil
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    headers['Content-Type'] = 'application/json'
    
    
    
    
    payload = @version.create('POST', @uri, headers: headers, data: assistants_v1_service_assistant_send_message_request.to_json)
    MessageInstance.new(
        @version,
        payload,
        id: @solution[:id],
    )
end

#to_sObject

Provide a user friendly representation



86
87
88
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/message.rb', line 86

def to_s
    '#<Twilio.Assistants.V1.MessageList>'
end