late-sdk 0.0.86 → 0.0.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/docs/WebhookEventsApi.md +766 -0
- data/docs/WebhookPayloadAccountConnected.md +5 -3
- data/docs/WebhookPayloadAccountConnectedAccount.md +4 -4
- data/docs/WebhookPayloadAccountDisconnected.md +5 -3
- data/docs/WebhookPayloadAccountDisconnectedAccount.md +6 -6
- data/docs/WebhookPayloadComment.md +7 -5
- data/docs/WebhookPayloadCommentAccount.md +3 -3
- data/docs/WebhookPayloadCommentComment.md +9 -9
- data/docs/WebhookPayloadCommentCommentAuthor.md +1 -1
- data/docs/WebhookPayloadCommentPost.md +2 -2
- data/docs/WebhookPayloadMessage.md +7 -5
- data/docs/WebhookPayloadMessageAccount.md +3 -3
- data/docs/WebhookPayloadMessageConversation.md +3 -5
- data/docs/WebhookPayloadMessageMessage.md +10 -10
- data/docs/WebhookPayloadMessageMessageAttachmentsInner.md +2 -2
- data/docs/WebhookPayloadMessageMessageSender.md +1 -1
- data/docs/WebhookPayloadPost.md +5 -3
- data/docs/WebhookPayloadPostPost.md +5 -5
- data/docs/WebhookPayloadPostPostPlatformsInner.md +4 -2
- data/docs/WebhookPayloadTest.md +24 -0
- data/lib/late-sdk/api/webhook_events_api.rb +748 -0
- data/lib/late-sdk/api/webhooks_api.rb +1 -1
- data/lib/late-sdk/models/webhook_log.rb +2 -2
- data/lib/late-sdk/models/webhook_payload_account_connected.rb +69 -1
- data/lib/late-sdk/models/webhook_payload_account_connected_account.rb +68 -0
- data/lib/late-sdk/models/webhook_payload_account_disconnected.rb +69 -1
- data/lib/late-sdk/models/webhook_payload_account_disconnected_account.rb +92 -0
- data/lib/late-sdk/models/webhook_payload_comment.rb +103 -1
- data/lib/late-sdk/models/webhook_payload_comment_account.rb +51 -0
- data/lib/late-sdk/models/webhook_payload_comment_comment.rb +143 -0
- data/lib/late-sdk/models/webhook_payload_comment_comment_author.rb +17 -0
- data/lib/late-sdk/models/webhook_payload_comment_post.rb +34 -0
- data/lib/late-sdk/models/webhook_payload_message.rb +104 -2
- data/lib/late-sdk/models/webhook_payload_message_account.rb +51 -0
- data/lib/late-sdk/models/webhook_payload_message_conversation.rb +39 -20
- data/lib/late-sdk/models/webhook_payload_message_message.rb +154 -4
- data/lib/late-sdk/models/webhook_payload_message_message_attachments_inner.rb +34 -0
- data/lib/late-sdk/models/webhook_payload_message_message_sender.rb +17 -0
- data/lib/late-sdk/models/webhook_payload_post.rb +71 -3
- data/lib/late-sdk/models/webhook_payload_post_post.rb +85 -0
- data/lib/late-sdk/models/webhook_payload_post_post_platforms_inner.rb +44 -1
- data/lib/late-sdk/models/webhook_payload_test.rb +269 -0
- data/lib/late-sdk/version.rb +1 -1
- data/lib/late-sdk.rb +1 -0
- data/openapi.yaml +236 -20
- data/spec/models/create_webhook_settings_request_spec.rb +1 -1
- data/spec/models/update_webhook_settings_request_spec.rb +1 -1
- data/spec/models/webhook_log_spec.rb +1 -1
- data/spec/models/webhook_payload_account_connected_spec.rb +6 -0
- data/spec/models/webhook_payload_account_disconnected_spec.rb +6 -0
- data/spec/models/webhook_payload_comment_spec.rb +6 -0
- data/spec/models/webhook_payload_message_conversation_spec.rb +0 -10
- data/spec/models/webhook_payload_message_message_spec.rb +2 -2
- data/spec/models/webhook_payload_message_spec.rb +6 -0
- data/spec/models/webhook_payload_post_post_platforms_inner_spec.rb +6 -0
- data/spec/models/webhook_payload_post_spec.rb +7 -1
- data/spec/models/webhook_payload_test_spec.rb +58 -0
- data/spec/models/webhook_spec.rb +1 -1
- data/zernio-sdk-0.0.87.gem +0 -0
- metadata +665 -659
- data/zernio-sdk-0.0.86.gem +0 -0
|
@@ -14,8 +14,11 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Late
|
|
17
|
-
# Webhook payload for message received events
|
|
17
|
+
# Webhook payload for message received events
|
|
18
18
|
class WebhookPayloadMessage < ApiModelBase
|
|
19
|
+
# Stable webhook event ID
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
19
22
|
attr_accessor :event
|
|
20
23
|
|
|
21
24
|
attr_accessor :message
|
|
@@ -53,6 +56,7 @@ module Late
|
|
|
53
56
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
54
57
|
def self.attribute_map
|
|
55
58
|
{
|
|
59
|
+
:'id' => :'id',
|
|
56
60
|
:'event' => :'event',
|
|
57
61
|
:'message' => :'message',
|
|
58
62
|
:'conversation' => :'conversation',
|
|
@@ -75,6 +79,7 @@ module Late
|
|
|
75
79
|
# Attribute type mapping.
|
|
76
80
|
def self.openapi_types
|
|
77
81
|
{
|
|
82
|
+
:'id' => :'String',
|
|
78
83
|
:'event' => :'String',
|
|
79
84
|
:'message' => :'WebhookPayloadMessageMessage',
|
|
80
85
|
:'conversation' => :'WebhookPayloadMessageConversation',
|
|
@@ -106,20 +111,34 @@ module Late
|
|
|
106
111
|
h[k.to_sym] = v
|
|
107
112
|
}
|
|
108
113
|
|
|
114
|
+
if attributes.key?(:'id')
|
|
115
|
+
self.id = attributes[:'id']
|
|
116
|
+
else
|
|
117
|
+
self.id = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
109
120
|
if attributes.key?(:'event')
|
|
110
121
|
self.event = attributes[:'event']
|
|
122
|
+
else
|
|
123
|
+
self.event = nil
|
|
111
124
|
end
|
|
112
125
|
|
|
113
126
|
if attributes.key?(:'message')
|
|
114
127
|
self.message = attributes[:'message']
|
|
128
|
+
else
|
|
129
|
+
self.message = nil
|
|
115
130
|
end
|
|
116
131
|
|
|
117
132
|
if attributes.key?(:'conversation')
|
|
118
133
|
self.conversation = attributes[:'conversation']
|
|
134
|
+
else
|
|
135
|
+
self.conversation = nil
|
|
119
136
|
end
|
|
120
137
|
|
|
121
138
|
if attributes.key?(:'account')
|
|
122
139
|
self.account = attributes[:'account']
|
|
140
|
+
else
|
|
141
|
+
self.account = nil
|
|
123
142
|
end
|
|
124
143
|
|
|
125
144
|
if attributes.key?(:'metadata')
|
|
@@ -128,6 +147,8 @@ module Late
|
|
|
128
147
|
|
|
129
148
|
if attributes.key?(:'timestamp')
|
|
130
149
|
self.timestamp = attributes[:'timestamp']
|
|
150
|
+
else
|
|
151
|
+
self.timestamp = nil
|
|
131
152
|
end
|
|
132
153
|
end
|
|
133
154
|
|
|
@@ -136,6 +157,30 @@ module Late
|
|
|
136
157
|
def list_invalid_properties
|
|
137
158
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
138
159
|
invalid_properties = Array.new
|
|
160
|
+
if @id.nil?
|
|
161
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if @event.nil?
|
|
165
|
+
invalid_properties.push('invalid value for "event", event cannot be nil.')
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if @message.nil?
|
|
169
|
+
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if @conversation.nil?
|
|
173
|
+
invalid_properties.push('invalid value for "conversation", conversation cannot be nil.')
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if @account.nil?
|
|
177
|
+
invalid_properties.push('invalid value for "account", account cannot be nil.')
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if @timestamp.nil?
|
|
181
|
+
invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
|
|
182
|
+
end
|
|
183
|
+
|
|
139
184
|
invalid_properties
|
|
140
185
|
end
|
|
141
186
|
|
|
@@ -143,11 +188,27 @@ module Late
|
|
|
143
188
|
# @return true if the model is valid
|
|
144
189
|
def valid?
|
|
145
190
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
191
|
+
return false if @id.nil?
|
|
192
|
+
return false if @event.nil?
|
|
146
193
|
event_validator = EnumAttributeValidator.new('String', ["message.received"])
|
|
147
194
|
return false unless event_validator.valid?(@event)
|
|
195
|
+
return false if @message.nil?
|
|
196
|
+
return false if @conversation.nil?
|
|
197
|
+
return false if @account.nil?
|
|
198
|
+
return false if @timestamp.nil?
|
|
148
199
|
true
|
|
149
200
|
end
|
|
150
201
|
|
|
202
|
+
# Custom attribute writer method with validation
|
|
203
|
+
# @param [Object] id Value to be assigned
|
|
204
|
+
def id=(id)
|
|
205
|
+
if id.nil?
|
|
206
|
+
fail ArgumentError, 'id cannot be nil'
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
@id = id
|
|
210
|
+
end
|
|
211
|
+
|
|
151
212
|
# Custom attribute writer method checking allowed values (enum).
|
|
152
213
|
# @param [Object] event Object to be assigned
|
|
153
214
|
def event=(event)
|
|
@@ -158,11 +219,52 @@ module Late
|
|
|
158
219
|
@event = event
|
|
159
220
|
end
|
|
160
221
|
|
|
222
|
+
# Custom attribute writer method with validation
|
|
223
|
+
# @param [Object] message Value to be assigned
|
|
224
|
+
def message=(message)
|
|
225
|
+
if message.nil?
|
|
226
|
+
fail ArgumentError, 'message cannot be nil'
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
@message = message
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Custom attribute writer method with validation
|
|
233
|
+
# @param [Object] conversation Value to be assigned
|
|
234
|
+
def conversation=(conversation)
|
|
235
|
+
if conversation.nil?
|
|
236
|
+
fail ArgumentError, 'conversation cannot be nil'
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
@conversation = conversation
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# Custom attribute writer method with validation
|
|
243
|
+
# @param [Object] account Value to be assigned
|
|
244
|
+
def account=(account)
|
|
245
|
+
if account.nil?
|
|
246
|
+
fail ArgumentError, 'account cannot be nil'
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
@account = account
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Custom attribute writer method with validation
|
|
253
|
+
# @param [Object] timestamp Value to be assigned
|
|
254
|
+
def timestamp=(timestamp)
|
|
255
|
+
if timestamp.nil?
|
|
256
|
+
fail ArgumentError, 'timestamp cannot be nil'
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
@timestamp = timestamp
|
|
260
|
+
end
|
|
261
|
+
|
|
161
262
|
# Checks equality by comparing each attribute.
|
|
162
263
|
# @param [Object] Object to be compared
|
|
163
264
|
def ==(o)
|
|
164
265
|
return true if self.equal?(o)
|
|
165
266
|
self.class == o.class &&
|
|
267
|
+
id == o.id &&
|
|
166
268
|
event == o.event &&
|
|
167
269
|
message == o.message &&
|
|
168
270
|
conversation == o.conversation &&
|
|
@@ -180,7 +282,7 @@ module Late
|
|
|
180
282
|
# Calculates hash code according to all attributes.
|
|
181
283
|
# @return [Integer] Hash code
|
|
182
284
|
def hash
|
|
183
|
-
[event, message, conversation, account, metadata, timestamp].hash
|
|
285
|
+
[id, event, message, conversation, account, metadata, timestamp].hash
|
|
184
286
|
end
|
|
185
287
|
|
|
186
288
|
# Builds the object from hash
|
|
@@ -78,14 +78,20 @@ module Late
|
|
|
78
78
|
|
|
79
79
|
if attributes.key?(:'id')
|
|
80
80
|
self.id = attributes[:'id']
|
|
81
|
+
else
|
|
82
|
+
self.id = nil
|
|
81
83
|
end
|
|
82
84
|
|
|
83
85
|
if attributes.key?(:'platform')
|
|
84
86
|
self.platform = attributes[:'platform']
|
|
87
|
+
else
|
|
88
|
+
self.platform = nil
|
|
85
89
|
end
|
|
86
90
|
|
|
87
91
|
if attributes.key?(:'username')
|
|
88
92
|
self.username = attributes[:'username']
|
|
93
|
+
else
|
|
94
|
+
self.username = nil
|
|
89
95
|
end
|
|
90
96
|
|
|
91
97
|
if attributes.key?(:'display_name')
|
|
@@ -98,6 +104,18 @@ module Late
|
|
|
98
104
|
def list_invalid_properties
|
|
99
105
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
100
106
|
invalid_properties = Array.new
|
|
107
|
+
if @id.nil?
|
|
108
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if @platform.nil?
|
|
112
|
+
invalid_properties.push('invalid value for "platform", platform cannot be nil.')
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if @username.nil?
|
|
116
|
+
invalid_properties.push('invalid value for "username", username cannot be nil.')
|
|
117
|
+
end
|
|
118
|
+
|
|
101
119
|
invalid_properties
|
|
102
120
|
end
|
|
103
121
|
|
|
@@ -105,9 +123,42 @@ module Late
|
|
|
105
123
|
# @return true if the model is valid
|
|
106
124
|
def valid?
|
|
107
125
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
126
|
+
return false if @id.nil?
|
|
127
|
+
return false if @platform.nil?
|
|
128
|
+
return false if @username.nil?
|
|
108
129
|
true
|
|
109
130
|
end
|
|
110
131
|
|
|
132
|
+
# Custom attribute writer method with validation
|
|
133
|
+
# @param [Object] id Value to be assigned
|
|
134
|
+
def id=(id)
|
|
135
|
+
if id.nil?
|
|
136
|
+
fail ArgumentError, 'id cannot be nil'
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
@id = id
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Custom attribute writer method with validation
|
|
143
|
+
# @param [Object] platform Value to be assigned
|
|
144
|
+
def platform=(platform)
|
|
145
|
+
if platform.nil?
|
|
146
|
+
fail ArgumentError, 'platform cannot be nil'
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
@platform = platform
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Custom attribute writer method with validation
|
|
153
|
+
# @param [Object] username Value to be assigned
|
|
154
|
+
def username=(username)
|
|
155
|
+
if username.nil?
|
|
156
|
+
fail ArgumentError, 'username cannot be nil'
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
@username = username
|
|
160
|
+
end
|
|
161
|
+
|
|
111
162
|
# Checks equality by comparing each attribute.
|
|
112
163
|
# @param [Object] Object to be compared
|
|
113
164
|
def ==(o)
|
|
@@ -27,9 +27,6 @@ module Late
|
|
|
27
27
|
|
|
28
28
|
attr_accessor :participant_picture
|
|
29
29
|
|
|
30
|
-
# X/Twitter verified badge type. Only present for Twitter/X conversations.
|
|
31
|
-
attr_accessor :participant_verified_type
|
|
32
|
-
|
|
33
30
|
attr_accessor :status
|
|
34
31
|
|
|
35
32
|
class EnumAttributeValidator
|
|
@@ -63,7 +60,6 @@ module Late
|
|
|
63
60
|
:'participant_name' => :'participantName',
|
|
64
61
|
:'participant_username' => :'participantUsername',
|
|
65
62
|
:'participant_picture' => :'participantPicture',
|
|
66
|
-
:'participant_verified_type' => :'participantVerifiedType',
|
|
67
63
|
:'status' => :'status'
|
|
68
64
|
}
|
|
69
65
|
end
|
|
@@ -87,7 +83,6 @@ module Late
|
|
|
87
83
|
:'participant_name' => :'String',
|
|
88
84
|
:'participant_username' => :'String',
|
|
89
85
|
:'participant_picture' => :'String',
|
|
90
|
-
:'participant_verified_type' => :'String',
|
|
91
86
|
:'status' => :'String'
|
|
92
87
|
}
|
|
93
88
|
end
|
|
@@ -116,10 +111,14 @@ module Late
|
|
|
116
111
|
|
|
117
112
|
if attributes.key?(:'id')
|
|
118
113
|
self.id = attributes[:'id']
|
|
114
|
+
else
|
|
115
|
+
self.id = nil
|
|
119
116
|
end
|
|
120
117
|
|
|
121
118
|
if attributes.key?(:'platform_conversation_id')
|
|
122
119
|
self.platform_conversation_id = attributes[:'platform_conversation_id']
|
|
120
|
+
else
|
|
121
|
+
self.platform_conversation_id = nil
|
|
123
122
|
end
|
|
124
123
|
|
|
125
124
|
if attributes.key?(:'participant_id')
|
|
@@ -138,12 +137,10 @@ module Late
|
|
|
138
137
|
self.participant_picture = attributes[:'participant_picture']
|
|
139
138
|
end
|
|
140
139
|
|
|
141
|
-
if attributes.key?(:'participant_verified_type')
|
|
142
|
-
self.participant_verified_type = attributes[:'participant_verified_type']
|
|
143
|
-
end
|
|
144
|
-
|
|
145
140
|
if attributes.key?(:'status')
|
|
146
141
|
self.status = attributes[:'status']
|
|
142
|
+
else
|
|
143
|
+
self.status = nil
|
|
147
144
|
end
|
|
148
145
|
end
|
|
149
146
|
|
|
@@ -152,6 +149,18 @@ module Late
|
|
|
152
149
|
def list_invalid_properties
|
|
153
150
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
154
151
|
invalid_properties = Array.new
|
|
152
|
+
if @id.nil?
|
|
153
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if @platform_conversation_id.nil?
|
|
157
|
+
invalid_properties.push('invalid value for "platform_conversation_id", platform_conversation_id cannot be nil.')
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if @status.nil?
|
|
161
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
162
|
+
end
|
|
163
|
+
|
|
155
164
|
invalid_properties
|
|
156
165
|
end
|
|
157
166
|
|
|
@@ -159,21 +168,32 @@ module Late
|
|
|
159
168
|
# @return true if the model is valid
|
|
160
169
|
def valid?
|
|
161
170
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
162
|
-
|
|
163
|
-
return false
|
|
171
|
+
return false if @id.nil?
|
|
172
|
+
return false if @platform_conversation_id.nil?
|
|
173
|
+
return false if @status.nil?
|
|
164
174
|
status_validator = EnumAttributeValidator.new('String', ["active", "archived"])
|
|
165
175
|
return false unless status_validator.valid?(@status)
|
|
166
176
|
true
|
|
167
177
|
end
|
|
168
178
|
|
|
169
|
-
# Custom attribute writer method
|
|
170
|
-
# @param [Object]
|
|
171
|
-
def
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
fail ArgumentError, "invalid value for \"participant_verified_type\", must be one of #{validator.allowable_values}."
|
|
179
|
+
# Custom attribute writer method with validation
|
|
180
|
+
# @param [Object] id Value to be assigned
|
|
181
|
+
def id=(id)
|
|
182
|
+
if id.nil?
|
|
183
|
+
fail ArgumentError, 'id cannot be nil'
|
|
175
184
|
end
|
|
176
|
-
|
|
185
|
+
|
|
186
|
+
@id = id
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Custom attribute writer method with validation
|
|
190
|
+
# @param [Object] platform_conversation_id Value to be assigned
|
|
191
|
+
def platform_conversation_id=(platform_conversation_id)
|
|
192
|
+
if platform_conversation_id.nil?
|
|
193
|
+
fail ArgumentError, 'platform_conversation_id cannot be nil'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
@platform_conversation_id = platform_conversation_id
|
|
177
197
|
end
|
|
178
198
|
|
|
179
199
|
# Custom attribute writer method checking allowed values (enum).
|
|
@@ -197,7 +217,6 @@ module Late
|
|
|
197
217
|
participant_name == o.participant_name &&
|
|
198
218
|
participant_username == o.participant_username &&
|
|
199
219
|
participant_picture == o.participant_picture &&
|
|
200
|
-
participant_verified_type == o.participant_verified_type &&
|
|
201
220
|
status == o.status
|
|
202
221
|
end
|
|
203
222
|
|
|
@@ -210,7 +229,7 @@ module Late
|
|
|
210
229
|
# Calculates hash code according to all attributes.
|
|
211
230
|
# @return [Integer] Hash code
|
|
212
231
|
def hash
|
|
213
|
-
[id, platform_conversation_id, participant_id, participant_name, participant_username, participant_picture,
|
|
232
|
+
[id, platform_conversation_id, participant_id, participant_name, participant_username, participant_picture, status].hash
|
|
214
233
|
end
|
|
215
234
|
|
|
216
235
|
# Builds the object from hash
|
|
@@ -127,44 +127,64 @@ module Late
|
|
|
127
127
|
|
|
128
128
|
if attributes.key?(:'id')
|
|
129
129
|
self.id = attributes[:'id']
|
|
130
|
+
else
|
|
131
|
+
self.id = nil
|
|
130
132
|
end
|
|
131
133
|
|
|
132
134
|
if attributes.key?(:'conversation_id')
|
|
133
135
|
self.conversation_id = attributes[:'conversation_id']
|
|
136
|
+
else
|
|
137
|
+
self.conversation_id = nil
|
|
134
138
|
end
|
|
135
139
|
|
|
136
140
|
if attributes.key?(:'platform')
|
|
137
141
|
self.platform = attributes[:'platform']
|
|
142
|
+
else
|
|
143
|
+
self.platform = nil
|
|
138
144
|
end
|
|
139
145
|
|
|
140
146
|
if attributes.key?(:'platform_message_id')
|
|
141
147
|
self.platform_message_id = attributes[:'platform_message_id']
|
|
148
|
+
else
|
|
149
|
+
self.platform_message_id = nil
|
|
142
150
|
end
|
|
143
151
|
|
|
144
152
|
if attributes.key?(:'direction')
|
|
145
153
|
self.direction = attributes[:'direction']
|
|
154
|
+
else
|
|
155
|
+
self.direction = nil
|
|
146
156
|
end
|
|
147
157
|
|
|
148
158
|
if attributes.key?(:'text')
|
|
149
159
|
self.text = attributes[:'text']
|
|
160
|
+
else
|
|
161
|
+
self.text = nil
|
|
150
162
|
end
|
|
151
163
|
|
|
152
164
|
if attributes.key?(:'attachments')
|
|
153
165
|
if (value = attributes[:'attachments']).is_a?(Array)
|
|
154
166
|
self.attachments = value
|
|
155
167
|
end
|
|
168
|
+
else
|
|
169
|
+
self.attachments = nil
|
|
156
170
|
end
|
|
157
171
|
|
|
158
172
|
if attributes.key?(:'sender')
|
|
159
173
|
self.sender = attributes[:'sender']
|
|
174
|
+
else
|
|
175
|
+
self.sender = nil
|
|
160
176
|
end
|
|
161
177
|
|
|
162
178
|
if attributes.key?(:'sent_at')
|
|
163
179
|
self.sent_at = attributes[:'sent_at']
|
|
180
|
+
else
|
|
181
|
+
self.sent_at = nil
|
|
164
182
|
end
|
|
165
183
|
|
|
166
184
|
if attributes.key?(:'is_read')
|
|
167
185
|
self.is_read = attributes[:'is_read']
|
|
186
|
+
else
|
|
187
|
+
self.is_read = nil
|
|
168
188
|
end
|
|
169
189
|
end
|
|
170
190
|
|
|
@@ -173,6 +193,46 @@ module Late
|
|
|
173
193
|
def list_invalid_properties
|
|
174
194
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
175
195
|
invalid_properties = Array.new
|
|
196
|
+
if @id.nil?
|
|
197
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if @conversation_id.nil?
|
|
201
|
+
invalid_properties.push('invalid value for "conversation_id", conversation_id cannot be nil.')
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
if @platform.nil?
|
|
205
|
+
invalid_properties.push('invalid value for "platform", platform cannot be nil.')
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
if @platform_message_id.nil?
|
|
209
|
+
invalid_properties.push('invalid value for "platform_message_id", platform_message_id cannot be nil.')
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
if @direction.nil?
|
|
213
|
+
invalid_properties.push('invalid value for "direction", direction cannot be nil.')
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
if @text.nil?
|
|
217
|
+
invalid_properties.push('invalid value for "text", text cannot be nil.')
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
if @attachments.nil?
|
|
221
|
+
invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
if @sender.nil?
|
|
225
|
+
invalid_properties.push('invalid value for "sender", sender cannot be nil.')
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
if @sent_at.nil?
|
|
229
|
+
invalid_properties.push('invalid value for "sent_at", sent_at cannot be nil.')
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
if @is_read.nil?
|
|
233
|
+
invalid_properties.push('invalid value for "is_read", is_read cannot be nil.')
|
|
234
|
+
end
|
|
235
|
+
|
|
176
236
|
invalid_properties
|
|
177
237
|
end
|
|
178
238
|
|
|
@@ -180,33 +240,123 @@ module Late
|
|
|
180
240
|
# @return true if the model is valid
|
|
181
241
|
def valid?
|
|
182
242
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
183
|
-
|
|
243
|
+
return false if @id.nil?
|
|
244
|
+
return false if @conversation_id.nil?
|
|
245
|
+
return false if @platform.nil?
|
|
246
|
+
platform_validator = EnumAttributeValidator.new('String', ["instagram", "facebook", "telegram", "whatsapp"])
|
|
184
247
|
return false unless platform_validator.valid?(@platform)
|
|
185
|
-
|
|
248
|
+
return false if @platform_message_id.nil?
|
|
249
|
+
return false if @direction.nil?
|
|
250
|
+
direction_validator = EnumAttributeValidator.new('String', ["incoming", "outgoing"])
|
|
186
251
|
return false unless direction_validator.valid?(@direction)
|
|
252
|
+
return false if @text.nil?
|
|
253
|
+
return false if @attachments.nil?
|
|
254
|
+
return false if @sender.nil?
|
|
255
|
+
return false if @sent_at.nil?
|
|
256
|
+
return false if @is_read.nil?
|
|
187
257
|
true
|
|
188
258
|
end
|
|
189
259
|
|
|
260
|
+
# Custom attribute writer method with validation
|
|
261
|
+
# @param [Object] id Value to be assigned
|
|
262
|
+
def id=(id)
|
|
263
|
+
if id.nil?
|
|
264
|
+
fail ArgumentError, 'id cannot be nil'
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
@id = id
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# Custom attribute writer method with validation
|
|
271
|
+
# @param [Object] conversation_id Value to be assigned
|
|
272
|
+
def conversation_id=(conversation_id)
|
|
273
|
+
if conversation_id.nil?
|
|
274
|
+
fail ArgumentError, 'conversation_id cannot be nil'
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
@conversation_id = conversation_id
|
|
278
|
+
end
|
|
279
|
+
|
|
190
280
|
# Custom attribute writer method checking allowed values (enum).
|
|
191
281
|
# @param [Object] platform Object to be assigned
|
|
192
282
|
def platform=(platform)
|
|
193
|
-
validator = EnumAttributeValidator.new('String', ["instagram", "facebook", "telegram", "
|
|
283
|
+
validator = EnumAttributeValidator.new('String', ["instagram", "facebook", "telegram", "whatsapp"])
|
|
194
284
|
unless validator.valid?(platform)
|
|
195
285
|
fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
|
|
196
286
|
end
|
|
197
287
|
@platform = platform
|
|
198
288
|
end
|
|
199
289
|
|
|
290
|
+
# Custom attribute writer method with validation
|
|
291
|
+
# @param [Object] platform_message_id Value to be assigned
|
|
292
|
+
def platform_message_id=(platform_message_id)
|
|
293
|
+
if platform_message_id.nil?
|
|
294
|
+
fail ArgumentError, 'platform_message_id cannot be nil'
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
@platform_message_id = platform_message_id
|
|
298
|
+
end
|
|
299
|
+
|
|
200
300
|
# Custom attribute writer method checking allowed values (enum).
|
|
201
301
|
# @param [Object] direction Object to be assigned
|
|
202
302
|
def direction=(direction)
|
|
203
|
-
validator = EnumAttributeValidator.new('String', ["incoming"])
|
|
303
|
+
validator = EnumAttributeValidator.new('String', ["incoming", "outgoing"])
|
|
204
304
|
unless validator.valid?(direction)
|
|
205
305
|
fail ArgumentError, "invalid value for \"direction\", must be one of #{validator.allowable_values}."
|
|
206
306
|
end
|
|
207
307
|
@direction = direction
|
|
208
308
|
end
|
|
209
309
|
|
|
310
|
+
# Custom attribute writer method with validation
|
|
311
|
+
# @param [Object] text Value to be assigned
|
|
312
|
+
def text=(text)
|
|
313
|
+
if text.nil?
|
|
314
|
+
fail ArgumentError, 'text cannot be nil'
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
@text = text
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
# Custom attribute writer method with validation
|
|
321
|
+
# @param [Object] attachments Value to be assigned
|
|
322
|
+
def attachments=(attachments)
|
|
323
|
+
if attachments.nil?
|
|
324
|
+
fail ArgumentError, 'attachments cannot be nil'
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
@attachments = attachments
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
# Custom attribute writer method with validation
|
|
331
|
+
# @param [Object] sender Value to be assigned
|
|
332
|
+
def sender=(sender)
|
|
333
|
+
if sender.nil?
|
|
334
|
+
fail ArgumentError, 'sender cannot be nil'
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
@sender = sender
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
# Custom attribute writer method with validation
|
|
341
|
+
# @param [Object] sent_at Value to be assigned
|
|
342
|
+
def sent_at=(sent_at)
|
|
343
|
+
if sent_at.nil?
|
|
344
|
+
fail ArgumentError, 'sent_at cannot be nil'
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
@sent_at = sent_at
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
# Custom attribute writer method with validation
|
|
351
|
+
# @param [Object] is_read Value to be assigned
|
|
352
|
+
def is_read=(is_read)
|
|
353
|
+
if is_read.nil?
|
|
354
|
+
fail ArgumentError, 'is_read cannot be nil'
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
@is_read = is_read
|
|
358
|
+
end
|
|
359
|
+
|
|
210
360
|
# Checks equality by comparing each attribute.
|
|
211
361
|
# @param [Object] Object to be compared
|
|
212
362
|
def ==(o)
|
|
@@ -76,10 +76,14 @@ module Late
|
|
|
76
76
|
|
|
77
77
|
if attributes.key?(:'type')
|
|
78
78
|
self.type = attributes[:'type']
|
|
79
|
+
else
|
|
80
|
+
self.type = nil
|
|
79
81
|
end
|
|
80
82
|
|
|
81
83
|
if attributes.key?(:'url')
|
|
82
84
|
self.url = attributes[:'url']
|
|
85
|
+
else
|
|
86
|
+
self.url = nil
|
|
83
87
|
end
|
|
84
88
|
|
|
85
89
|
if attributes.key?(:'payload')
|
|
@@ -92,6 +96,14 @@ module Late
|
|
|
92
96
|
def list_invalid_properties
|
|
93
97
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
94
98
|
invalid_properties = Array.new
|
|
99
|
+
if @type.nil?
|
|
100
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if @url.nil?
|
|
104
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
105
|
+
end
|
|
106
|
+
|
|
95
107
|
invalid_properties
|
|
96
108
|
end
|
|
97
109
|
|
|
@@ -99,9 +111,31 @@ module Late
|
|
|
99
111
|
# @return true if the model is valid
|
|
100
112
|
def valid?
|
|
101
113
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
114
|
+
return false if @type.nil?
|
|
115
|
+
return false if @url.nil?
|
|
102
116
|
true
|
|
103
117
|
end
|
|
104
118
|
|
|
119
|
+
# Custom attribute writer method with validation
|
|
120
|
+
# @param [Object] type Value to be assigned
|
|
121
|
+
def type=(type)
|
|
122
|
+
if type.nil?
|
|
123
|
+
fail ArgumentError, 'type cannot be nil'
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
@type = type
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Custom attribute writer method with validation
|
|
130
|
+
# @param [Object] url Value to be assigned
|
|
131
|
+
def url=(url)
|
|
132
|
+
if url.nil?
|
|
133
|
+
fail ArgumentError, 'url cannot be nil'
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
@url = url
|
|
137
|
+
end
|
|
138
|
+
|
|
105
139
|
# Checks equality by comparing each attribute.
|
|
106
140
|
# @param [Object] Object to be compared
|
|
107
141
|
def ==(o)
|