Class: Twilio::REST::Assistants::V1::AssistantContext::MessageList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Assistants::V1::AssistantContext::MessageList
- Defined in:
- lib/twilio-ruby/rest/assistants/v1/assistant/message.rb
Defined Under Namespace
Classes: AssistantsV1ServiceAssistantSendMessageRequest
Instance Method Summary collapse
-
#create(assistants_v1_service_assistant_send_message_request: nil) ⇒ MessageInstance
Create the MessageInstance.
-
#initialize(version, id: nil) ⇒ MessageList
constructor
Initialize the MessageList.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, id: nil) ⇒ MessageList
Initialize the MessageList
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
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: .to_json) MessageInstance.new( @version, payload, id: @solution[:id], ) end |
#to_s ⇒ Object
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 |