Class: Twilio::REST::Conversations::V2::CommunicationList::CreateCommunicationInConversationRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ CreateCommunicationInConversationRequest

Returns a new instance of CreateCommunicationInConversationRequest.



90
91
92
93
94
95
96
97
# File 'lib/twilio-ruby/rest/conversations/v2/communication.rb', line 90

def initialize(payload)
        @author = payload["author"]
        @content = payload["content"]
        @channel_id = payload["channel_id"]
        @resource_id = payload["resource_id"]
        @recipients = payload["recipients"]
        @occurred_at = payload["occurred_at"]
end

Instance Attribute Details

#author ⇒ Object

Parameters:

  • : (author) —

    [CommunicationList.CreateCommunicationInConversationRequestAuthor]

  • : (content) —

    [CommunicationList.CreateCommunicationInConversationRequestContent]

  • : (channel_id) —

    [String]

  • : (resource_id) —

    [String] External resource identifier for this Communication (e.g. MessageSid for SMS/RCS/WhatsApp, TranscriptionSid + MessageIndex for Voice). If a Communication with the same resourceId already exists in the Conversation, it is updated instead of a new one being created.

  • : (recipients) —

    [Array<CommunicationList.CreateCommunicationInConversationRequestRecipients>]

  • : (occurred_at) —

    [Time] Timestamp when this Communication occurred. If omitted, the server uses the current time.



89
90
91
# File 'lib/twilio-ruby/rest/conversations/v2/communication.rb', line 89

def author
  @author
end

#channel_id ⇒ Object

Parameters:

  • : (author) —

    [CommunicationList.CreateCommunicationInConversationRequestAuthor]

  • : (content) —

    [CommunicationList.CreateCommunicationInConversationRequestContent]

  • : (channel_id) —

    [String]

  • : (resource_id) —

    [String] External resource identifier for this Communication (e.g. MessageSid for SMS/RCS/WhatsApp, TranscriptionSid + MessageIndex for Voice). If a Communication with the same resourceId already exists in the Conversation, it is updated instead of a new one being created.

  • : (recipients) —

    [Array<CommunicationList.CreateCommunicationInConversationRequestRecipients>]

  • : (occurred_at) —

    [Time] Timestamp when this Communication occurred. If omitted, the server uses the current time.



89
90
91
# File 'lib/twilio-ruby/rest/conversations/v2/communication.rb', line 89

def channel_id
  @channel_id
end

#content ⇒ Object

Parameters:

  • : (author) —

    [CommunicationList.CreateCommunicationInConversationRequestAuthor]

  • : (content) —

    [CommunicationList.CreateCommunicationInConversationRequestContent]

  • : (channel_id) —

    [String]

  • : (resource_id) —

    [String] External resource identifier for this Communication (e.g. MessageSid for SMS/RCS/WhatsApp, TranscriptionSid + MessageIndex for Voice). If a Communication with the same resourceId already exists in the Conversation, it is updated instead of a new one being created.

  • : (recipients) —

    [Array<CommunicationList.CreateCommunicationInConversationRequestRecipients>]

  • : (occurred_at) —

    [Time] Timestamp when this Communication occurred. If omitted, the server uses the current time.



89
90
91
# File 'lib/twilio-ruby/rest/conversations/v2/communication.rb', line 89

def content
  @content
end

#occurred_at ⇒ Object

Parameters:

  • : (author) —

    [CommunicationList.CreateCommunicationInConversationRequestAuthor]

  • : (content) —

    [CommunicationList.CreateCommunicationInConversationRequestContent]

  • : (channel_id) —

    [String]

  • : (resource_id) —

    [String] External resource identifier for this Communication (e.g. MessageSid for SMS/RCS/WhatsApp, TranscriptionSid + MessageIndex for Voice). If a Communication with the same resourceId already exists in the Conversation, it is updated instead of a new one being created.

  • : (recipients) —

    [Array<CommunicationList.CreateCommunicationInConversationRequestRecipients>]

  • : (occurred_at) —

    [Time] Timestamp when this Communication occurred. If omitted, the server uses the current time.



89
90
91
# File 'lib/twilio-ruby/rest/conversations/v2/communication.rb', line 89

def occurred_at
  @occurred_at
end

#recipients ⇒ Object

Parameters:

  • : (author) —

    [CommunicationList.CreateCommunicationInConversationRequestAuthor]

  • : (content) —

    [CommunicationList.CreateCommunicationInConversationRequestContent]

  • : (channel_id) —

    [String]

  • : (resource_id) —

    [String] External resource identifier for this Communication (e.g. MessageSid for SMS/RCS/WhatsApp, TranscriptionSid + MessageIndex for Voice). If a Communication with the same resourceId already exists in the Conversation, it is updated instead of a new one being created.

  • : (recipients) —

    [Array<CommunicationList.CreateCommunicationInConversationRequestRecipients>]

  • : (occurred_at) —

    [Time] Timestamp when this Communication occurred. If omitted, the server uses the current time.



89
90
91
# File 'lib/twilio-ruby/rest/conversations/v2/communication.rb', line 89

def recipients
  @recipients
end

#resource_id ⇒ Object

Parameters:

  • : (author) —

    [CommunicationList.CreateCommunicationInConversationRequestAuthor]

  • : (content) —

    [CommunicationList.CreateCommunicationInConversationRequestContent]

  • : (channel_id) —

    [String]

  • : (resource_id) —

    [String] External resource identifier for this Communication (e.g. MessageSid for SMS/RCS/WhatsApp, TranscriptionSid + MessageIndex for Voice). If a Communication with the same resourceId already exists in the Conversation, it is updated instead of a new one being created.

  • : (recipients) —

    [Array<CommunicationList.CreateCommunicationInConversationRequestRecipients>]

  • : (occurred_at) —

    [Time] Timestamp when this Communication occurred. If omitted, the server uses the current time.



89
90
91
# File 'lib/twilio-ruby/rest/conversations/v2/communication.rb', line 89

def resource_id
  @resource_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



98
99
100
101
102
103
104
105
106
107
# File 'lib/twilio-ruby/rest/conversations/v2/communication.rb', line 98

def to_json(options = {})
{
        "author": @author,
        "content": @content,
        "channelId": @channel_id,
        "resourceId": @resource_id,
        "recipients": @recipients,
        "occurredAt": @occurred_at,
}.to_json(options)
end