late-sdk 0.0.120 → 0.0.121
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 +3 -0
- data/docs/WebhookEventsApi.md +69 -0
- data/docs/WebhookPayloadMessageSent.md +28 -0
- data/docs/WebhookPayloadMessageSentMessage.md +36 -0
- data/docs/WebhookPayloadMessageSentMessageSender.md +24 -0
- data/lib/late-sdk/api/webhook_events_api.rb +66 -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_message_sent.rb +320 -0
- data/lib/late-sdk/models/webhook_payload_message_sent_message.rb +430 -0
- data/lib/late-sdk/models/webhook_payload_message_sent_message_sender.rb +191 -0
- data/lib/late-sdk/version.rb +1 -1
- data/lib/late-sdk.rb +3 -0
- data/openapi.yaml +121 -4
- data/spec/models/webhook_log_spec.rb +1 -1
- data/spec/models/webhook_payload_message_sent_message_sender_spec.rb +54 -0
- data/spec/models/webhook_payload_message_sent_message_spec.rb +98 -0
- data/spec/models/webhook_payload_message_sent_spec.rb +70 -0
- data/spec/models/webhook_spec.rb +1 -1
- data/zernio-sdk-0.0.121.gem +0 -0
- metadata +14 -2
- data/zernio-sdk-0.0.120.gem +0 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Late
|
|
17
|
+
class WebhookPayloadMessageSentMessage < ApiModelBase
|
|
18
|
+
# Internal message ID
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# Internal conversation ID
|
|
22
|
+
attr_accessor :conversation_id
|
|
23
|
+
|
|
24
|
+
attr_accessor :platform
|
|
25
|
+
|
|
26
|
+
# Platform's message ID
|
|
27
|
+
attr_accessor :platform_message_id
|
|
28
|
+
|
|
29
|
+
attr_accessor :direction
|
|
30
|
+
|
|
31
|
+
# Message text content
|
|
32
|
+
attr_accessor :text
|
|
33
|
+
|
|
34
|
+
attr_accessor :attachments
|
|
35
|
+
|
|
36
|
+
attr_accessor :sender
|
|
37
|
+
|
|
38
|
+
attr_accessor :sent_at
|
|
39
|
+
|
|
40
|
+
attr_accessor :is_read
|
|
41
|
+
|
|
42
|
+
class EnumAttributeValidator
|
|
43
|
+
attr_reader :datatype
|
|
44
|
+
attr_reader :allowable_values
|
|
45
|
+
|
|
46
|
+
def initialize(datatype, allowable_values)
|
|
47
|
+
@allowable_values = allowable_values.map do |value|
|
|
48
|
+
case datatype.to_s
|
|
49
|
+
when /Integer/i
|
|
50
|
+
value.to_i
|
|
51
|
+
when /Float/i
|
|
52
|
+
value.to_f
|
|
53
|
+
else
|
|
54
|
+
value
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def valid?(value)
|
|
60
|
+
!value || allowable_values.include?(value)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
65
|
+
def self.attribute_map
|
|
66
|
+
{
|
|
67
|
+
:'id' => :'id',
|
|
68
|
+
:'conversation_id' => :'conversationId',
|
|
69
|
+
:'platform' => :'platform',
|
|
70
|
+
:'platform_message_id' => :'platformMessageId',
|
|
71
|
+
:'direction' => :'direction',
|
|
72
|
+
:'text' => :'text',
|
|
73
|
+
:'attachments' => :'attachments',
|
|
74
|
+
:'sender' => :'sender',
|
|
75
|
+
:'sent_at' => :'sentAt',
|
|
76
|
+
:'is_read' => :'isRead'
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Returns attribute mapping this model knows about
|
|
81
|
+
def self.acceptable_attribute_map
|
|
82
|
+
attribute_map
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Returns all the JSON keys this model knows about
|
|
86
|
+
def self.acceptable_attributes
|
|
87
|
+
acceptable_attribute_map.values
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Attribute type mapping.
|
|
91
|
+
def self.openapi_types
|
|
92
|
+
{
|
|
93
|
+
:'id' => :'String',
|
|
94
|
+
:'conversation_id' => :'String',
|
|
95
|
+
:'platform' => :'String',
|
|
96
|
+
:'platform_message_id' => :'String',
|
|
97
|
+
:'direction' => :'String',
|
|
98
|
+
:'text' => :'String',
|
|
99
|
+
:'attachments' => :'Array<WebhookPayloadMessageMessageAttachmentsInner>',
|
|
100
|
+
:'sender' => :'WebhookPayloadMessageSentMessageSender',
|
|
101
|
+
:'sent_at' => :'Time',
|
|
102
|
+
:'is_read' => :'Boolean'
|
|
103
|
+
}
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# List of attributes with nullable: true
|
|
107
|
+
def self.openapi_nullable
|
|
108
|
+
Set.new([
|
|
109
|
+
])
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Initializes the object
|
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
114
|
+
def initialize(attributes = {})
|
|
115
|
+
if (!attributes.is_a?(Hash))
|
|
116
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Late::WebhookPayloadMessageSentMessage` initialize method"
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
120
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
121
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
122
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
123
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Late::WebhookPayloadMessageSentMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
124
|
+
end
|
|
125
|
+
h[k.to_sym] = v
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'id')
|
|
129
|
+
self.id = attributes[:'id']
|
|
130
|
+
else
|
|
131
|
+
self.id = nil
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'conversation_id')
|
|
135
|
+
self.conversation_id = attributes[:'conversation_id']
|
|
136
|
+
else
|
|
137
|
+
self.conversation_id = nil
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'platform')
|
|
141
|
+
self.platform = attributes[:'platform']
|
|
142
|
+
else
|
|
143
|
+
self.platform = nil
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'platform_message_id')
|
|
147
|
+
self.platform_message_id = attributes[:'platform_message_id']
|
|
148
|
+
else
|
|
149
|
+
self.platform_message_id = nil
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'direction')
|
|
153
|
+
self.direction = attributes[:'direction']
|
|
154
|
+
else
|
|
155
|
+
self.direction = nil
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if attributes.key?(:'text')
|
|
159
|
+
self.text = attributes[:'text']
|
|
160
|
+
else
|
|
161
|
+
self.text = nil
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if attributes.key?(:'attachments')
|
|
165
|
+
if (value = attributes[:'attachments']).is_a?(Array)
|
|
166
|
+
self.attachments = value
|
|
167
|
+
end
|
|
168
|
+
else
|
|
169
|
+
self.attachments = nil
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.key?(:'sender')
|
|
173
|
+
self.sender = attributes[:'sender']
|
|
174
|
+
else
|
|
175
|
+
self.sender = nil
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if attributes.key?(:'sent_at')
|
|
179
|
+
self.sent_at = attributes[:'sent_at']
|
|
180
|
+
else
|
|
181
|
+
self.sent_at = nil
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if attributes.key?(:'is_read')
|
|
185
|
+
self.is_read = attributes[:'is_read']
|
|
186
|
+
else
|
|
187
|
+
self.is_read = nil
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
192
|
+
# @return Array for valid properties with the reasons
|
|
193
|
+
def list_invalid_properties
|
|
194
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
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
|
+
|
|
236
|
+
invalid_properties
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Check to see if the all the properties in the model are valid
|
|
240
|
+
# @return true if the model is valid
|
|
241
|
+
def valid?
|
|
242
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
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"])
|
|
247
|
+
return false unless platform_validator.valid?(@platform)
|
|
248
|
+
return false if @platform_message_id.nil?
|
|
249
|
+
return false if @direction.nil?
|
|
250
|
+
direction_validator = EnumAttributeValidator.new('String', ["incoming", "outgoing"])
|
|
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?
|
|
257
|
+
true
|
|
258
|
+
end
|
|
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
|
+
|
|
280
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
281
|
+
# @param [Object] platform Object to be assigned
|
|
282
|
+
def platform=(platform)
|
|
283
|
+
validator = EnumAttributeValidator.new('String', ["instagram", "facebook", "telegram", "whatsapp"])
|
|
284
|
+
unless validator.valid?(platform)
|
|
285
|
+
fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
|
|
286
|
+
end
|
|
287
|
+
@platform = platform
|
|
288
|
+
end
|
|
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
|
+
|
|
300
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
301
|
+
# @param [Object] direction Object to be assigned
|
|
302
|
+
def direction=(direction)
|
|
303
|
+
validator = EnumAttributeValidator.new('String', ["incoming", "outgoing"])
|
|
304
|
+
unless validator.valid?(direction)
|
|
305
|
+
fail ArgumentError, "invalid value for \"direction\", must be one of #{validator.allowable_values}."
|
|
306
|
+
end
|
|
307
|
+
@direction = direction
|
|
308
|
+
end
|
|
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
|
+
|
|
360
|
+
# Checks equality by comparing each attribute.
|
|
361
|
+
# @param [Object] Object to be compared
|
|
362
|
+
def ==(o)
|
|
363
|
+
return true if self.equal?(o)
|
|
364
|
+
self.class == o.class &&
|
|
365
|
+
id == o.id &&
|
|
366
|
+
conversation_id == o.conversation_id &&
|
|
367
|
+
platform == o.platform &&
|
|
368
|
+
platform_message_id == o.platform_message_id &&
|
|
369
|
+
direction == o.direction &&
|
|
370
|
+
text == o.text &&
|
|
371
|
+
attachments == o.attachments &&
|
|
372
|
+
sender == o.sender &&
|
|
373
|
+
sent_at == o.sent_at &&
|
|
374
|
+
is_read == o.is_read
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
# @see the `==` method
|
|
378
|
+
# @param [Object] Object to be compared
|
|
379
|
+
def eql?(o)
|
|
380
|
+
self == o
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
# Calculates hash code according to all attributes.
|
|
384
|
+
# @return [Integer] Hash code
|
|
385
|
+
def hash
|
|
386
|
+
[id, conversation_id, platform, platform_message_id, direction, text, attachments, sender, sent_at, is_read].hash
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
# Builds the object from hash
|
|
390
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
391
|
+
# @return [Object] Returns the model itself
|
|
392
|
+
def self.build_from_hash(attributes)
|
|
393
|
+
return nil unless attributes.is_a?(Hash)
|
|
394
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
395
|
+
transformed_hash = {}
|
|
396
|
+
openapi_types.each_pair do |key, type|
|
|
397
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
398
|
+
transformed_hash["#{key}"] = nil
|
|
399
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
400
|
+
# check to ensure the input is an array given that the attribute
|
|
401
|
+
# is documented as an array but the input is not
|
|
402
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
403
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
404
|
+
end
|
|
405
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
406
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
407
|
+
end
|
|
408
|
+
end
|
|
409
|
+
new(transformed_hash)
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
# Returns the object in the form of hash
|
|
413
|
+
# @return [Hash] Returns the object in the form of hash
|
|
414
|
+
def to_hash
|
|
415
|
+
hash = {}
|
|
416
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
417
|
+
value = self.send(attr)
|
|
418
|
+
if value.nil?
|
|
419
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
420
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
hash[param] = _to_hash(value)
|
|
424
|
+
end
|
|
425
|
+
hash
|
|
426
|
+
end
|
|
427
|
+
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
end
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Late
|
|
17
|
+
class WebhookPayloadMessageSentMessageSender < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
attr_accessor :username
|
|
23
|
+
|
|
24
|
+
attr_accessor :picture
|
|
25
|
+
|
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
|
+
def self.attribute_map
|
|
28
|
+
{
|
|
29
|
+
:'id' => :'id',
|
|
30
|
+
:'name' => :'name',
|
|
31
|
+
:'username' => :'username',
|
|
32
|
+
:'picture' => :'picture'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
acceptable_attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'id' => :'String',
|
|
50
|
+
:'name' => :'String',
|
|
51
|
+
:'username' => :'String',
|
|
52
|
+
:'picture' => :'String'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Late::WebhookPayloadMessageSentMessageSender` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Late::WebhookPayloadMessageSentMessageSender`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'id')
|
|
79
|
+
self.id = attributes[:'id']
|
|
80
|
+
else
|
|
81
|
+
self.id = nil
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'name')
|
|
85
|
+
self.name = attributes[:'name']
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'username')
|
|
89
|
+
self.username = attributes[:'username']
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'picture')
|
|
93
|
+
self.picture = attributes[:'picture']
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
98
|
+
# @return Array for valid properties with the reasons
|
|
99
|
+
def list_invalid_properties
|
|
100
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
101
|
+
invalid_properties = Array.new
|
|
102
|
+
if @id.nil?
|
|
103
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
invalid_properties
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Check to see if the all the properties in the model are valid
|
|
110
|
+
# @return true if the model is valid
|
|
111
|
+
def valid?
|
|
112
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
113
|
+
return false if @id.nil?
|
|
114
|
+
true
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Custom attribute writer method with validation
|
|
118
|
+
# @param [Object] id Value to be assigned
|
|
119
|
+
def id=(id)
|
|
120
|
+
if id.nil?
|
|
121
|
+
fail ArgumentError, 'id cannot be nil'
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
@id = id
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Checks equality by comparing each attribute.
|
|
128
|
+
# @param [Object] Object to be compared
|
|
129
|
+
def ==(o)
|
|
130
|
+
return true if self.equal?(o)
|
|
131
|
+
self.class == o.class &&
|
|
132
|
+
id == o.id &&
|
|
133
|
+
name == o.name &&
|
|
134
|
+
username == o.username &&
|
|
135
|
+
picture == o.picture
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# @see the `==` method
|
|
139
|
+
# @param [Object] Object to be compared
|
|
140
|
+
def eql?(o)
|
|
141
|
+
self == o
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Calculates hash code according to all attributes.
|
|
145
|
+
# @return [Integer] Hash code
|
|
146
|
+
def hash
|
|
147
|
+
[id, name, username, picture].hash
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Builds the object from hash
|
|
151
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
152
|
+
# @return [Object] Returns the model itself
|
|
153
|
+
def self.build_from_hash(attributes)
|
|
154
|
+
return nil unless attributes.is_a?(Hash)
|
|
155
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
156
|
+
transformed_hash = {}
|
|
157
|
+
openapi_types.each_pair do |key, type|
|
|
158
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
159
|
+
transformed_hash["#{key}"] = nil
|
|
160
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
161
|
+
# check to ensure the input is an array given that the attribute
|
|
162
|
+
# is documented as an array but the input is not
|
|
163
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
164
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
165
|
+
end
|
|
166
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
167
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
new(transformed_hash)
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Returns the object in the form of hash
|
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
|
175
|
+
def to_hash
|
|
176
|
+
hash = {}
|
|
177
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
178
|
+
value = self.send(attr)
|
|
179
|
+
if value.nil?
|
|
180
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
181
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
hash[param] = _to_hash(value)
|
|
185
|
+
end
|
|
186
|
+
hash
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
end
|
data/lib/late-sdk/version.rb
CHANGED
data/lib/late-sdk.rb
CHANGED
|
@@ -749,6 +749,9 @@ require 'late-sdk/models/webhook_payload_message_message_attachments_inner'
|
|
|
749
749
|
require 'late-sdk/models/webhook_payload_message_message_sender'
|
|
750
750
|
require 'late-sdk/models/webhook_payload_message_message_sender_instagram_profile'
|
|
751
751
|
require 'late-sdk/models/webhook_payload_message_metadata'
|
|
752
|
+
require 'late-sdk/models/webhook_payload_message_sent'
|
|
753
|
+
require 'late-sdk/models/webhook_payload_message_sent_message'
|
|
754
|
+
require 'late-sdk/models/webhook_payload_message_sent_message_sender'
|
|
752
755
|
require 'late-sdk/models/webhook_payload_post'
|
|
753
756
|
require 'late-sdk/models/webhook_payload_post_post'
|
|
754
757
|
require 'late-sdk/models/webhook_payload_post_post_platforms_inner'
|