Class: Sentdm::Models::ConversationMessagesList::Message

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/sentdm/models/conversation_messages_list.rb,
sig/sentdm/models/conversation_messages_list.rbs

Defined Under Namespace

Classes: Event, MessageBody

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(status:, timestamp:, description: nil) ⇒ Object

Represents a status change event in a message's lifecycle (v3)

Parameters:

  • status (String)
  • timestamp (Time)
  • description (String, nil) (defaults to: nil)


25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/sentdm/models/conversation_messages_list.rb', line 25

class Message < Sentdm::Internal::Type::BaseModel
  # @!attribute id
  #
  #   @return [String, nil]
  optional :id, String

  # @!attribute active_contact_price
  #
  #   @return [Float, nil]
  optional :active_contact_price, Float, nil?: true

  # @!attribute channel
  #
  #   @return [String, nil]
  optional :channel, String

  # @!attribute contact_id
  #
  #   @return [String, nil]
  optional :contact_id, String

  # @!attribute created_at
  #
  #   @return [Time, nil]
  optional :created_at, Time

  # @!attribute customer_id
  #
  #   @return [String, nil]
  optional :customer_id, String

  # @!attribute direction
  #
  #   @return [String, nil]
  optional :direction, String

  # @!attribute events
  #
  #   @return [Array<Sentdm::Models::ConversationMessagesList::Message::Event>, nil]
  optional :events,
           -> { Sentdm::Internal::Type::ArrayOf[Sentdm::ConversationMessagesList::Message::Event] },
           nil?: true

  # @!attribute message_body
  #   Structured message body format for database storage. Preserves channel-specific
  #   components (header, body, footer, buttons).
  #
  #   @return [Sentdm::Models::ConversationMessagesList::Message::MessageBody, nil]
  optional :message_body, -> { Sentdm::ConversationMessagesList::Message::MessageBody }, nil?: true

  # @!attribute phone
  #
  #   @return [String, nil]
  optional :phone, String

  # @!attribute phone_international
  #
  #   @return [String, nil]
  optional :phone_international, String

  # @!attribute price
  #
  #   @return [Float, nil]
  optional :price, Float, nil?: true

  # @!attribute region_code
  #
  #   @return [String, nil]
  optional :region_code, String

  # @!attribute status
  #
  #   @return [String, nil]
  optional :status, String

  # @!attribute template_category
  #
  #   @return [String, nil]
  optional :template_category, String, nil?: true

  # @!attribute template_id
  #
  #   @return [String, nil]
  optional :template_id, String, nil?: true

  # @!attribute template_name
  #
  #   @return [String, nil]
  optional :template_name, String, nil?: true

  # @!method initialize(id: nil, active_contact_price: nil, channel: nil, contact_id: nil, created_at: nil, customer_id: nil, direction: nil, events: nil, message_body: nil, phone: nil, phone_international: nil, price: nil, region_code: nil, status: nil, template_category: nil, template_id: nil, template_name: nil)
  #   Some parameter documentations has been truncated, see
  #   {Sentdm::Models::ConversationMessagesList::Message} for more details.
  #
  #   Message response for v3 API — same shape as v2 with snake_case JSON conventions
  #
  #   @param id [String]
  #
  #   @param active_contact_price [Float, nil]
  #
  #   @param channel [String]
  #
  #   @param contact_id [String]
  #
  #   @param created_at [Time]
  #
  #   @param customer_id [String]
  #
  #   @param direction [String]
  #
  #   @param events [Array<Sentdm::Models::ConversationMessagesList::Message::Event>, nil]
  #
  #   @param message_body [Sentdm::Models::ConversationMessagesList::Message::MessageBody, nil] Structured message body format for database storage.
  #
  #   @param phone [String]
  #
  #   @param phone_international [String]
  #
  #   @param price [Float, nil]
  #
  #   @param region_code [String]
  #
  #   @param status [String]
  #
  #   @param template_category [String, nil]
  #
  #   @param template_id [String, nil]
  #
  #   @param template_name [String, nil]

  class Event < Sentdm::Internal::Type::BaseModel
    # @!attribute status
    #
    #   @return [String]
    required :status, String

    # @!attribute timestamp
    #
    #   @return [Time]
    required :timestamp, Time

    # @!attribute description
    #
    #   @return [String, nil]
    optional :description, String, nil?: true

    # @!method initialize(status:, timestamp:, description: nil)
    #   Represents a status change event in a message's lifecycle (v3)
    #
    #   @param status [String]
    #   @param timestamp [Time]
    #   @param description [String, nil]
  end

  # @see Sentdm::Models::ConversationMessagesList::Message#message_body
  class MessageBody < Sentdm::Internal::Type::BaseModel
    # @!attribute buttons
    #
    #   @return [Array<Sentdm::Models::ConversationMessagesList::Message::MessageBody::Button>, nil]
    optional :buttons,
             -> {
               Sentdm::Internal::Type::ArrayOf[Sentdm::ConversationMessagesList::Message::MessageBody::Button]
             },
             nil?: true

    # @!attribute content
    #
    #   @return [String, nil]
    optional :content, String

    # @!attribute footer
    #
    #   @return [String, nil]
    optional :footer, String, nil?: true

    # @!attribute header
    #
    #   @return [String, nil]
    optional :header, String, nil?: true

    # @!method initialize(buttons: nil, content: nil, footer: nil, header: nil)
    #   Structured message body format for database storage. Preserves channel-specific
    #   components (header, body, footer, buttons).
    #
    #   @param buttons [Array<Sentdm::Models::ConversationMessagesList::Message::MessageBody::Button>, nil]
    #   @param content [String]
    #   @param footer [String, nil]
    #   @param header [String, nil]

    class Button < Sentdm::Internal::Type::BaseModel
      # @!attribute postback_data
      #
      #   @return [String, nil]
      optional :postback_data, String, api_name: :postbackData, nil?: true

      # @!attribute text
      #
      #   @return [String, nil]
      optional :text, String, nil?: true

      # @!attribute type
      #
      #   @return [String, nil]
      optional :type, String

      # @!attribute value
      #
      #   @return [String, nil]
      optional :value, String

      # @!method initialize(postback_data: nil, text: nil, type: nil, value: nil)
      #   @param postback_data [String, nil]
      #   @param text [String, nil]
      #   @param type [String]
      #   @param value [String]
    end
  end
end

Instance Attribute Details

#active_contact_priceFloat?

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


34
# File 'lib/sentdm/models/conversation_messages_list.rb', line 34

optional :active_contact_price, Float, nil?: true

#channelString?

Parameters:

  • (String)

Returns:

  • (String, nil)


39
# File 'lib/sentdm/models/conversation_messages_list.rb', line 39

optional :channel, String

#contact_idString?

Parameters:

  • (String)

Returns:

  • (String, nil)


44
# File 'lib/sentdm/models/conversation_messages_list.rb', line 44

optional :contact_id, String

#created_atTime?

Parameters:

  • (Time)

Returns:

  • (Time, nil)


49
# File 'lib/sentdm/models/conversation_messages_list.rb', line 49

optional :created_at, Time

#customer_idString?

Parameters:

  • (String)

Returns:

  • (String, nil)


54
# File 'lib/sentdm/models/conversation_messages_list.rb', line 54

optional :customer_id, String

#directionString?

Parameters:

  • (String)

Returns:

  • (String, nil)


59
# File 'lib/sentdm/models/conversation_messages_list.rb', line 59

optional :direction, String

#eventsArray<Sentdm::Models::ConversationMessagesList::Message::Event>?

Parameters:

  • value (::Array[Sentdm::ConversationMessagesList::Message::Event], nil)

Returns:



64
65
66
# File 'lib/sentdm/models/conversation_messages_list.rb', line 64

optional :events,
-> { Sentdm::Internal::Type::ArrayOf[Sentdm::ConversationMessagesList::Message::Event] },
nil?: true

#idString?

Parameters:

  • (String)

Returns:

  • (String, nil)


29
# File 'lib/sentdm/models/conversation_messages_list.rb', line 29

optional :id, String

#message_bodySentdm::Models::ConversationMessagesList::Message::MessageBody?

Structured message body format for database storage. Preserves channel-specific components (header, body, footer, buttons).

Parameters:

  • value (Sentdm::ConversationMessagesList::Message::MessageBody, nil)

Returns:



73
# File 'lib/sentdm/models/conversation_messages_list.rb', line 73

optional :message_body, -> { Sentdm::ConversationMessagesList::Message::MessageBody }, nil?: true

#phoneString?

Parameters:

  • (String)

Returns:

  • (String, nil)


78
# File 'lib/sentdm/models/conversation_messages_list.rb', line 78

optional :phone, String

#phone_internationalString?

Parameters:

  • (String)

Returns:

  • (String, nil)


83
# File 'lib/sentdm/models/conversation_messages_list.rb', line 83

optional :phone_international, String

#priceFloat?

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


88
# File 'lib/sentdm/models/conversation_messages_list.rb', line 88

optional :price, Float, nil?: true

#region_codeString?

Parameters:

  • (String)

Returns:

  • (String, nil)


93
# File 'lib/sentdm/models/conversation_messages_list.rb', line 93

optional :region_code, String

#statusString?

Parameters:

  • (String)

Returns:

  • (String, nil)


98
# File 'lib/sentdm/models/conversation_messages_list.rb', line 98

optional :status, String

#template_categoryString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


103
# File 'lib/sentdm/models/conversation_messages_list.rb', line 103

optional :template_category, String, nil?: true

#template_idString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


108
# File 'lib/sentdm/models/conversation_messages_list.rb', line 108

optional :template_id, String, nil?: true

#template_nameString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


113
# File 'lib/sentdm/models/conversation_messages_list.rb', line 113

optional :template_name, String, nil?: true

Instance Method Details

#to_hash{

Returns:

  • ({)


126
# File 'sig/sentdm/models/conversation_messages_list.rbs', line 126

def to_hash: -> {