Class: Twilio::REST::Conversations::V2::ActionList::ConversationsV2SendMessageContent

Inherits:
Object
  • Object
show all
Defined in:
lib/twilio-ruby/rest/conversations/v2/action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ ConversationsV2SendMessageContent

Returns a new instance of ConversationsV2SendMessageContent.



28
29
30
31
32
33
# File 'lib/twilio-ruby/rest/conversations/v2/action.rb', line 28

def initialize(payload)
        @text = payload["text"]
        @content_id = payload["content_id"]
        @variables = payload["variables"]
        @media_urls = payload["media_urls"]
end

Instance Attribute Details

#content_idObject

Parameters:

  • : (text)
    String

    Plain text message body.

  • : (content_id)
    String

    Content template ID (HX… format). When provided, the template is rendered with the variables map and sent to the recipient.

  • : (variables)
    Hash<String, String>

    Variables to substitute into the content template.

  • : (media_urls)
    Array<String>

    URLs of media attachments to include with the message.



27
28
29
# File 'lib/twilio-ruby/rest/conversations/v2/action.rb', line 27

def content_id
  @content_id
end

#media_urlsObject

Parameters:

  • : (text)
    String

    Plain text message body.

  • : (content_id)
    String

    Content template ID (HX… format). When provided, the template is rendered with the variables map and sent to the recipient.

  • : (variables)
    Hash<String, String>

    Variables to substitute into the content template.

  • : (media_urls)
    Array<String>

    URLs of media attachments to include with the message.



27
28
29
# File 'lib/twilio-ruby/rest/conversations/v2/action.rb', line 27

def media_urls
  @media_urls
end

#textObject

Parameters:

  • : (text)
    String

    Plain text message body.

  • : (content_id)
    String

    Content template ID (HX… format). When provided, the template is rendered with the variables map and sent to the recipient.

  • : (variables)
    Hash<String, String>

    Variables to substitute into the content template.

  • : (media_urls)
    Array<String>

    URLs of media attachments to include with the message.



27
28
29
# File 'lib/twilio-ruby/rest/conversations/v2/action.rb', line 27

def text
  @text
end

#variablesObject

Parameters:

  • : (text)
    String

    Plain text message body.

  • : (content_id)
    String

    Content template ID (HX… format). When provided, the template is rendered with the variables map and sent to the recipient.

  • : (variables)
    Hash<String, String>

    Variables to substitute into the content template.

  • : (media_urls)
    Array<String>

    URLs of media attachments to include with the message.



27
28
29
# File 'lib/twilio-ruby/rest/conversations/v2/action.rb', line 27

def variables
  @variables
end

Instance Method Details

#to_json(options = {}) ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/twilio-ruby/rest/conversations/v2/action.rb', line 34

def to_json(options = {})
{
        "text": @text,
        "contentId": @content_id,
        "variables": @variables,
        "mediaUrls": @media_urls,
}.to_json(options)
end