unsent 1.0.1 → 1.0.2

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/README.md +258 -2
  4. data/lib/unsent/analytics.rb +30 -0
  5. data/lib/unsent/api_keys.rb +21 -0
  6. data/lib/unsent/campaigns.rb +4 -0
  7. data/lib/unsent/client.rb +8 -1
  8. data/lib/unsent/contact_books.rb +29 -0
  9. data/lib/unsent/contacts.rb +11 -0
  10. data/lib/unsent/emails.rb +47 -0
  11. data/lib/unsent/errors.rb +2 -0
  12. data/lib/unsent/models/add_suppression_request.rb +223 -0
  13. data/lib/unsent/models/create_api_key_request.rb +218 -0
  14. data/lib/unsent/models/create_campaign200_response.rb +750 -0
  15. data/lib/unsent/models/create_campaign_request.rb +426 -0
  16. data/lib/unsent/models/create_campaign_request_reply_to.rb +103 -0
  17. data/lib/unsent/models/create_contact200_response.rb +147 -0
  18. data/lib/unsent/models/create_contact_book200_response.rb +304 -0
  19. data/lib/unsent/models/create_contact_book_request.rb +193 -0
  20. data/lib/unsent/models/create_contact_request.rb +202 -0
  21. data/lib/unsent/models/create_domain_request.rb +190 -0
  22. data/lib/unsent/models/create_template200_response.rb +164 -0
  23. data/lib/unsent/models/create_template_request.rb +226 -0
  24. data/lib/unsent/models/delete_contact_book200_response.rb +164 -0
  25. data/lib/unsent/models/get_api_keys200_response_inner.rb +278 -0
  26. data/lib/unsent/models/get_campaigns200_response_inner.rb +296 -0
  27. data/lib/unsent/models/get_contact_book200_response.rb +330 -0
  28. data/lib/unsent/models/get_contact_book200_response_details.rb +218 -0
  29. data/lib/unsent/models/get_domains200_response_inner.rb +482 -0
  30. data/lib/unsent/models/get_domains200_response_inner_dns_records_inner.rb +318 -0
  31. data/lib/unsent/models/get_health200_response.rb +216 -0
  32. data/lib/unsent/models/get_templates200_response_inner.rb +314 -0
  33. data/lib/unsent/models/list_emails_domain_id_parameter.rb +103 -0
  34. data/lib/unsent/models/schedule_campaign_request.rb +185 -0
  35. data/lib/unsent/models/send_email_request.rb +378 -0
  36. data/lib/unsent/models/send_email_request_to.rb +103 -0
  37. data/lib/unsent/models/update_contact_book200_response.rb +190 -0
  38. data/lib/unsent/models/update_contact_book_request.rb +167 -0
  39. data/lib/unsent/models/update_contact_request.rb +176 -0
  40. data/lib/unsent/models/update_template_request.rb +174 -0
  41. data/lib/unsent/settings.rb +13 -0
  42. data/lib/unsent/suppressions.rb +28 -0
  43. data/lib/unsent/templates.rb +29 -0
  44. data/lib/unsent/version.rb +1 -1
  45. data/lib/unsent/webhooks.rb +25 -0
  46. data/lib/unsent.rb +7 -0
  47. metadata +38 -2
@@ -0,0 +1,750 @@
1
+ =begin
2
+ #Unsent API
3
+
4
+ #API for Unsent.dev
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@unsent.dev
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.18.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Unsent
17
+ class CreateCampaign200Response < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :from
23
+
24
+ attr_accessor :subject
25
+
26
+ attr_accessor :preview_text
27
+
28
+ attr_accessor :contact_book_id
29
+
30
+ attr_accessor :html
31
+
32
+ attr_accessor :content
33
+
34
+ attr_accessor :status
35
+
36
+ attr_accessor :scheduled_at
37
+
38
+ attr_accessor :batch_size
39
+
40
+ attr_accessor :batch_window_minutes
41
+
42
+ attr_accessor :total
43
+
44
+ attr_accessor :sent
45
+
46
+ attr_accessor :delivered
47
+
48
+ attr_accessor :opened
49
+
50
+ attr_accessor :clicked
51
+
52
+ attr_accessor :unsubscribed
53
+
54
+ attr_accessor :bounced
55
+
56
+ attr_accessor :hard_bounced
57
+
58
+ attr_accessor :complained
59
+
60
+ attr_accessor :reply_to
61
+
62
+ attr_accessor :cc
63
+
64
+ attr_accessor :bcc
65
+
66
+ attr_accessor :created_at
67
+
68
+ attr_accessor :updated_at
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ :'id' => :'id',
74
+ :'name' => :'name',
75
+ :'from' => :'from',
76
+ :'subject' => :'subject',
77
+ :'preview_text' => :'previewText',
78
+ :'contact_book_id' => :'contactBookId',
79
+ :'html' => :'html',
80
+ :'content' => :'content',
81
+ :'status' => :'status',
82
+ :'scheduled_at' => :'scheduledAt',
83
+ :'batch_size' => :'batchSize',
84
+ :'batch_window_minutes' => :'batchWindowMinutes',
85
+ :'total' => :'total',
86
+ :'sent' => :'sent',
87
+ :'delivered' => :'delivered',
88
+ :'opened' => :'opened',
89
+ :'clicked' => :'clicked',
90
+ :'unsubscribed' => :'unsubscribed',
91
+ :'bounced' => :'bounced',
92
+ :'hard_bounced' => :'hardBounced',
93
+ :'complained' => :'complained',
94
+ :'reply_to' => :'replyTo',
95
+ :'cc' => :'cc',
96
+ :'bcc' => :'bcc',
97
+ :'created_at' => :'createdAt',
98
+ :'updated_at' => :'updatedAt'
99
+ }
100
+ end
101
+
102
+ # Returns attribute mapping this model knows about
103
+ def self.acceptable_attribute_map
104
+ attribute_map
105
+ end
106
+
107
+ # Returns all the JSON keys this model knows about
108
+ def self.acceptable_attributes
109
+ acceptable_attribute_map.values
110
+ end
111
+
112
+ # Attribute type mapping.
113
+ def self.openapi_types
114
+ {
115
+ :'id' => :'String',
116
+ :'name' => :'String',
117
+ :'from' => :'String',
118
+ :'subject' => :'String',
119
+ :'preview_text' => :'String',
120
+ :'contact_book_id' => :'String',
121
+ :'html' => :'String',
122
+ :'content' => :'String',
123
+ :'status' => :'String',
124
+ :'scheduled_at' => :'Time',
125
+ :'batch_size' => :'Integer',
126
+ :'batch_window_minutes' => :'Integer',
127
+ :'total' => :'Integer',
128
+ :'sent' => :'Integer',
129
+ :'delivered' => :'Integer',
130
+ :'opened' => :'Integer',
131
+ :'clicked' => :'Integer',
132
+ :'unsubscribed' => :'Integer',
133
+ :'bounced' => :'Integer',
134
+ :'hard_bounced' => :'Integer',
135
+ :'complained' => :'Integer',
136
+ :'reply_to' => :'Array<String>',
137
+ :'cc' => :'Array<String>',
138
+ :'bcc' => :'Array<String>',
139
+ :'created_at' => :'Time',
140
+ :'updated_at' => :'Time'
141
+ }
142
+ end
143
+
144
+ # List of attributes with nullable: true
145
+ def self.openapi_nullable
146
+ Set.new([
147
+ :'preview_text',
148
+ :'contact_book_id',
149
+ :'html',
150
+ :'content',
151
+ :'scheduled_at',
152
+ ])
153
+ end
154
+
155
+ # Initializes the object
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ def initialize(attributes = {})
158
+ if (!attributes.is_a?(Hash))
159
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Unsent::CreateCampaign200Response` initialize method"
160
+ end
161
+
162
+ # check to see if the attribute exists and convert string to symbol for hash key
163
+ acceptable_attribute_map = self.class.acceptable_attribute_map
164
+ attributes = attributes.each_with_object({}) { |(k, v), h|
165
+ if (!acceptable_attribute_map.key?(k.to_sym))
166
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Unsent::CreateCampaign200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
167
+ end
168
+ h[k.to_sym] = v
169
+ }
170
+
171
+ if attributes.key?(:'id')
172
+ self.id = attributes[:'id']
173
+ else
174
+ self.id = nil
175
+ end
176
+
177
+ if attributes.key?(:'name')
178
+ self.name = attributes[:'name']
179
+ else
180
+ self.name = nil
181
+ end
182
+
183
+ if attributes.key?(:'from')
184
+ self.from = attributes[:'from']
185
+ else
186
+ self.from = nil
187
+ end
188
+
189
+ if attributes.key?(:'subject')
190
+ self.subject = attributes[:'subject']
191
+ else
192
+ self.subject = nil
193
+ end
194
+
195
+ if attributes.key?(:'preview_text')
196
+ self.preview_text = attributes[:'preview_text']
197
+ else
198
+ self.preview_text = nil
199
+ end
200
+
201
+ if attributes.key?(:'contact_book_id')
202
+ self.contact_book_id = attributes[:'contact_book_id']
203
+ else
204
+ self.contact_book_id = nil
205
+ end
206
+
207
+ if attributes.key?(:'html')
208
+ self.html = attributes[:'html']
209
+ else
210
+ self.html = nil
211
+ end
212
+
213
+ if attributes.key?(:'content')
214
+ self.content = attributes[:'content']
215
+ else
216
+ self.content = nil
217
+ end
218
+
219
+ if attributes.key?(:'status')
220
+ self.status = attributes[:'status']
221
+ else
222
+ self.status = nil
223
+ end
224
+
225
+ if attributes.key?(:'scheduled_at')
226
+ self.scheduled_at = attributes[:'scheduled_at']
227
+ else
228
+ self.scheduled_at = nil
229
+ end
230
+
231
+ if attributes.key?(:'batch_size')
232
+ self.batch_size = attributes[:'batch_size']
233
+ else
234
+ self.batch_size = nil
235
+ end
236
+
237
+ if attributes.key?(:'batch_window_minutes')
238
+ self.batch_window_minutes = attributes[:'batch_window_minutes']
239
+ else
240
+ self.batch_window_minutes = nil
241
+ end
242
+
243
+ if attributes.key?(:'total')
244
+ self.total = attributes[:'total']
245
+ else
246
+ self.total = nil
247
+ end
248
+
249
+ if attributes.key?(:'sent')
250
+ self.sent = attributes[:'sent']
251
+ else
252
+ self.sent = nil
253
+ end
254
+
255
+ if attributes.key?(:'delivered')
256
+ self.delivered = attributes[:'delivered']
257
+ else
258
+ self.delivered = nil
259
+ end
260
+
261
+ if attributes.key?(:'opened')
262
+ self.opened = attributes[:'opened']
263
+ else
264
+ self.opened = nil
265
+ end
266
+
267
+ if attributes.key?(:'clicked')
268
+ self.clicked = attributes[:'clicked']
269
+ else
270
+ self.clicked = nil
271
+ end
272
+
273
+ if attributes.key?(:'unsubscribed')
274
+ self.unsubscribed = attributes[:'unsubscribed']
275
+ else
276
+ self.unsubscribed = nil
277
+ end
278
+
279
+ if attributes.key?(:'bounced')
280
+ self.bounced = attributes[:'bounced']
281
+ else
282
+ self.bounced = nil
283
+ end
284
+
285
+ if attributes.key?(:'hard_bounced')
286
+ self.hard_bounced = attributes[:'hard_bounced']
287
+ else
288
+ self.hard_bounced = nil
289
+ end
290
+
291
+ if attributes.key?(:'complained')
292
+ self.complained = attributes[:'complained']
293
+ else
294
+ self.complained = nil
295
+ end
296
+
297
+ if attributes.key?(:'reply_to')
298
+ if (value = attributes[:'reply_to']).is_a?(Array)
299
+ self.reply_to = value
300
+ end
301
+ else
302
+ self.reply_to = nil
303
+ end
304
+
305
+ if attributes.key?(:'cc')
306
+ if (value = attributes[:'cc']).is_a?(Array)
307
+ self.cc = value
308
+ end
309
+ else
310
+ self.cc = nil
311
+ end
312
+
313
+ if attributes.key?(:'bcc')
314
+ if (value = attributes[:'bcc']).is_a?(Array)
315
+ self.bcc = value
316
+ end
317
+ else
318
+ self.bcc = nil
319
+ end
320
+
321
+ if attributes.key?(:'created_at')
322
+ self.created_at = attributes[:'created_at']
323
+ else
324
+ self.created_at = nil
325
+ end
326
+
327
+ if attributes.key?(:'updated_at')
328
+ self.updated_at = attributes[:'updated_at']
329
+ else
330
+ self.updated_at = nil
331
+ end
332
+ end
333
+
334
+ # Show invalid properties with the reasons. Usually used together with valid?
335
+ # @return Array for valid properties with the reasons
336
+ def list_invalid_properties
337
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
338
+ invalid_properties = Array.new
339
+ if @id.nil?
340
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
341
+ end
342
+
343
+ if @name.nil?
344
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
345
+ end
346
+
347
+ if @from.nil?
348
+ invalid_properties.push('invalid value for "from", from cannot be nil.')
349
+ end
350
+
351
+ if @subject.nil?
352
+ invalid_properties.push('invalid value for "subject", subject cannot be nil.')
353
+ end
354
+
355
+ if @status.nil?
356
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
357
+ end
358
+
359
+ if @batch_size.nil?
360
+ invalid_properties.push('invalid value for "batch_size", batch_size cannot be nil.')
361
+ end
362
+
363
+ if @batch_window_minutes.nil?
364
+ invalid_properties.push('invalid value for "batch_window_minutes", batch_window_minutes cannot be nil.')
365
+ end
366
+
367
+ if @total.nil?
368
+ invalid_properties.push('invalid value for "total", total cannot be nil.')
369
+ end
370
+
371
+ if @sent.nil?
372
+ invalid_properties.push('invalid value for "sent", sent cannot be nil.')
373
+ end
374
+
375
+ if @delivered.nil?
376
+ invalid_properties.push('invalid value for "delivered", delivered cannot be nil.')
377
+ end
378
+
379
+ if @opened.nil?
380
+ invalid_properties.push('invalid value for "opened", opened cannot be nil.')
381
+ end
382
+
383
+ if @clicked.nil?
384
+ invalid_properties.push('invalid value for "clicked", clicked cannot be nil.')
385
+ end
386
+
387
+ if @unsubscribed.nil?
388
+ invalid_properties.push('invalid value for "unsubscribed", unsubscribed cannot be nil.')
389
+ end
390
+
391
+ if @bounced.nil?
392
+ invalid_properties.push('invalid value for "bounced", bounced cannot be nil.')
393
+ end
394
+
395
+ if @hard_bounced.nil?
396
+ invalid_properties.push('invalid value for "hard_bounced", hard_bounced cannot be nil.')
397
+ end
398
+
399
+ if @complained.nil?
400
+ invalid_properties.push('invalid value for "complained", complained cannot be nil.')
401
+ end
402
+
403
+ if @reply_to.nil?
404
+ invalid_properties.push('invalid value for "reply_to", reply_to cannot be nil.')
405
+ end
406
+
407
+ if @cc.nil?
408
+ invalid_properties.push('invalid value for "cc", cc cannot be nil.')
409
+ end
410
+
411
+ if @bcc.nil?
412
+ invalid_properties.push('invalid value for "bcc", bcc cannot be nil.')
413
+ end
414
+
415
+ if @created_at.nil?
416
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
417
+ end
418
+
419
+ if @updated_at.nil?
420
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
421
+ end
422
+
423
+ invalid_properties
424
+ end
425
+
426
+ # Check to see if the all the properties in the model are valid
427
+ # @return true if the model is valid
428
+ def valid?
429
+ warn '[DEPRECATED] the `valid?` method is obsolete'
430
+ return false if @id.nil?
431
+ return false if @name.nil?
432
+ return false if @from.nil?
433
+ return false if @subject.nil?
434
+ return false if @status.nil?
435
+ return false if @batch_size.nil?
436
+ return false if @batch_window_minutes.nil?
437
+ return false if @total.nil?
438
+ return false if @sent.nil?
439
+ return false if @delivered.nil?
440
+ return false if @opened.nil?
441
+ return false if @clicked.nil?
442
+ return false if @unsubscribed.nil?
443
+ return false if @bounced.nil?
444
+ return false if @hard_bounced.nil?
445
+ return false if @complained.nil?
446
+ return false if @reply_to.nil?
447
+ return false if @cc.nil?
448
+ return false if @bcc.nil?
449
+ return false if @created_at.nil?
450
+ return false if @updated_at.nil?
451
+ true
452
+ end
453
+
454
+ # Custom attribute writer method with validation
455
+ # @param [Object] id Value to be assigned
456
+ def id=(id)
457
+ if id.nil?
458
+ fail ArgumentError, 'id cannot be nil'
459
+ end
460
+
461
+ @id = id
462
+ end
463
+
464
+ # Custom attribute writer method with validation
465
+ # @param [Object] name Value to be assigned
466
+ def name=(name)
467
+ if name.nil?
468
+ fail ArgumentError, 'name cannot be nil'
469
+ end
470
+
471
+ @name = name
472
+ end
473
+
474
+ # Custom attribute writer method with validation
475
+ # @param [Object] from Value to be assigned
476
+ def from=(from)
477
+ if from.nil?
478
+ fail ArgumentError, 'from cannot be nil'
479
+ end
480
+
481
+ @from = from
482
+ end
483
+
484
+ # Custom attribute writer method with validation
485
+ # @param [Object] subject Value to be assigned
486
+ def subject=(subject)
487
+ if subject.nil?
488
+ fail ArgumentError, 'subject cannot be nil'
489
+ end
490
+
491
+ @subject = subject
492
+ end
493
+
494
+ # Custom attribute writer method with validation
495
+ # @param [Object] status Value to be assigned
496
+ def status=(status)
497
+ if status.nil?
498
+ fail ArgumentError, 'status cannot be nil'
499
+ end
500
+
501
+ @status = status
502
+ end
503
+
504
+ # Custom attribute writer method with validation
505
+ # @param [Object] batch_size Value to be assigned
506
+ def batch_size=(batch_size)
507
+ if batch_size.nil?
508
+ fail ArgumentError, 'batch_size cannot be nil'
509
+ end
510
+
511
+ @batch_size = batch_size
512
+ end
513
+
514
+ # Custom attribute writer method with validation
515
+ # @param [Object] batch_window_minutes Value to be assigned
516
+ def batch_window_minutes=(batch_window_minutes)
517
+ if batch_window_minutes.nil?
518
+ fail ArgumentError, 'batch_window_minutes cannot be nil'
519
+ end
520
+
521
+ @batch_window_minutes = batch_window_minutes
522
+ end
523
+
524
+ # Custom attribute writer method with validation
525
+ # @param [Object] total Value to be assigned
526
+ def total=(total)
527
+ if total.nil?
528
+ fail ArgumentError, 'total cannot be nil'
529
+ end
530
+
531
+ @total = total
532
+ end
533
+
534
+ # Custom attribute writer method with validation
535
+ # @param [Object] sent Value to be assigned
536
+ def sent=(sent)
537
+ if sent.nil?
538
+ fail ArgumentError, 'sent cannot be nil'
539
+ end
540
+
541
+ @sent = sent
542
+ end
543
+
544
+ # Custom attribute writer method with validation
545
+ # @param [Object] delivered Value to be assigned
546
+ def delivered=(delivered)
547
+ if delivered.nil?
548
+ fail ArgumentError, 'delivered cannot be nil'
549
+ end
550
+
551
+ @delivered = delivered
552
+ end
553
+
554
+ # Custom attribute writer method with validation
555
+ # @param [Object] opened Value to be assigned
556
+ def opened=(opened)
557
+ if opened.nil?
558
+ fail ArgumentError, 'opened cannot be nil'
559
+ end
560
+
561
+ @opened = opened
562
+ end
563
+
564
+ # Custom attribute writer method with validation
565
+ # @param [Object] clicked Value to be assigned
566
+ def clicked=(clicked)
567
+ if clicked.nil?
568
+ fail ArgumentError, 'clicked cannot be nil'
569
+ end
570
+
571
+ @clicked = clicked
572
+ end
573
+
574
+ # Custom attribute writer method with validation
575
+ # @param [Object] unsubscribed Value to be assigned
576
+ def unsubscribed=(unsubscribed)
577
+ if unsubscribed.nil?
578
+ fail ArgumentError, 'unsubscribed cannot be nil'
579
+ end
580
+
581
+ @unsubscribed = unsubscribed
582
+ end
583
+
584
+ # Custom attribute writer method with validation
585
+ # @param [Object] bounced Value to be assigned
586
+ def bounced=(bounced)
587
+ if bounced.nil?
588
+ fail ArgumentError, 'bounced cannot be nil'
589
+ end
590
+
591
+ @bounced = bounced
592
+ end
593
+
594
+ # Custom attribute writer method with validation
595
+ # @param [Object] hard_bounced Value to be assigned
596
+ def hard_bounced=(hard_bounced)
597
+ if hard_bounced.nil?
598
+ fail ArgumentError, 'hard_bounced cannot be nil'
599
+ end
600
+
601
+ @hard_bounced = hard_bounced
602
+ end
603
+
604
+ # Custom attribute writer method with validation
605
+ # @param [Object] complained Value to be assigned
606
+ def complained=(complained)
607
+ if complained.nil?
608
+ fail ArgumentError, 'complained cannot be nil'
609
+ end
610
+
611
+ @complained = complained
612
+ end
613
+
614
+ # Custom attribute writer method with validation
615
+ # @param [Object] reply_to Value to be assigned
616
+ def reply_to=(reply_to)
617
+ if reply_to.nil?
618
+ fail ArgumentError, 'reply_to cannot be nil'
619
+ end
620
+
621
+ @reply_to = reply_to
622
+ end
623
+
624
+ # Custom attribute writer method with validation
625
+ # @param [Object] cc Value to be assigned
626
+ def cc=(cc)
627
+ if cc.nil?
628
+ fail ArgumentError, 'cc cannot be nil'
629
+ end
630
+
631
+ @cc = cc
632
+ end
633
+
634
+ # Custom attribute writer method with validation
635
+ # @param [Object] bcc Value to be assigned
636
+ def bcc=(bcc)
637
+ if bcc.nil?
638
+ fail ArgumentError, 'bcc cannot be nil'
639
+ end
640
+
641
+ @bcc = bcc
642
+ end
643
+
644
+ # Custom attribute writer method with validation
645
+ # @param [Object] created_at Value to be assigned
646
+ def created_at=(created_at)
647
+ if created_at.nil?
648
+ fail ArgumentError, 'created_at cannot be nil'
649
+ end
650
+
651
+ @created_at = created_at
652
+ end
653
+
654
+ # Custom attribute writer method with validation
655
+ # @param [Object] updated_at Value to be assigned
656
+ def updated_at=(updated_at)
657
+ if updated_at.nil?
658
+ fail ArgumentError, 'updated_at cannot be nil'
659
+ end
660
+
661
+ @updated_at = updated_at
662
+ end
663
+
664
+ # Checks equality by comparing each attribute.
665
+ # @param [Object] Object to be compared
666
+ def ==(o)
667
+ return true if self.equal?(o)
668
+ self.class == o.class &&
669
+ id == o.id &&
670
+ name == o.name &&
671
+ from == o.from &&
672
+ subject == o.subject &&
673
+ preview_text == o.preview_text &&
674
+ contact_book_id == o.contact_book_id &&
675
+ html == o.html &&
676
+ content == o.content &&
677
+ status == o.status &&
678
+ scheduled_at == o.scheduled_at &&
679
+ batch_size == o.batch_size &&
680
+ batch_window_minutes == o.batch_window_minutes &&
681
+ total == o.total &&
682
+ sent == o.sent &&
683
+ delivered == o.delivered &&
684
+ opened == o.opened &&
685
+ clicked == o.clicked &&
686
+ unsubscribed == o.unsubscribed &&
687
+ bounced == o.bounced &&
688
+ hard_bounced == o.hard_bounced &&
689
+ complained == o.complained &&
690
+ reply_to == o.reply_to &&
691
+ cc == o.cc &&
692
+ bcc == o.bcc &&
693
+ created_at == o.created_at &&
694
+ updated_at == o.updated_at
695
+ end
696
+
697
+ # @see the `==` method
698
+ # @param [Object] Object to be compared
699
+ def eql?(o)
700
+ self == o
701
+ end
702
+
703
+ # Calculates hash code according to all attributes.
704
+ # @return [Integer] Hash code
705
+ def hash
706
+ [id, name, from, subject, preview_text, contact_book_id, html, content, status, scheduled_at, batch_size, batch_window_minutes, total, sent, delivered, opened, clicked, unsubscribed, bounced, hard_bounced, complained, reply_to, cc, bcc, created_at, updated_at].hash
707
+ end
708
+
709
+ # Builds the object from hash
710
+ # @param [Hash] attributes Model attributes in the form of hash
711
+ # @return [Object] Returns the model itself
712
+ def self.build_from_hash(attributes)
713
+ return nil unless attributes.is_a?(Hash)
714
+ attributes = attributes.transform_keys(&:to_sym)
715
+ transformed_hash = {}
716
+ openapi_types.each_pair do |key, type|
717
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
718
+ transformed_hash["#{key}"] = nil
719
+ elsif type =~ /\AArray<(.*)>/i
720
+ # check to ensure the input is an array given that the attribute
721
+ # is documented as an array but the input is not
722
+ if attributes[attribute_map[key]].is_a?(Array)
723
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
724
+ end
725
+ elsif !attributes[attribute_map[key]].nil?
726
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
727
+ end
728
+ end
729
+ new(transformed_hash)
730
+ end
731
+
732
+ # Returns the object in the form of hash
733
+ # @return [Hash] Returns the object in the form of hash
734
+ def to_hash
735
+ hash = {}
736
+ self.class.attribute_map.each_pair do |attr, param|
737
+ value = self.send(attr)
738
+ if value.nil?
739
+ is_nullable = self.class.openapi_nullable.include?(attr)
740
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
741
+ end
742
+
743
+ hash[param] = _to_hash(value)
744
+ end
745
+ hash
746
+ end
747
+
748
+ end
749
+
750
+ end