apollo-deploy-signal-sdk 1.0.5

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 (36) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +5 -0
  3. data/LICENSE +21 -0
  4. data/README.md +79 -0
  5. data/docs/README.md +30 -0
  6. data/docs/domains/api-keys.md +92 -0
  7. data/docs/domains/contact-properties.md +122 -0
  8. data/docs/domains/contacts.md +394 -0
  9. data/docs/domains/emails.md +150 -0
  10. data/docs/domains/metrics.md +131 -0
  11. data/docs/domains/projects.md +127 -0
  12. data/docs/domains/segments.md +116 -0
  13. data/docs/domains/sending-domains.md +160 -0
  14. data/docs/domains/suppressions.md +120 -0
  15. data/docs/domains/topics.md +141 -0
  16. data/docs/domains/webhooks.md +200 -0
  17. data/docs/types.md +1225 -0
  18. data/lib/apollo-deploy-signal-sdk.rb +3 -0
  19. data/lib/apollo_deploy_signal_sdk/client.rb +111 -0
  20. data/lib/apollo_deploy_signal_sdk/errors.rb +150 -0
  21. data/lib/apollo_deploy_signal_sdk/resources/api-keys.rb +86 -0
  22. data/lib/apollo_deploy_signal_sdk/resources/contact-properties.rb +108 -0
  23. data/lib/apollo_deploy_signal_sdk/resources/contacts.rb +356 -0
  24. data/lib/apollo_deploy_signal_sdk/resources/emails.rb +128 -0
  25. data/lib/apollo_deploy_signal_sdk/resources/metrics.rb +122 -0
  26. data/lib/apollo_deploy_signal_sdk/resources/projects.rb +114 -0
  27. data/lib/apollo_deploy_signal_sdk/resources/segments.rb +105 -0
  28. data/lib/apollo_deploy_signal_sdk/resources/sending-domains.rb +144 -0
  29. data/lib/apollo_deploy_signal_sdk/resources/suppressions.rb +104 -0
  30. data/lib/apollo_deploy_signal_sdk/resources/topics.rb +126 -0
  31. data/lib/apollo_deploy_signal_sdk/resources/webhooks.rb +184 -0
  32. data/lib/apollo_deploy_signal_sdk/transport.rb +618 -0
  33. data/lib/apollo_deploy_signal_sdk/types.rb +4917 -0
  34. data/lib/apollo_deploy_signal_sdk/version.rb +5 -0
  35. data/lib/apollo_deploy_signal_sdk.rb +47 -0
  36. metadata +135 -0
@@ -0,0 +1,4917 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ApolloDeploySignalSdk
4
+ # Schema type: AttachmentRequest
5
+ class AttachmentRequest
6
+ # @return [String]
7
+ attr_accessor :filename
8
+ # @return [String]
9
+ attr_accessor :content
10
+ # @return [String]
11
+ attr_accessor :content_type
12
+ # @return [String]
13
+ attr_accessor :disposition
14
+ # @return [String, nil]
15
+ attr_accessor :content_id
16
+
17
+ # @param filename [String], content [String], content_type [String], disposition [String], content_id [String, nil]
18
+ def initialize(filename: , content: , content_type: , disposition: nil, content_id: nil)
19
+ @filename = filename
20
+ @content = content
21
+ @content_type = content_type
22
+ @disposition = disposition
23
+ @content_id = content_id
24
+ end
25
+
26
+ # @return [Hash] a hash representation of this object
27
+ def to_h
28
+ {
29
+ filename: @filename,
30
+ content: @content,
31
+ content_type: @content_type,
32
+ disposition: @disposition,
33
+ content_id: @content_id,
34
+ }.compact
35
+ end
36
+
37
+ # Create an instance from a parsed JSON hash.
38
+ # @param attributes [Hash]
39
+ # @return [AttachmentRequest]
40
+ def self.from_json(attributes)
41
+ return nil unless attributes.is_a?(Hash)
42
+
43
+ new(
44
+ filename: attributes.key?("filename") ? attributes["filename"] : attributes[:filename],
45
+ content: attributes.key?("content") ? attributes["content"] : attributes[:content],
46
+ content_type: attributes.key?("contentType") ? attributes["contentType"] : attributes[:content_type],
47
+ disposition: attributes.key?("disposition") ? attributes["disposition"] : attributes[:disposition],
48
+ content_id: attributes.key?("contentId") ? attributes["contentId"] : attributes[:content_id],
49
+ )
50
+ end
51
+ end
52
+
53
+ # Schema type: DeliveryWindowRequest
54
+ class DeliveryWindowRequest
55
+ # @return [String]
56
+ attr_accessor :start
57
+ # @return [String]
58
+ attr_accessor :end_
59
+
60
+ # @param start [String], end_ [String]
61
+ def initialize(start: , end_: )
62
+ @start = start
63
+ @end_ = end_
64
+ end
65
+
66
+ # @return [Hash] a hash representation of this object
67
+ def to_h
68
+ {
69
+ start: @start,
70
+ end_: @end_,
71
+ }.compact
72
+ end
73
+
74
+ # Create an instance from a parsed JSON hash.
75
+ # @param attributes [Hash]
76
+ # @return [DeliveryWindowRequest]
77
+ def self.from_json(attributes)
78
+ return nil unless attributes.is_a?(Hash)
79
+
80
+ new(
81
+ start: attributes.key?("start") ? attributes["start"] : attributes[:start],
82
+ end_: attributes.key?("end") ? attributes["end"] : attributes[:end_],
83
+ )
84
+ end
85
+ end
86
+
87
+ # Schema type: TrackingSettingsRequest
88
+ class TrackingSettingsRequest
89
+ # @return [Boolean, nil]
90
+ attr_accessor :open_tracking
91
+ # @return [Boolean, nil]
92
+ attr_accessor :click_tracking
93
+ # @return [Boolean, nil]
94
+ attr_accessor :unsubscribe_tracking
95
+ # @return [Boolean, nil]
96
+ attr_accessor :read_engagement
97
+
98
+ # @param open_tracking [Boolean, nil], click_tracking [Boolean, nil], unsubscribe_tracking [Boolean, nil], read_engagement [Boolean, nil]
99
+ def initialize(open_tracking: nil, click_tracking: nil, unsubscribe_tracking: nil, read_engagement: nil)
100
+ @open_tracking = open_tracking
101
+ @click_tracking = click_tracking
102
+ @unsubscribe_tracking = unsubscribe_tracking
103
+ @read_engagement = read_engagement
104
+ end
105
+
106
+ # @return [Hash] a hash representation of this object
107
+ def to_h
108
+ {
109
+ open_tracking: @open_tracking,
110
+ click_tracking: @click_tracking,
111
+ unsubscribe_tracking: @unsubscribe_tracking,
112
+ read_engagement: @read_engagement,
113
+ }.compact
114
+ end
115
+
116
+ # Create an instance from a parsed JSON hash.
117
+ # @param attributes [Hash]
118
+ # @return [TrackingSettingsRequest]
119
+ def self.from_json(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+
122
+ new(
123
+ open_tracking: attributes.key?("openTracking") ? attributes["openTracking"] : attributes[:open_tracking],
124
+ click_tracking: attributes.key?("clickTracking") ? attributes["clickTracking"] : attributes[:click_tracking],
125
+ unsubscribe_tracking: attributes.key?("unsubscribeTracking") ? attributes["unsubscribeTracking"] : attributes[:unsubscribe_tracking],
126
+ read_engagement: attributes.key?("readEngagement") ? attributes["readEngagement"] : attributes[:read_engagement],
127
+ )
128
+ end
129
+ end
130
+
131
+ # Schema type: SendEmailRequest
132
+ class SendEmailRequest
133
+ # @return [String]
134
+ attr_accessor :from
135
+ # @return [Array<String>]
136
+ attr_accessor :to
137
+ # @return [Array<String>]
138
+ attr_accessor :cc
139
+ # @return [Array<String>]
140
+ attr_accessor :bcc
141
+ # @return [String, nil]
142
+ attr_accessor :reply_to
143
+ # @return [String, nil]
144
+ attr_accessor :subject
145
+ # @return [String, nil]
146
+ attr_accessor :html
147
+ # @return [String, nil]
148
+ attr_accessor :text
149
+ # @return [Hash{String => String}]
150
+ attr_accessor :tags
151
+ # @return [Hash{String => String}]
152
+ attr_accessor :metadata
153
+ # @return [String, nil]
154
+ attr_accessor :idempotency_key
155
+ # @return [Boolean]
156
+ attr_accessor :test_mode
157
+ # @return [Array<AttachmentRequest>]
158
+ attr_accessor :attachments
159
+ # @return [String, nil]
160
+ attr_accessor :scheduled_at
161
+ # @return [DeliveryWindowRequest, nil]
162
+ attr_accessor :delivery_window
163
+ # @return [String]
164
+ attr_accessor :send_time_category
165
+ # @return [TrackingSettingsRequest, nil]
166
+ attr_accessor :tracking_settings
167
+
168
+ # @param from [String], to [Array<String>], cc [Array<String>], bcc [Array<String>], reply_to [String, nil], subject [String, nil], html [String, nil], text [String, nil], tags [Hash{String => String}], metadata [Hash{String => String}], idempotency_key [String, nil], test_mode [Boolean], attachments [Array<AttachmentRequest>], scheduled_at [String, nil], delivery_window [DeliveryWindowRequest, nil], send_time_category [String], tracking_settings [TrackingSettingsRequest, nil]
169
+ def initialize(from: , to: , cc: nil, bcc: nil, reply_to: nil, subject: nil, html: nil, text: nil, tags: nil, metadata: nil, idempotency_key: nil, test_mode: nil, attachments: nil, scheduled_at: nil, delivery_window: nil, send_time_category: nil, tracking_settings: nil)
170
+ @from = from
171
+ @to = to
172
+ @cc = cc
173
+ @bcc = bcc
174
+ @reply_to = reply_to
175
+ @subject = subject
176
+ @html = html
177
+ @text = text
178
+ @tags = tags
179
+ @metadata = metadata
180
+ @idempotency_key = idempotency_key
181
+ @test_mode = test_mode
182
+ @attachments = attachments
183
+ @scheduled_at = scheduled_at
184
+ @delivery_window = delivery_window
185
+ @send_time_category = send_time_category
186
+ @tracking_settings = tracking_settings
187
+ end
188
+
189
+ # @return [Hash] a hash representation of this object
190
+ def to_h
191
+ {
192
+ from: @from,
193
+ to: @to,
194
+ cc: @cc,
195
+ bcc: @bcc,
196
+ reply_to: @reply_to,
197
+ subject: @subject,
198
+ html: @html,
199
+ text: @text,
200
+ tags: @tags,
201
+ metadata: @metadata,
202
+ idempotency_key: @idempotency_key,
203
+ test_mode: @test_mode,
204
+ attachments: @attachments,
205
+ scheduled_at: @scheduled_at,
206
+ delivery_window: @delivery_window,
207
+ send_time_category: @send_time_category,
208
+ tracking_settings: @tracking_settings,
209
+ }.compact
210
+ end
211
+
212
+ # Create an instance from a parsed JSON hash.
213
+ # @param attributes [Hash]
214
+ # @return [SendEmailRequest]
215
+ def self.from_json(attributes)
216
+ return nil unless attributes.is_a?(Hash)
217
+
218
+ new(
219
+ from: attributes.key?("from") ? attributes["from"] : attributes[:from],
220
+ to: attributes.key?("to") ? attributes["to"] : attributes[:to],
221
+ cc: attributes.key?("cc") ? attributes["cc"] : attributes[:cc],
222
+ bcc: attributes.key?("bcc") ? attributes["bcc"] : attributes[:bcc],
223
+ reply_to: attributes.key?("replyTo") ? attributes["replyTo"] : attributes[:reply_to],
224
+ subject: attributes.key?("subject") ? attributes["subject"] : attributes[:subject],
225
+ html: attributes.key?("html") ? attributes["html"] : attributes[:html],
226
+ text: attributes.key?("text") ? attributes["text"] : attributes[:text],
227
+ tags: attributes.key?("tags") ? attributes["tags"] : attributes[:tags],
228
+ metadata: attributes.key?("metadata") ? attributes["metadata"] : attributes[:metadata],
229
+ idempotency_key: attributes.key?("idempotencyKey") ? attributes["idempotencyKey"] : attributes[:idempotency_key],
230
+ test_mode: attributes.key?("testMode") ? attributes["testMode"] : attributes[:test_mode],
231
+ attachments: attributes.key?("attachments") ? attributes["attachments"] : attributes[:attachments],
232
+ scheduled_at: attributes.key?("scheduledAt") ? attributes["scheduledAt"] : attributes[:scheduled_at],
233
+ delivery_window: attributes.key?("deliveryWindow") ? attributes["deliveryWindow"] : attributes[:delivery_window],
234
+ send_time_category: attributes.key?("sendTimeCategory") ? attributes["sendTimeCategory"] : attributes[:send_time_category],
235
+ tracking_settings: attributes.key?("trackingSettings") ? attributes["trackingSettings"] : attributes[:tracking_settings],
236
+ )
237
+ end
238
+ end
239
+
240
+ # Schema type: BatchSendItemResponse
241
+ class BatchSendItemResponse
242
+ # @return [Integer]
243
+ attr_accessor :index
244
+ # @return [String, nil]
245
+ attr_accessor :id
246
+ # @return [String, nil]
247
+ attr_accessor :message_id
248
+ # @return [String, nil]
249
+ attr_accessor :status
250
+ # @return [String, nil]
251
+ attr_accessor :created_at
252
+ # @return [String, nil]
253
+ attr_accessor :scheduled_at
254
+ # @return [String, nil]
255
+ attr_accessor :error
256
+
257
+ # @param index [Integer], id [String, nil], message_id [String, nil], status [String, nil], created_at [String, nil], scheduled_at [String, nil], error [String, nil]
258
+ def initialize(index: , id: nil, message_id: nil, status: nil, created_at: nil, scheduled_at: nil, error: nil)
259
+ @index = index
260
+ @id = id
261
+ @message_id = message_id
262
+ @status = status
263
+ @created_at = created_at
264
+ @scheduled_at = scheduled_at
265
+ @error = error
266
+ end
267
+
268
+ # @return [Hash] a hash representation of this object
269
+ def to_h
270
+ {
271
+ index: @index,
272
+ id: @id,
273
+ message_id: @message_id,
274
+ status: @status,
275
+ created_at: @created_at,
276
+ scheduled_at: @scheduled_at,
277
+ error: @error,
278
+ }.compact
279
+ end
280
+
281
+ # Create an instance from a parsed JSON hash.
282
+ # @param attributes [Hash]
283
+ # @return [BatchSendItemResponse]
284
+ def self.from_json(attributes)
285
+ return nil unless attributes.is_a?(Hash)
286
+
287
+ new(
288
+ index: attributes.key?("index") ? attributes["index"] : attributes[:index],
289
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
290
+ message_id: attributes.key?("messageId") ? attributes["messageId"] : attributes[:message_id],
291
+ status: attributes.key?("status") ? attributes["status"] : attributes[:status],
292
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
293
+ scheduled_at: attributes.key?("scheduledAt") ? attributes["scheduledAt"] : attributes[:scheduled_at],
294
+ error: attributes.key?("error") ? attributes["error"] : attributes[:error],
295
+ )
296
+ end
297
+ end
298
+
299
+ # Schema type: SendEmailResponse
300
+ class SendEmailResponse
301
+ # @return [String]
302
+ attr_accessor :id
303
+ # @return [String, nil]
304
+ attr_accessor :message_id
305
+ # @return [String]
306
+ attr_accessor :status
307
+ # @return [String]
308
+ attr_accessor :created_at
309
+ # @return [String, nil]
310
+ attr_accessor :scheduled_at
311
+ # @return [String, nil]
312
+ attr_accessor :audience_id
313
+ # @return [Array<BatchSendItemResponse>]
314
+ attr_accessor :messages
315
+
316
+ # @param id [String], message_id [String, nil], status [String], created_at [String], scheduled_at [String, nil], audience_id [String, nil], messages [Array<BatchSendItemResponse>]
317
+ def initialize(id: , message_id: , status: , created_at: , scheduled_at: nil, audience_id: nil, messages: nil)
318
+ @id = id
319
+ @message_id = message_id
320
+ @status = status
321
+ @created_at = created_at
322
+ @scheduled_at = scheduled_at
323
+ @audience_id = audience_id
324
+ @messages = messages
325
+ end
326
+
327
+ # @return [Hash] a hash representation of this object
328
+ def to_h
329
+ {
330
+ id: @id,
331
+ message_id: @message_id,
332
+ status: @status,
333
+ created_at: @created_at,
334
+ scheduled_at: @scheduled_at,
335
+ audience_id: @audience_id,
336
+ messages: @messages,
337
+ }.compact
338
+ end
339
+
340
+ # Create an instance from a parsed JSON hash.
341
+ # @param attributes [Hash]
342
+ # @return [SendEmailResponse]
343
+ def self.from_json(attributes)
344
+ return nil unless attributes.is_a?(Hash)
345
+
346
+ new(
347
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
348
+ message_id: attributes.key?("messageId") ? attributes["messageId"] : attributes[:message_id],
349
+ status: attributes.key?("status") ? attributes["status"] : attributes[:status],
350
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
351
+ scheduled_at: attributes.key?("scheduledAt") ? attributes["scheduledAt"] : attributes[:scheduled_at],
352
+ audience_id: attributes.key?("audienceId") ? attributes["audienceId"] : attributes[:audience_id],
353
+ messages: attributes.key?("messages") ? attributes["messages"] : attributes[:messages],
354
+ )
355
+ end
356
+ end
357
+
358
+ # Schema type: EmailDetailResponse
359
+ class EmailDetailResponse
360
+ # @return [String]
361
+ attr_accessor :id
362
+ # @return [String, nil]
363
+ attr_accessor :message_id
364
+ # @return [String]
365
+ attr_accessor :from
366
+ # @return [Array<String>]
367
+ attr_accessor :to
368
+ # @return [Array<String>]
369
+ attr_accessor :cc
370
+ # @return [Array<String>]
371
+ attr_accessor :bcc
372
+ # @return [String, nil]
373
+ attr_accessor :reply_to
374
+ # @return [String]
375
+ attr_accessor :subject
376
+ # @return [String, nil]
377
+ attr_accessor :html
378
+ # @return [String, nil]
379
+ attr_accessor :text
380
+ # @return [String]
381
+ attr_accessor :status
382
+ # @return [String, nil]
383
+ attr_accessor :error
384
+ # @return [Hash{String => String}]
385
+ attr_accessor :tags
386
+ # @return [Hash{String => String}]
387
+ attr_accessor :metadata
388
+ # @return [Boolean]
389
+ attr_accessor :test_mode
390
+ # @return [String, nil]
391
+ attr_accessor :topic_id
392
+ # @return [String]
393
+ attr_accessor :created_at
394
+ # @return [String, nil]
395
+ attr_accessor :sent_at
396
+ # @return [String, nil]
397
+ attr_accessor :updated_at
398
+
399
+ # @param id [String], message_id [String, nil], from [String], to [Array<String>], cc [Array<String>], bcc [Array<String>], reply_to [String, nil], subject [String], html [String, nil], text [String, nil], status [String], error [String, nil], tags [Hash{String => String}], metadata [Hash{String => String}], test_mode [Boolean], topic_id [String, nil], created_at [String], sent_at [String, nil], updated_at [String, nil]
400
+ def initialize(id: , message_id: , from: , to: , cc: , bcc: , reply_to: , subject: , html: nil, text: nil, status: , error: , tags: , metadata: , test_mode: , topic_id: nil, created_at: , sent_at: , updated_at: )
401
+ @id = id
402
+ @message_id = message_id
403
+ @from = from
404
+ @to = to
405
+ @cc = cc
406
+ @bcc = bcc
407
+ @reply_to = reply_to
408
+ @subject = subject
409
+ @html = html
410
+ @text = text
411
+ @status = status
412
+ @error = error
413
+ @tags = tags
414
+ @metadata = metadata
415
+ @test_mode = test_mode
416
+ @topic_id = topic_id
417
+ @created_at = created_at
418
+ @sent_at = sent_at
419
+ @updated_at = updated_at
420
+ end
421
+
422
+ # @return [Hash] a hash representation of this object
423
+ def to_h
424
+ {
425
+ id: @id,
426
+ message_id: @message_id,
427
+ from: @from,
428
+ to: @to,
429
+ cc: @cc,
430
+ bcc: @bcc,
431
+ reply_to: @reply_to,
432
+ subject: @subject,
433
+ html: @html,
434
+ text: @text,
435
+ status: @status,
436
+ error: @error,
437
+ tags: @tags,
438
+ metadata: @metadata,
439
+ test_mode: @test_mode,
440
+ topic_id: @topic_id,
441
+ created_at: @created_at,
442
+ sent_at: @sent_at,
443
+ updated_at: @updated_at,
444
+ }.compact
445
+ end
446
+
447
+ # Create an instance from a parsed JSON hash.
448
+ # @param attributes [Hash]
449
+ # @return [EmailDetailResponse]
450
+ def self.from_json(attributes)
451
+ return nil unless attributes.is_a?(Hash)
452
+
453
+ new(
454
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
455
+ message_id: attributes.key?("messageId") ? attributes["messageId"] : attributes[:message_id],
456
+ from: attributes.key?("from") ? attributes["from"] : attributes[:from],
457
+ to: attributes.key?("to") ? attributes["to"] : attributes[:to],
458
+ cc: attributes.key?("cc") ? attributes["cc"] : attributes[:cc],
459
+ bcc: attributes.key?("bcc") ? attributes["bcc"] : attributes[:bcc],
460
+ reply_to: attributes.key?("replyTo") ? attributes["replyTo"] : attributes[:reply_to],
461
+ subject: attributes.key?("subject") ? attributes["subject"] : attributes[:subject],
462
+ html: attributes.key?("html") ? attributes["html"] : attributes[:html],
463
+ text: attributes.key?("text") ? attributes["text"] : attributes[:text],
464
+ status: attributes.key?("status") ? attributes["status"] : attributes[:status],
465
+ error: attributes.key?("error") ? attributes["error"] : attributes[:error],
466
+ tags: attributes.key?("tags") ? attributes["tags"] : attributes[:tags],
467
+ metadata: attributes.key?("metadata") ? attributes["metadata"] : attributes[:metadata],
468
+ test_mode: attributes.key?("testMode") ? attributes["testMode"] : attributes[:test_mode],
469
+ topic_id: attributes.key?("topicId") ? attributes["topicId"] : attributes[:topic_id],
470
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
471
+ sent_at: attributes.key?("sentAt") ? attributes["sentAt"] : attributes[:sent_at],
472
+ updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
473
+ )
474
+ end
475
+ end
476
+
477
+ # Schema type: BatchSendRequest
478
+ class BatchSendRequest
479
+ # @return [Array<SendEmailRequest>]
480
+ attr_accessor :items
481
+
482
+ # @param items [Array<SendEmailRequest>]
483
+ def initialize(items: )
484
+ @items = items
485
+ end
486
+
487
+ # @return [Hash] a hash representation of this object
488
+ def to_h
489
+ {
490
+ items: @items,
491
+ }.compact
492
+ end
493
+
494
+ # Create an instance from a parsed JSON hash.
495
+ # @param attributes [Hash]
496
+ # @return [BatchSendRequest]
497
+ def self.from_json(attributes)
498
+ return nil unless attributes.is_a?(Hash)
499
+
500
+ new(
501
+ items: attributes.key?("items") ? attributes["items"] : attributes[:items],
502
+ )
503
+ end
504
+ end
505
+
506
+ # Schema type: BatchSendResponse
507
+ class BatchSendResponse
508
+ # @return [Array<BatchSendItemResponse>]
509
+ attr_accessor :results
510
+
511
+ # @param results [Array<BatchSendItemResponse>]
512
+ def initialize(results: )
513
+ @results = results
514
+ end
515
+
516
+ # @return [Hash] a hash representation of this object
517
+ def to_h
518
+ {
519
+ results: @results,
520
+ }.compact
521
+ end
522
+
523
+ # Create an instance from a parsed JSON hash.
524
+ # @param attributes [Hash]
525
+ # @return [BatchSendResponse]
526
+ def self.from_json(attributes)
527
+ return nil unless attributes.is_a?(Hash)
528
+
529
+ new(
530
+ results: attributes.key?("results") ? attributes["results"] : attributes[:results],
531
+ )
532
+ end
533
+ end
534
+
535
+ # Schema type: CancelResponse
536
+ class CancelResponse
537
+ # @return [Boolean]
538
+ attr_accessor :cancelled
539
+
540
+ # @param cancelled [Boolean]
541
+ def initialize(cancelled: nil)
542
+ @cancelled = cancelled
543
+ end
544
+
545
+ # @return [Hash] a hash representation of this object
546
+ def to_h
547
+ {
548
+ cancelled: @cancelled,
549
+ }.compact
550
+ end
551
+
552
+ # Create an instance from a parsed JSON hash.
553
+ # @param attributes [Hash]
554
+ # @return [CancelResponse]
555
+ def self.from_json(attributes)
556
+ return nil unless attributes.is_a?(Hash)
557
+
558
+ new(
559
+ cancelled: attributes.key?("cancelled") ? attributes["cancelled"] : attributes[:cancelled],
560
+ )
561
+ end
562
+ end
563
+
564
+ # Schema type: BulkCancelResponse
565
+ class BulkCancelResponse
566
+ # @return [Integer]
567
+ attr_accessor :cancelled
568
+
569
+ # @param cancelled [Integer]
570
+ def initialize(cancelled: )
571
+ @cancelled = cancelled
572
+ end
573
+
574
+ # @return [Hash] a hash representation of this object
575
+ def to_h
576
+ {
577
+ cancelled: @cancelled,
578
+ }.compact
579
+ end
580
+
581
+ # Create an instance from a parsed JSON hash.
582
+ # @param attributes [Hash]
583
+ # @return [BulkCancelResponse]
584
+ def self.from_json(attributes)
585
+ return nil unless attributes.is_a?(Hash)
586
+
587
+ new(
588
+ cancelled: attributes.key?("cancelled") ? attributes["cancelled"] : attributes[:cancelled],
589
+ )
590
+ end
591
+ end
592
+
593
+ # Schema type: StreamTokenResponse
594
+ class StreamTokenResponse
595
+ # @return [String]
596
+ attr_accessor :token
597
+ # @return [String]
598
+ attr_accessor :expires_at
599
+
600
+ # @param token [String], expires_at [String]
601
+ def initialize(token: , expires_at: )
602
+ @token = token
603
+ @expires_at = expires_at
604
+ end
605
+
606
+ # @return [Hash] a hash representation of this object
607
+ def to_h
608
+ {
609
+ token: @token,
610
+ expires_at: @expires_at,
611
+ }.compact
612
+ end
613
+
614
+ # Create an instance from a parsed JSON hash.
615
+ # @param attributes [Hash]
616
+ # @return [StreamTokenResponse]
617
+ def self.from_json(attributes)
618
+ return nil unless attributes.is_a?(Hash)
619
+
620
+ new(
621
+ token: attributes.key?("token") ? attributes["token"] : attributes[:token],
622
+ expires_at: attributes.key?("expiresAt") ? attributes["expiresAt"] : attributes[:expires_at],
623
+ )
624
+ end
625
+ end
626
+
627
+ # Schema type: StreamEventResponse
628
+ class StreamEventResponse
629
+ # @return [String]
630
+ attr_accessor :type
631
+ # @return [String]
632
+ attr_accessor :email_id
633
+ # @return [String]
634
+ attr_accessor :occurred_at
635
+ # @return [Hash{String => String}]
636
+ attr_accessor :data
637
+
638
+ # @param type [String], email_id [String], occurred_at [String], data [Hash{String => String}]
639
+ def initialize(type: , email_id: , occurred_at: , data: nil)
640
+ @type = type
641
+ @email_id = email_id
642
+ @occurred_at = occurred_at
643
+ @data = data
644
+ end
645
+
646
+ # @return [Hash] a hash representation of this object
647
+ def to_h
648
+ {
649
+ type: @type,
650
+ email_id: @email_id,
651
+ occurred_at: @occurred_at,
652
+ data: @data,
653
+ }.compact
654
+ end
655
+
656
+ # Create an instance from a parsed JSON hash.
657
+ # @param attributes [Hash]
658
+ # @return [StreamEventResponse]
659
+ def self.from_json(attributes)
660
+ return nil unless attributes.is_a?(Hash)
661
+
662
+ new(
663
+ type: attributes.key?("type") ? attributes["type"] : attributes[:type],
664
+ email_id: attributes.key?("emailId") ? attributes["emailId"] : attributes[:email_id],
665
+ occurred_at: attributes.key?("occurredAt") ? attributes["occurredAt"] : attributes[:occurred_at],
666
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
667
+ )
668
+ end
669
+ end
670
+
671
+ # Schema type: ValidateLinksRequest
672
+ class ValidateLinksRequest
673
+ # @return [String, nil]
674
+ attr_accessor :html
675
+
676
+ # @param html [String, nil]
677
+ def initialize(html: nil)
678
+ @html = html
679
+ end
680
+
681
+ # @return [Hash] a hash representation of this object
682
+ def to_h
683
+ {
684
+ html: @html,
685
+ }.compact
686
+ end
687
+
688
+ # Create an instance from a parsed JSON hash.
689
+ # @param attributes [Hash]
690
+ # @return [ValidateLinksRequest]
691
+ def self.from_json(attributes)
692
+ return nil unless attributes.is_a?(Hash)
693
+
694
+ new(
695
+ html: attributes.key?("html") ? attributes["html"] : attributes[:html],
696
+ )
697
+ end
698
+ end
699
+
700
+ # Schema type: LinkResultItem
701
+ class LinkResultItem
702
+ # @return [String]
703
+ attr_accessor :url
704
+ # @return [String]
705
+ attr_accessor :status
706
+ # @return [Integer, nil]
707
+ attr_accessor :status_code
708
+ # @return [String, nil]
709
+ attr_accessor :error
710
+
711
+ # @param url [String], status [String], status_code [Integer, nil], error [String, nil]
712
+ def initialize(url: , status: , status_code: nil, error: nil)
713
+ @url = url
714
+ @status = status
715
+ @status_code = status_code
716
+ @error = error
717
+ end
718
+
719
+ # @return [Hash] a hash representation of this object
720
+ def to_h
721
+ {
722
+ url: @url,
723
+ status: @status,
724
+ status_code: @status_code,
725
+ error: @error,
726
+ }.compact
727
+ end
728
+
729
+ # Create an instance from a parsed JSON hash.
730
+ # @param attributes [Hash]
731
+ # @return [LinkResultItem]
732
+ def self.from_json(attributes)
733
+ return nil unless attributes.is_a?(Hash)
734
+
735
+ new(
736
+ url: attributes.key?("url") ? attributes["url"] : attributes[:url],
737
+ status: attributes.key?("status") ? attributes["status"] : attributes[:status],
738
+ status_code: attributes.key?("statusCode") ? attributes["statusCode"] : attributes[:status_code],
739
+ error: attributes.key?("error") ? attributes["error"] : attributes[:error],
740
+ )
741
+ end
742
+ end
743
+
744
+ # Schema type: ValidateLinksResponse
745
+ class ValidateLinksResponse
746
+ # @return [Array<LinkResultItem>]
747
+ attr_accessor :links
748
+ # @return [Integer]
749
+ attr_accessor :total_links
750
+ # @return [Integer]
751
+ attr_accessor :broken_links
752
+ # @return [Integer]
753
+ attr_accessor :error_links
754
+
755
+ # @param links [Array<LinkResultItem>], total_links [Integer], broken_links [Integer], error_links [Integer]
756
+ def initialize(links: , total_links: , broken_links: , error_links: )
757
+ @links = links
758
+ @total_links = total_links
759
+ @broken_links = broken_links
760
+ @error_links = error_links
761
+ end
762
+
763
+ # @return [Hash] a hash representation of this object
764
+ def to_h
765
+ {
766
+ links: @links,
767
+ total_links: @total_links,
768
+ broken_links: @broken_links,
769
+ error_links: @error_links,
770
+ }.compact
771
+ end
772
+
773
+ # Create an instance from a parsed JSON hash.
774
+ # @param attributes [Hash]
775
+ # @return [ValidateLinksResponse]
776
+ def self.from_json(attributes)
777
+ return nil unless attributes.is_a?(Hash)
778
+
779
+ new(
780
+ links: attributes.key?("links") ? attributes["links"] : attributes[:links],
781
+ total_links: attributes.key?("totalLinks") ? attributes["totalLinks"] : attributes[:total_links],
782
+ broken_links: attributes.key?("brokenLinks") ? attributes["brokenLinks"] : attributes[:broken_links],
783
+ error_links: attributes.key?("errorLinks") ? attributes["errorLinks"] : attributes[:error_links],
784
+ )
785
+ end
786
+ end
787
+
788
+ # Schema type: MetricsWindowResponse
789
+ class MetricsWindowResponse
790
+ # @return [String]
791
+ attr_accessor :from
792
+ # @return [String]
793
+ attr_accessor :to
794
+ # @return [String]
795
+ attr_accessor :label
796
+
797
+ # @param from [String], to [String], label [String]
798
+ def initialize(from: , to: , label: )
799
+ @from = from
800
+ @to = to
801
+ @label = label
802
+ end
803
+
804
+ # @return [Hash] a hash representation of this object
805
+ def to_h
806
+ {
807
+ from: @from,
808
+ to: @to,
809
+ label: @label,
810
+ }.compact
811
+ end
812
+
813
+ # Create an instance from a parsed JSON hash.
814
+ # @param attributes [Hash]
815
+ # @return [MetricsWindowResponse]
816
+ def self.from_json(attributes)
817
+ return nil unless attributes.is_a?(Hash)
818
+
819
+ new(
820
+ from: attributes.key?("from") ? attributes["from"] : attributes[:from],
821
+ to: attributes.key?("to") ? attributes["to"] : attributes[:to],
822
+ label: attributes.key?("label") ? attributes["label"] : attributes[:label],
823
+ )
824
+ end
825
+ end
826
+
827
+ # Schema type: TopicPerformanceResponse
828
+ class TopicPerformanceResponse
829
+ # @return [String]
830
+ attr_accessor :topic_id
831
+ # @return [String]
832
+ attr_accessor :topic_name
833
+ # @return [MetricsWindowResponse]
834
+ attr_accessor :window
835
+ # @return [Integer]
836
+ attr_accessor :total_emails
837
+ # @return [Integer]
838
+ attr_accessor :delivered
839
+ # @return [Float]
840
+ attr_accessor :delivery_rate
841
+ # @return [Integer]
842
+ attr_accessor :opened
843
+ # @return [Float]
844
+ attr_accessor :open_rate
845
+ # @return [Integer]
846
+ attr_accessor :clicked
847
+ # @return [Float]
848
+ attr_accessor :click_rate
849
+ # @return [Integer]
850
+ attr_accessor :bounced
851
+ # @return [Float]
852
+ attr_accessor :bounce_rate
853
+ # @return [Integer]
854
+ attr_accessor :complained
855
+ # @return [Float]
856
+ attr_accessor :complaint_rate
857
+ # @return [Integer]
858
+ attr_accessor :unsubscribed
859
+ # @return [Float]
860
+ attr_accessor :unsubscribe_rate
861
+ # @return [Integer]
862
+ attr_accessor :read_engaged
863
+ # @return [Float]
864
+ attr_accessor :read_engagement_rate
865
+ # @return [Float, nil]
866
+ attr_accessor :avg_read_time_seconds
867
+ # @return [Integer]
868
+ attr_accessor :opt_in_count
869
+ # @return [Integer]
870
+ attr_accessor :opt_out_count
871
+ # @return [String]
872
+ attr_accessor :computed_at
873
+
874
+ # @param topic_id [String], topic_name [String], window [MetricsWindowResponse], total_emails [Integer], delivered [Integer], delivery_rate [Float], opened [Integer], open_rate [Float], clicked [Integer], click_rate [Float], bounced [Integer], bounce_rate [Float], complained [Integer], complaint_rate [Float], unsubscribed [Integer], unsubscribe_rate [Float], read_engaged [Integer], read_engagement_rate [Float], avg_read_time_seconds [Float, nil], opt_in_count [Integer], opt_out_count [Integer], computed_at [String]
875
+ def initialize(topic_id: , topic_name: , window: , total_emails: , delivered: , delivery_rate: , opened: , open_rate: , clicked: , click_rate: , bounced: , bounce_rate: , complained: , complaint_rate: , unsubscribed: , unsubscribe_rate: , read_engaged: , read_engagement_rate: , avg_read_time_seconds: , opt_in_count: , opt_out_count: , computed_at: )
876
+ @topic_id = topic_id
877
+ @topic_name = topic_name
878
+ @window = window
879
+ @total_emails = total_emails
880
+ @delivered = delivered
881
+ @delivery_rate = delivery_rate
882
+ @opened = opened
883
+ @open_rate = open_rate
884
+ @clicked = clicked
885
+ @click_rate = click_rate
886
+ @bounced = bounced
887
+ @bounce_rate = bounce_rate
888
+ @complained = complained
889
+ @complaint_rate = complaint_rate
890
+ @unsubscribed = unsubscribed
891
+ @unsubscribe_rate = unsubscribe_rate
892
+ @read_engaged = read_engaged
893
+ @read_engagement_rate = read_engagement_rate
894
+ @avg_read_time_seconds = avg_read_time_seconds
895
+ @opt_in_count = opt_in_count
896
+ @opt_out_count = opt_out_count
897
+ @computed_at = computed_at
898
+ end
899
+
900
+ # @return [Hash] a hash representation of this object
901
+ def to_h
902
+ {
903
+ topic_id: @topic_id,
904
+ topic_name: @topic_name,
905
+ window: @window,
906
+ total_emails: @total_emails,
907
+ delivered: @delivered,
908
+ delivery_rate: @delivery_rate,
909
+ opened: @opened,
910
+ open_rate: @open_rate,
911
+ clicked: @clicked,
912
+ click_rate: @click_rate,
913
+ bounced: @bounced,
914
+ bounce_rate: @bounce_rate,
915
+ complained: @complained,
916
+ complaint_rate: @complaint_rate,
917
+ unsubscribed: @unsubscribed,
918
+ unsubscribe_rate: @unsubscribe_rate,
919
+ read_engaged: @read_engaged,
920
+ read_engagement_rate: @read_engagement_rate,
921
+ avg_read_time_seconds: @avg_read_time_seconds,
922
+ opt_in_count: @opt_in_count,
923
+ opt_out_count: @opt_out_count,
924
+ computed_at: @computed_at,
925
+ }.compact
926
+ end
927
+
928
+ # Create an instance from a parsed JSON hash.
929
+ # @param attributes [Hash]
930
+ # @return [TopicPerformanceResponse]
931
+ def self.from_json(attributes)
932
+ return nil unless attributes.is_a?(Hash)
933
+
934
+ new(
935
+ topic_id: attributes.key?("topicId") ? attributes["topicId"] : attributes[:topic_id],
936
+ topic_name: attributes.key?("topicName") ? attributes["topicName"] : attributes[:topic_name],
937
+ window: attributes.key?("window") ? attributes["window"] : attributes[:window],
938
+ total_emails: attributes.key?("totalEmails") ? attributes["totalEmails"] : attributes[:total_emails],
939
+ delivered: attributes.key?("delivered") ? attributes["delivered"] : attributes[:delivered],
940
+ delivery_rate: attributes.key?("deliveryRate") ? attributes["deliveryRate"] : attributes[:delivery_rate],
941
+ opened: attributes.key?("opened") ? attributes["opened"] : attributes[:opened],
942
+ open_rate: attributes.key?("openRate") ? attributes["openRate"] : attributes[:open_rate],
943
+ clicked: attributes.key?("clicked") ? attributes["clicked"] : attributes[:clicked],
944
+ click_rate: attributes.key?("clickRate") ? attributes["clickRate"] : attributes[:click_rate],
945
+ bounced: attributes.key?("bounced") ? attributes["bounced"] : attributes[:bounced],
946
+ bounce_rate: attributes.key?("bounceRate") ? attributes["bounceRate"] : attributes[:bounce_rate],
947
+ complained: attributes.key?("complained") ? attributes["complained"] : attributes[:complained],
948
+ complaint_rate: attributes.key?("complaintRate") ? attributes["complaintRate"] : attributes[:complaint_rate],
949
+ unsubscribed: attributes.key?("unsubscribed") ? attributes["unsubscribed"] : attributes[:unsubscribed],
950
+ unsubscribe_rate: attributes.key?("unsubscribeRate") ? attributes["unsubscribeRate"] : attributes[:unsubscribe_rate],
951
+ read_engaged: attributes.key?("readEngaged") ? attributes["readEngaged"] : attributes[:read_engaged],
952
+ read_engagement_rate: attributes.key?("readEngagementRate") ? attributes["readEngagementRate"] : attributes[:read_engagement_rate],
953
+ avg_read_time_seconds: attributes.key?("avgReadTimeSeconds") ? attributes["avgReadTimeSeconds"] : attributes[:avg_read_time_seconds],
954
+ opt_in_count: attributes.key?("optInCount") ? attributes["optInCount"] : attributes[:opt_in_count],
955
+ opt_out_count: attributes.key?("optOutCount") ? attributes["optOutCount"] : attributes[:opt_out_count],
956
+ computed_at: attributes.key?("computedAt") ? attributes["computedAt"] : attributes[:computed_at],
957
+ )
958
+ end
959
+ end
960
+
961
+ # Schema type: EmailPerformanceResponse
962
+ class EmailPerformanceResponse
963
+ # @return [String]
964
+ attr_accessor :email_id
965
+ # @return [String]
966
+ attr_accessor :subject
967
+ # @return [String]
968
+ attr_accessor :from_address
969
+ # @return [String, nil]
970
+ attr_accessor :topic_id
971
+ # @return [String]
972
+ attr_accessor :status
973
+ # @return [Boolean]
974
+ attr_accessor :delivered
975
+ # @return [Boolean]
976
+ attr_accessor :opened
977
+ # @return [Boolean]
978
+ attr_accessor :clicked
979
+ # @return [Integer]
980
+ attr_accessor :total_clicks
981
+ # @return [Boolean]
982
+ attr_accessor :bounced
983
+ # @return [Boolean]
984
+ attr_accessor :complained
985
+ # @return [Boolean]
986
+ attr_accessor :unsubscribed
987
+ # @return [Boolean]
988
+ attr_accessor :read_engaged
989
+ # @return [Float, nil]
990
+ attr_accessor :read_time_seconds
991
+ # @return [String, nil]
992
+ attr_accessor :read_category
993
+ # @return [String, nil]
994
+ attr_accessor :sent_at
995
+ # @return [String, nil]
996
+ attr_accessor :last_event_at
997
+ # @return [String]
998
+ attr_accessor :computed_at
999
+
1000
+ # @param email_id [String], subject [String], from_address [String], topic_id [String, nil], status [String], delivered [Boolean], opened [Boolean], clicked [Boolean], total_clicks [Integer], bounced [Boolean], complained [Boolean], unsubscribed [Boolean], read_engaged [Boolean], read_time_seconds [Float, nil], read_category [String, nil], sent_at [String, nil], last_event_at [String, nil], computed_at [String]
1001
+ def initialize(email_id: , subject: , from_address: , topic_id: , status: , delivered: , opened: , clicked: , total_clicks: , bounced: , complained: , unsubscribed: , read_engaged: , read_time_seconds: , read_category: , sent_at: , last_event_at: , computed_at: )
1002
+ @email_id = email_id
1003
+ @subject = subject
1004
+ @from_address = from_address
1005
+ @topic_id = topic_id
1006
+ @status = status
1007
+ @delivered = delivered
1008
+ @opened = opened
1009
+ @clicked = clicked
1010
+ @total_clicks = total_clicks
1011
+ @bounced = bounced
1012
+ @complained = complained
1013
+ @unsubscribed = unsubscribed
1014
+ @read_engaged = read_engaged
1015
+ @read_time_seconds = read_time_seconds
1016
+ @read_category = read_category
1017
+ @sent_at = sent_at
1018
+ @last_event_at = last_event_at
1019
+ @computed_at = computed_at
1020
+ end
1021
+
1022
+ # @return [Hash] a hash representation of this object
1023
+ def to_h
1024
+ {
1025
+ email_id: @email_id,
1026
+ subject: @subject,
1027
+ from_address: @from_address,
1028
+ topic_id: @topic_id,
1029
+ status: @status,
1030
+ delivered: @delivered,
1031
+ opened: @opened,
1032
+ clicked: @clicked,
1033
+ total_clicks: @total_clicks,
1034
+ bounced: @bounced,
1035
+ complained: @complained,
1036
+ unsubscribed: @unsubscribed,
1037
+ read_engaged: @read_engaged,
1038
+ read_time_seconds: @read_time_seconds,
1039
+ read_category: @read_category,
1040
+ sent_at: @sent_at,
1041
+ last_event_at: @last_event_at,
1042
+ computed_at: @computed_at,
1043
+ }.compact
1044
+ end
1045
+
1046
+ # Create an instance from a parsed JSON hash.
1047
+ # @param attributes [Hash]
1048
+ # @return [EmailPerformanceResponse]
1049
+ def self.from_json(attributes)
1050
+ return nil unless attributes.is_a?(Hash)
1051
+
1052
+ new(
1053
+ email_id: attributes.key?("emailId") ? attributes["emailId"] : attributes[:email_id],
1054
+ subject: attributes.key?("subject") ? attributes["subject"] : attributes[:subject],
1055
+ from_address: attributes.key?("fromAddress") ? attributes["fromAddress"] : attributes[:from_address],
1056
+ topic_id: attributes.key?("topicId") ? attributes["topicId"] : attributes[:topic_id],
1057
+ status: attributes.key?("status") ? attributes["status"] : attributes[:status],
1058
+ delivered: attributes.key?("delivered") ? attributes["delivered"] : attributes[:delivered],
1059
+ opened: attributes.key?("opened") ? attributes["opened"] : attributes[:opened],
1060
+ clicked: attributes.key?("clicked") ? attributes["clicked"] : attributes[:clicked],
1061
+ total_clicks: attributes.key?("totalClicks") ? attributes["totalClicks"] : attributes[:total_clicks],
1062
+ bounced: attributes.key?("bounced") ? attributes["bounced"] : attributes[:bounced],
1063
+ complained: attributes.key?("complained") ? attributes["complained"] : attributes[:complained],
1064
+ unsubscribed: attributes.key?("unsubscribed") ? attributes["unsubscribed"] : attributes[:unsubscribed],
1065
+ read_engaged: attributes.key?("readEngaged") ? attributes["readEngaged"] : attributes[:read_engaged],
1066
+ read_time_seconds: attributes.key?("readTimeSeconds") ? attributes["readTimeSeconds"] : attributes[:read_time_seconds],
1067
+ read_category: attributes.key?("readCategory") ? attributes["readCategory"] : attributes[:read_category],
1068
+ sent_at: attributes.key?("sentAt") ? attributes["sentAt"] : attributes[:sent_at],
1069
+ last_event_at: attributes.key?("lastEventAt") ? attributes["lastEventAt"] : attributes[:last_event_at],
1070
+ computed_at: attributes.key?("computedAt") ? attributes["computedAt"] : attributes[:computed_at],
1071
+ )
1072
+ end
1073
+ end
1074
+
1075
+ # Schema type: EmailReadScrollAnalyticsResponse
1076
+ class EmailReadScrollAnalyticsResponse
1077
+ # @return [String]
1078
+ attr_accessor :email_id
1079
+ # @return [String]
1080
+ attr_accessor :subject
1081
+ # @return [String]
1082
+ attr_accessor :computed_at
1083
+ # @return [Boolean]
1084
+ attr_accessor :read_engaged
1085
+ # @return [Float, nil]
1086
+ attr_accessor :read_time_seconds
1087
+ # @return [String, nil]
1088
+ attr_accessor :read_category
1089
+ # @return [String, nil]
1090
+ attr_accessor :mail_client
1091
+ # @return [String, nil]
1092
+ attr_accessor :device_type
1093
+ # @return [String, nil]
1094
+ attr_accessor :os
1095
+ # @return [String, nil]
1096
+ attr_accessor :read_engaged_at
1097
+ # @return [Boolean]
1098
+ attr_accessor :short_email
1099
+ # @return [Integer]
1100
+ attr_accessor :depth25_count
1101
+ # @return [Integer]
1102
+ attr_accessor :depth50_count
1103
+ # @return [Integer]
1104
+ attr_accessor :depth75_count
1105
+ # @return [Integer]
1106
+ attr_accessor :depth100_count
1107
+ # @return [Integer, nil]
1108
+ attr_accessor :max_depth_pct
1109
+ # @return [Float, nil]
1110
+ attr_accessor :depth25_rate
1111
+ # @return [Float, nil]
1112
+ attr_accessor :depth50_rate
1113
+ # @return [Float, nil]
1114
+ attr_accessor :depth75_rate
1115
+ # @return [Float, nil]
1116
+ attr_accessor :depth100_rate
1117
+
1118
+ # @param email_id [String], subject [String], computed_at [String], read_engaged [Boolean], read_time_seconds [Float, nil], read_category [String, nil], mail_client [String, nil], device_type [String, nil], os [String, nil], read_engaged_at [String, nil], short_email [Boolean], depth25_count [Integer], depth50_count [Integer], depth75_count [Integer], depth100_count [Integer], max_depth_pct [Integer, nil], depth25_rate [Float, nil], depth50_rate [Float, nil], depth75_rate [Float, nil], depth100_rate [Float, nil]
1119
+ def initialize(email_id: , subject: , computed_at: , read_engaged: , read_time_seconds: , read_category: , mail_client: , device_type: , os: , read_engaged_at: , short_email: , depth25_count: , depth50_count: , depth75_count: , depth100_count: , max_depth_pct: , depth25_rate: , depth50_rate: , depth75_rate: , depth100_rate: )
1120
+ @email_id = email_id
1121
+ @subject = subject
1122
+ @computed_at = computed_at
1123
+ @read_engaged = read_engaged
1124
+ @read_time_seconds = read_time_seconds
1125
+ @read_category = read_category
1126
+ @mail_client = mail_client
1127
+ @device_type = device_type
1128
+ @os = os
1129
+ @read_engaged_at = read_engaged_at
1130
+ @short_email = short_email
1131
+ @depth25_count = depth25_count
1132
+ @depth50_count = depth50_count
1133
+ @depth75_count = depth75_count
1134
+ @depth100_count = depth100_count
1135
+ @max_depth_pct = max_depth_pct
1136
+ @depth25_rate = depth25_rate
1137
+ @depth50_rate = depth50_rate
1138
+ @depth75_rate = depth75_rate
1139
+ @depth100_rate = depth100_rate
1140
+ end
1141
+
1142
+ # @return [Hash] a hash representation of this object
1143
+ def to_h
1144
+ {
1145
+ email_id: @email_id,
1146
+ subject: @subject,
1147
+ computed_at: @computed_at,
1148
+ read_engaged: @read_engaged,
1149
+ read_time_seconds: @read_time_seconds,
1150
+ read_category: @read_category,
1151
+ mail_client: @mail_client,
1152
+ device_type: @device_type,
1153
+ os: @os,
1154
+ read_engaged_at: @read_engaged_at,
1155
+ short_email: @short_email,
1156
+ depth25_count: @depth25_count,
1157
+ depth50_count: @depth50_count,
1158
+ depth75_count: @depth75_count,
1159
+ depth100_count: @depth100_count,
1160
+ max_depth_pct: @max_depth_pct,
1161
+ depth25_rate: @depth25_rate,
1162
+ depth50_rate: @depth50_rate,
1163
+ depth75_rate: @depth75_rate,
1164
+ depth100_rate: @depth100_rate,
1165
+ }.compact
1166
+ end
1167
+
1168
+ # Create an instance from a parsed JSON hash.
1169
+ # @param attributes [Hash]
1170
+ # @return [EmailReadScrollAnalyticsResponse]
1171
+ def self.from_json(attributes)
1172
+ return nil unless attributes.is_a?(Hash)
1173
+
1174
+ new(
1175
+ email_id: attributes.key?("emailId") ? attributes["emailId"] : attributes[:email_id],
1176
+ subject: attributes.key?("subject") ? attributes["subject"] : attributes[:subject],
1177
+ computed_at: attributes.key?("computedAt") ? attributes["computedAt"] : attributes[:computed_at],
1178
+ read_engaged: attributes.key?("readEngaged") ? attributes["readEngaged"] : attributes[:read_engaged],
1179
+ read_time_seconds: attributes.key?("readTimeSeconds") ? attributes["readTimeSeconds"] : attributes[:read_time_seconds],
1180
+ read_category: attributes.key?("readCategory") ? attributes["readCategory"] : attributes[:read_category],
1181
+ mail_client: attributes.key?("mailClient") ? attributes["mailClient"] : attributes[:mail_client],
1182
+ device_type: attributes.key?("deviceType") ? attributes["deviceType"] : attributes[:device_type],
1183
+ os: attributes.key?("os") ? attributes["os"] : attributes[:os],
1184
+ read_engaged_at: attributes.key?("readEngagedAt") ? attributes["readEngagedAt"] : attributes[:read_engaged_at],
1185
+ short_email: attributes.key?("shortEmail") ? attributes["shortEmail"] : attributes[:short_email],
1186
+ depth25_count: attributes.key?("depth25Count") ? attributes["depth25Count"] : attributes[:depth25_count],
1187
+ depth50_count: attributes.key?("depth50Count") ? attributes["depth50Count"] : attributes[:depth50_count],
1188
+ depth75_count: attributes.key?("depth75Count") ? attributes["depth75Count"] : attributes[:depth75_count],
1189
+ depth100_count: attributes.key?("depth100Count") ? attributes["depth100Count"] : attributes[:depth100_count],
1190
+ max_depth_pct: attributes.key?("maxDepthPct") ? attributes["maxDepthPct"] : attributes[:max_depth_pct],
1191
+ depth25_rate: attributes.key?("depth25Rate") ? attributes["depth25Rate"] : attributes[:depth25_rate],
1192
+ depth50_rate: attributes.key?("depth50Rate") ? attributes["depth50Rate"] : attributes[:depth50_rate],
1193
+ depth75_rate: attributes.key?("depth75Rate") ? attributes["depth75Rate"] : attributes[:depth75_rate],
1194
+ depth100_rate: attributes.key?("depth100Rate") ? attributes["depth100Rate"] : attributes[:depth100_rate],
1195
+ )
1196
+ end
1197
+ end
1198
+
1199
+ # Schema type: ProjectMetricsSummaryResponse
1200
+ class ProjectMetricsSummaryResponse
1201
+ # @return [String]
1202
+ attr_accessor :project_id
1203
+ # @return [MetricsWindowResponse]
1204
+ attr_accessor :window
1205
+ # @return [Integer]
1206
+ attr_accessor :sent
1207
+ # @return [Integer]
1208
+ attr_accessor :delivered
1209
+ # @return [Integer]
1210
+ attr_accessor :opened
1211
+ # @return [Integer]
1212
+ attr_accessor :clicked
1213
+ # @return [Integer]
1214
+ attr_accessor :bounced
1215
+ # @return [Integer]
1216
+ attr_accessor :complained
1217
+ # @return [Integer]
1218
+ attr_accessor :failed
1219
+ # @return [Integer]
1220
+ attr_accessor :unsubscribed
1221
+ # @return [Integer]
1222
+ attr_accessor :read_engaged
1223
+ # @return [Float]
1224
+ attr_accessor :delivery_rate
1225
+ # @return [Float]
1226
+ attr_accessor :open_rate
1227
+ # @return [Float]
1228
+ attr_accessor :click_rate
1229
+ # @return [Float]
1230
+ attr_accessor :bounce_rate
1231
+ # @return [Float]
1232
+ attr_accessor :complaint_rate
1233
+ # @return [Float]
1234
+ attr_accessor :read_engagement_rate
1235
+
1236
+ # @param project_id [String], window [MetricsWindowResponse], sent [Integer], delivered [Integer], opened [Integer], clicked [Integer], bounced [Integer], complained [Integer], failed [Integer], unsubscribed [Integer], read_engaged [Integer], delivery_rate [Float], open_rate [Float], click_rate [Float], bounce_rate [Float], complaint_rate [Float], read_engagement_rate [Float]
1237
+ def initialize(project_id: , window: , sent: , delivered: , opened: , clicked: , bounced: , complained: , failed: , unsubscribed: , read_engaged: , delivery_rate: , open_rate: , click_rate: , bounce_rate: , complaint_rate: , read_engagement_rate: )
1238
+ @project_id = project_id
1239
+ @window = window
1240
+ @sent = sent
1241
+ @delivered = delivered
1242
+ @opened = opened
1243
+ @clicked = clicked
1244
+ @bounced = bounced
1245
+ @complained = complained
1246
+ @failed = failed
1247
+ @unsubscribed = unsubscribed
1248
+ @read_engaged = read_engaged
1249
+ @delivery_rate = delivery_rate
1250
+ @open_rate = open_rate
1251
+ @click_rate = click_rate
1252
+ @bounce_rate = bounce_rate
1253
+ @complaint_rate = complaint_rate
1254
+ @read_engagement_rate = read_engagement_rate
1255
+ end
1256
+
1257
+ # @return [Hash] a hash representation of this object
1258
+ def to_h
1259
+ {
1260
+ project_id: @project_id,
1261
+ window: @window,
1262
+ sent: @sent,
1263
+ delivered: @delivered,
1264
+ opened: @opened,
1265
+ clicked: @clicked,
1266
+ bounced: @bounced,
1267
+ complained: @complained,
1268
+ failed: @failed,
1269
+ unsubscribed: @unsubscribed,
1270
+ read_engaged: @read_engaged,
1271
+ delivery_rate: @delivery_rate,
1272
+ open_rate: @open_rate,
1273
+ click_rate: @click_rate,
1274
+ bounce_rate: @bounce_rate,
1275
+ complaint_rate: @complaint_rate,
1276
+ read_engagement_rate: @read_engagement_rate,
1277
+ }.compact
1278
+ end
1279
+
1280
+ # Create an instance from a parsed JSON hash.
1281
+ # @param attributes [Hash]
1282
+ # @return [ProjectMetricsSummaryResponse]
1283
+ def self.from_json(attributes)
1284
+ return nil unless attributes.is_a?(Hash)
1285
+
1286
+ new(
1287
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
1288
+ window: attributes.key?("window") ? attributes["window"] : attributes[:window],
1289
+ sent: attributes.key?("sent") ? attributes["sent"] : attributes[:sent],
1290
+ delivered: attributes.key?("delivered") ? attributes["delivered"] : attributes[:delivered],
1291
+ opened: attributes.key?("opened") ? attributes["opened"] : attributes[:opened],
1292
+ clicked: attributes.key?("clicked") ? attributes["clicked"] : attributes[:clicked],
1293
+ bounced: attributes.key?("bounced") ? attributes["bounced"] : attributes[:bounced],
1294
+ complained: attributes.key?("complained") ? attributes["complained"] : attributes[:complained],
1295
+ failed: attributes.key?("failed") ? attributes["failed"] : attributes[:failed],
1296
+ unsubscribed: attributes.key?("unsubscribed") ? attributes["unsubscribed"] : attributes[:unsubscribed],
1297
+ read_engaged: attributes.key?("readEngaged") ? attributes["readEngaged"] : attributes[:read_engaged],
1298
+ delivery_rate: attributes.key?("deliveryRate") ? attributes["deliveryRate"] : attributes[:delivery_rate],
1299
+ open_rate: attributes.key?("openRate") ? attributes["openRate"] : attributes[:open_rate],
1300
+ click_rate: attributes.key?("clickRate") ? attributes["clickRate"] : attributes[:click_rate],
1301
+ bounce_rate: attributes.key?("bounceRate") ? attributes["bounceRate"] : attributes[:bounce_rate],
1302
+ complaint_rate: attributes.key?("complaintRate") ? attributes["complaintRate"] : attributes[:complaint_rate],
1303
+ read_engagement_rate: attributes.key?("readEngagementRate") ? attributes["readEngagementRate"] : attributes[:read_engagement_rate],
1304
+ )
1305
+ end
1306
+ end
1307
+
1308
+ # Schema type: ProjectTimelineBucketResponse
1309
+ class ProjectTimelineBucketResponse
1310
+ # @return [String]
1311
+ attr_accessor :bucket
1312
+ # @return [String]
1313
+ attr_accessor :type
1314
+ # @return [Integer]
1315
+ attr_accessor :count
1316
+
1317
+ # @param bucket [String], type [String], count [Integer]
1318
+ def initialize(bucket: , type: , count: )
1319
+ @bucket = bucket
1320
+ @type = type
1321
+ @count = count
1322
+ end
1323
+
1324
+ # @return [Hash] a hash representation of this object
1325
+ def to_h
1326
+ {
1327
+ bucket: @bucket,
1328
+ type: @type,
1329
+ count: @count,
1330
+ }.compact
1331
+ end
1332
+
1333
+ # Create an instance from a parsed JSON hash.
1334
+ # @param attributes [Hash]
1335
+ # @return [ProjectTimelineBucketResponse]
1336
+ def self.from_json(attributes)
1337
+ return nil unless attributes.is_a?(Hash)
1338
+
1339
+ new(
1340
+ bucket: attributes.key?("bucket") ? attributes["bucket"] : attributes[:bucket],
1341
+ type: attributes.key?("type") ? attributes["type"] : attributes[:type],
1342
+ count: attributes.key?("count") ? attributes["count"] : attributes[:count],
1343
+ )
1344
+ end
1345
+ end
1346
+
1347
+ # Schema type: ProjectMetricsTimelineResponse
1348
+ class ProjectMetricsTimelineResponse
1349
+ # @return [String]
1350
+ attr_accessor :project_id
1351
+ # @return [MetricsWindowResponse]
1352
+ attr_accessor :window
1353
+ # @return [String]
1354
+ attr_accessor :granularity
1355
+ # @return [String]
1356
+ attr_accessor :format
1357
+ # @return [Array<ProjectTimelineBucketResponse>]
1358
+ attr_accessor :buckets
1359
+
1360
+ # @param project_id [String], window [MetricsWindowResponse], granularity [String], format [String], buckets [Array<ProjectTimelineBucketResponse>]
1361
+ def initialize(project_id: , window: , granularity: , format: , buckets: )
1362
+ @project_id = project_id
1363
+ @window = window
1364
+ @granularity = granularity
1365
+ @format = format
1366
+ @buckets = buckets
1367
+ end
1368
+
1369
+ # @return [Hash] a hash representation of this object
1370
+ def to_h
1371
+ {
1372
+ project_id: @project_id,
1373
+ window: @window,
1374
+ granularity: @granularity,
1375
+ format: @format,
1376
+ buckets: @buckets,
1377
+ }.compact
1378
+ end
1379
+
1380
+ # Create an instance from a parsed JSON hash.
1381
+ # @param attributes [Hash]
1382
+ # @return [ProjectMetricsTimelineResponse]
1383
+ def self.from_json(attributes)
1384
+ return nil unless attributes.is_a?(Hash)
1385
+
1386
+ new(
1387
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
1388
+ window: attributes.key?("window") ? attributes["window"] : attributes[:window],
1389
+ granularity: attributes.key?("granularity") ? attributes["granularity"] : attributes[:granularity],
1390
+ format: attributes.key?("format") ? attributes["format"] : attributes[:format],
1391
+ buckets: attributes.key?("buckets") ? attributes["buckets"] : attributes[:buckets],
1392
+ )
1393
+ end
1394
+ end
1395
+
1396
+ # Schema type: AdvisorRecommendationDataResponse
1397
+ class AdvisorRecommendationDataResponse
1398
+ # @return [Float, nil]
1399
+ attr_accessor :bounce_rate
1400
+ # @return [Integer, nil]
1401
+ attr_accessor :bounced
1402
+ # @return [Integer, nil]
1403
+ attr_accessor :accepted
1404
+ # @return [Float, nil]
1405
+ attr_accessor :complaint_rate
1406
+ # @return [Integer, nil]
1407
+ attr_accessor :accepted24h
1408
+ # @return [Integer, nil]
1409
+ attr_accessor :avg_daily_accepted7d
1410
+ # @return [Integer, nil]
1411
+ attr_accessor :days_since_last_send
1412
+ # @return [Float, nil]
1413
+ attr_accessor :reported_open_rate
1414
+ # @return [Float, nil]
1415
+ attr_accessor :adjusted_open_rate
1416
+ # @return [Float, nil]
1417
+ attr_accessor :proxy_rate
1418
+ # @return [Integer, nil]
1419
+ attr_accessor :proxy_opens
1420
+ # @return [Integer, nil]
1421
+ attr_accessor :total_opens
1422
+ # @return [Float, nil]
1423
+ attr_accessor :human_open_rate
1424
+ # @return [Integer, nil]
1425
+ attr_accessor :delivered
1426
+ # @return [Float, nil]
1427
+ attr_accessor :unsub_rate
1428
+ # @return [Integer, nil]
1429
+ attr_accessor :unsubscribed
1430
+ # @return [Float, nil]
1431
+ attr_accessor :dmarc_alignment_failure_rate7d
1432
+ # @return [String, nil]
1433
+ attr_accessor :dmarc_domain
1434
+ # @return [String, nil]
1435
+ attr_accessor :dmarc_current_policy
1436
+ # @return [String, nil]
1437
+ attr_accessor :dmarc_recommended_policy
1438
+ # @return [Integer, nil]
1439
+ attr_accessor :dmarc_observed_messages
1440
+ # @return [Integer, nil]
1441
+ attr_accessor :dmarc_aligned_messages
1442
+ # @return [Float, nil]
1443
+ attr_accessor :dmarc_accounted_rate
1444
+ # @return [Integer, nil]
1445
+ attr_accessor :dmarc_unknown_messages
1446
+ # @return [Integer, nil]
1447
+ attr_accessor :dmarc_unknown_sources
1448
+ # @return [Integer, nil]
1449
+ attr_accessor :dmarc_reporting_days
1450
+
1451
+ # @param bounce_rate [Float, nil], bounced [Integer, nil], accepted [Integer, nil], complaint_rate [Float, nil], accepted24h [Integer, nil], avg_daily_accepted7d [Integer, nil], days_since_last_send [Integer, nil], reported_open_rate [Float, nil], adjusted_open_rate [Float, nil], proxy_rate [Float, nil], proxy_opens [Integer, nil], total_opens [Integer, nil], human_open_rate [Float, nil], delivered [Integer, nil], unsub_rate [Float, nil], unsubscribed [Integer, nil], dmarc_alignment_failure_rate7d [Float, nil], dmarc_domain [String, nil], dmarc_current_policy [String, nil], dmarc_recommended_policy [String, nil], dmarc_observed_messages [Integer, nil], dmarc_aligned_messages [Integer, nil], dmarc_accounted_rate [Float, nil], dmarc_unknown_messages [Integer, nil], dmarc_unknown_sources [Integer, nil], dmarc_reporting_days [Integer, nil]
1452
+ def initialize(bounce_rate: nil, bounced: nil, accepted: nil, complaint_rate: nil, accepted24h: nil, avg_daily_accepted7d: nil, days_since_last_send: nil, reported_open_rate: nil, adjusted_open_rate: nil, proxy_rate: nil, proxy_opens: nil, total_opens: nil, human_open_rate: nil, delivered: nil, unsub_rate: nil, unsubscribed: nil, dmarc_alignment_failure_rate7d: nil, dmarc_domain: nil, dmarc_current_policy: nil, dmarc_recommended_policy: nil, dmarc_observed_messages: nil, dmarc_aligned_messages: nil, dmarc_accounted_rate: nil, dmarc_unknown_messages: nil, dmarc_unknown_sources: nil, dmarc_reporting_days: nil)
1453
+ @bounce_rate = bounce_rate
1454
+ @bounced = bounced
1455
+ @accepted = accepted
1456
+ @complaint_rate = complaint_rate
1457
+ @accepted24h = accepted24h
1458
+ @avg_daily_accepted7d = avg_daily_accepted7d
1459
+ @days_since_last_send = days_since_last_send
1460
+ @reported_open_rate = reported_open_rate
1461
+ @adjusted_open_rate = adjusted_open_rate
1462
+ @proxy_rate = proxy_rate
1463
+ @proxy_opens = proxy_opens
1464
+ @total_opens = total_opens
1465
+ @human_open_rate = human_open_rate
1466
+ @delivered = delivered
1467
+ @unsub_rate = unsub_rate
1468
+ @unsubscribed = unsubscribed
1469
+ @dmarc_alignment_failure_rate7d = dmarc_alignment_failure_rate7d
1470
+ @dmarc_domain = dmarc_domain
1471
+ @dmarc_current_policy = dmarc_current_policy
1472
+ @dmarc_recommended_policy = dmarc_recommended_policy
1473
+ @dmarc_observed_messages = dmarc_observed_messages
1474
+ @dmarc_aligned_messages = dmarc_aligned_messages
1475
+ @dmarc_accounted_rate = dmarc_accounted_rate
1476
+ @dmarc_unknown_messages = dmarc_unknown_messages
1477
+ @dmarc_unknown_sources = dmarc_unknown_sources
1478
+ @dmarc_reporting_days = dmarc_reporting_days
1479
+ end
1480
+
1481
+ # @return [Hash] a hash representation of this object
1482
+ def to_h
1483
+ {
1484
+ bounce_rate: @bounce_rate,
1485
+ bounced: @bounced,
1486
+ accepted: @accepted,
1487
+ complaint_rate: @complaint_rate,
1488
+ accepted24h: @accepted24h,
1489
+ avg_daily_accepted7d: @avg_daily_accepted7d,
1490
+ days_since_last_send: @days_since_last_send,
1491
+ reported_open_rate: @reported_open_rate,
1492
+ adjusted_open_rate: @adjusted_open_rate,
1493
+ proxy_rate: @proxy_rate,
1494
+ proxy_opens: @proxy_opens,
1495
+ total_opens: @total_opens,
1496
+ human_open_rate: @human_open_rate,
1497
+ delivered: @delivered,
1498
+ unsub_rate: @unsub_rate,
1499
+ unsubscribed: @unsubscribed,
1500
+ dmarc_alignment_failure_rate7d: @dmarc_alignment_failure_rate7d,
1501
+ dmarc_domain: @dmarc_domain,
1502
+ dmarc_current_policy: @dmarc_current_policy,
1503
+ dmarc_recommended_policy: @dmarc_recommended_policy,
1504
+ dmarc_observed_messages: @dmarc_observed_messages,
1505
+ dmarc_aligned_messages: @dmarc_aligned_messages,
1506
+ dmarc_accounted_rate: @dmarc_accounted_rate,
1507
+ dmarc_unknown_messages: @dmarc_unknown_messages,
1508
+ dmarc_unknown_sources: @dmarc_unknown_sources,
1509
+ dmarc_reporting_days: @dmarc_reporting_days,
1510
+ }.compact
1511
+ end
1512
+
1513
+ # Create an instance from a parsed JSON hash.
1514
+ # @param attributes [Hash]
1515
+ # @return [AdvisorRecommendationDataResponse]
1516
+ def self.from_json(attributes)
1517
+ return nil unless attributes.is_a?(Hash)
1518
+
1519
+ new(
1520
+ bounce_rate: attributes.key?("bounceRate") ? attributes["bounceRate"] : attributes[:bounce_rate],
1521
+ bounced: attributes.key?("bounced") ? attributes["bounced"] : attributes[:bounced],
1522
+ accepted: attributes.key?("accepted") ? attributes["accepted"] : attributes[:accepted],
1523
+ complaint_rate: attributes.key?("complaintRate") ? attributes["complaintRate"] : attributes[:complaint_rate],
1524
+ accepted24h: attributes.key?("accepted24h") ? attributes["accepted24h"] : attributes[:accepted24h],
1525
+ avg_daily_accepted7d: attributes.key?("avgDailyAccepted7d") ? attributes["avgDailyAccepted7d"] : attributes[:avg_daily_accepted7d],
1526
+ days_since_last_send: attributes.key?("daysSinceLastSend") ? attributes["daysSinceLastSend"] : attributes[:days_since_last_send],
1527
+ reported_open_rate: attributes.key?("reportedOpenRate") ? attributes["reportedOpenRate"] : attributes[:reported_open_rate],
1528
+ adjusted_open_rate: attributes.key?("adjustedOpenRate") ? attributes["adjustedOpenRate"] : attributes[:adjusted_open_rate],
1529
+ proxy_rate: attributes.key?("proxyRate") ? attributes["proxyRate"] : attributes[:proxy_rate],
1530
+ proxy_opens: attributes.key?("proxyOpens") ? attributes["proxyOpens"] : attributes[:proxy_opens],
1531
+ total_opens: attributes.key?("totalOpens") ? attributes["totalOpens"] : attributes[:total_opens],
1532
+ human_open_rate: attributes.key?("humanOpenRate") ? attributes["humanOpenRate"] : attributes[:human_open_rate],
1533
+ delivered: attributes.key?("delivered") ? attributes["delivered"] : attributes[:delivered],
1534
+ unsub_rate: attributes.key?("unsubRate") ? attributes["unsubRate"] : attributes[:unsub_rate],
1535
+ unsubscribed: attributes.key?("unsubscribed") ? attributes["unsubscribed"] : attributes[:unsubscribed],
1536
+ dmarc_alignment_failure_rate7d: attributes.key?("dmarcAlignmentFailureRate7d") ? attributes["dmarcAlignmentFailureRate7d"] : attributes[:dmarc_alignment_failure_rate7d],
1537
+ dmarc_domain: attributes.key?("dmarcDomain") ? attributes["dmarcDomain"] : attributes[:dmarc_domain],
1538
+ dmarc_current_policy: attributes.key?("dmarcCurrentPolicy") ? attributes["dmarcCurrentPolicy"] : attributes[:dmarc_current_policy],
1539
+ dmarc_recommended_policy: attributes.key?("dmarcRecommendedPolicy") ? attributes["dmarcRecommendedPolicy"] : attributes[:dmarc_recommended_policy],
1540
+ dmarc_observed_messages: attributes.key?("dmarcObservedMessages") ? attributes["dmarcObservedMessages"] : attributes[:dmarc_observed_messages],
1541
+ dmarc_aligned_messages: attributes.key?("dmarcAlignedMessages") ? attributes["dmarcAlignedMessages"] : attributes[:dmarc_aligned_messages],
1542
+ dmarc_accounted_rate: attributes.key?("dmarcAccountedRate") ? attributes["dmarcAccountedRate"] : attributes[:dmarc_accounted_rate],
1543
+ dmarc_unknown_messages: attributes.key?("dmarcUnknownMessages") ? attributes["dmarcUnknownMessages"] : attributes[:dmarc_unknown_messages],
1544
+ dmarc_unknown_sources: attributes.key?("dmarcUnknownSources") ? attributes["dmarcUnknownSources"] : attributes[:dmarc_unknown_sources],
1545
+ dmarc_reporting_days: attributes.key?("dmarcReportingDays") ? attributes["dmarcReportingDays"] : attributes[:dmarc_reporting_days],
1546
+ )
1547
+ end
1548
+ end
1549
+
1550
+ # Schema type: AdvisorRecommendationResponse
1551
+ class AdvisorRecommendationResponse
1552
+ # @return [String]
1553
+ attr_accessor :code
1554
+ # @return [String]
1555
+ attr_accessor :severity
1556
+ # @return [String]
1557
+ attr_accessor :title
1558
+ # @return [String]
1559
+ attr_accessor :message
1560
+ # @return [AdvisorRecommendationDataResponse, nil]
1561
+ attr_accessor :data
1562
+
1563
+ # @param code [String], severity [String], title [String], message [String], data [AdvisorRecommendationDataResponse, nil]
1564
+ def initialize(code: , severity: , title: , message: , data: nil)
1565
+ @code = code
1566
+ @severity = severity
1567
+ @title = title
1568
+ @message = message
1569
+ @data = data
1570
+ end
1571
+
1572
+ # @return [Hash] a hash representation of this object
1573
+ def to_h
1574
+ {
1575
+ code: @code,
1576
+ severity: @severity,
1577
+ title: @title,
1578
+ message: @message,
1579
+ data: @data,
1580
+ }.compact
1581
+ end
1582
+
1583
+ # Create an instance from a parsed JSON hash.
1584
+ # @param attributes [Hash]
1585
+ # @return [AdvisorRecommendationResponse]
1586
+ def self.from_json(attributes)
1587
+ return nil unless attributes.is_a?(Hash)
1588
+
1589
+ new(
1590
+ code: attributes.key?("code") ? attributes["code"] : attributes[:code],
1591
+ severity: attributes.key?("severity") ? attributes["severity"] : attributes[:severity],
1592
+ title: attributes.key?("title") ? attributes["title"] : attributes[:title],
1593
+ message: attributes.key?("message") ? attributes["message"] : attributes[:message],
1594
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
1595
+ )
1596
+ end
1597
+ end
1598
+
1599
+ # Schema type: AdvisorReportResponse
1600
+ class AdvisorReportResponse
1601
+ # @return [String]
1602
+ attr_accessor :project_id
1603
+ # @return [String]
1604
+ attr_accessor :generated_at
1605
+ # @return [Integer]
1606
+ attr_accessor :score
1607
+ # @return [Array<AdvisorRecommendationResponse>]
1608
+ attr_accessor :recommendations
1609
+
1610
+ # @param project_id [String], generated_at [String], score [Integer], recommendations [Array<AdvisorRecommendationResponse>]
1611
+ def initialize(project_id: , generated_at: , score: , recommendations: )
1612
+ @project_id = project_id
1613
+ @generated_at = generated_at
1614
+ @score = score
1615
+ @recommendations = recommendations
1616
+ end
1617
+
1618
+ # @return [Hash] a hash representation of this object
1619
+ def to_h
1620
+ {
1621
+ project_id: @project_id,
1622
+ generated_at: @generated_at,
1623
+ score: @score,
1624
+ recommendations: @recommendations,
1625
+ }.compact
1626
+ end
1627
+
1628
+ # Create an instance from a parsed JSON hash.
1629
+ # @param attributes [Hash]
1630
+ # @return [AdvisorReportResponse]
1631
+ def self.from_json(attributes)
1632
+ return nil unless attributes.is_a?(Hash)
1633
+
1634
+ new(
1635
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
1636
+ generated_at: attributes.key?("generatedAt") ? attributes["generatedAt"] : attributes[:generated_at],
1637
+ score: attributes.key?("score") ? attributes["score"] : attributes[:score],
1638
+ recommendations: attributes.key?("recommendations") ? attributes["recommendations"] : attributes[:recommendations],
1639
+ )
1640
+ end
1641
+ end
1642
+
1643
+ # Schema type: SuppressionResponse
1644
+ class SuppressionResponse
1645
+ # @return [String]
1646
+ attr_accessor :id
1647
+ # @return [String]
1648
+ attr_accessor :project_id
1649
+ # @return [String]
1650
+ attr_accessor :email
1651
+ # @return [String]
1652
+ attr_accessor :reason
1653
+ # @return [String]
1654
+ attr_accessor :created_at
1655
+ # @return [String, nil]
1656
+ attr_accessor :contact_id
1657
+
1658
+ # @param id [String], project_id [String], email [String], reason [String], created_at [String], contact_id [String, nil]
1659
+ def initialize(id: , project_id: , email: , reason: , created_at: , contact_id: nil)
1660
+ @id = id
1661
+ @project_id = project_id
1662
+ @email = email
1663
+ @reason = reason
1664
+ @created_at = created_at
1665
+ @contact_id = contact_id
1666
+ end
1667
+
1668
+ # @return [Hash] a hash representation of this object
1669
+ def to_h
1670
+ {
1671
+ id: @id,
1672
+ project_id: @project_id,
1673
+ email: @email,
1674
+ reason: @reason,
1675
+ created_at: @created_at,
1676
+ contact_id: @contact_id,
1677
+ }.compact
1678
+ end
1679
+
1680
+ # Create an instance from a parsed JSON hash.
1681
+ # @param attributes [Hash]
1682
+ # @return [SuppressionResponse]
1683
+ def self.from_json(attributes)
1684
+ return nil unless attributes.is_a?(Hash)
1685
+
1686
+ new(
1687
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
1688
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
1689
+ email: attributes.key?("email") ? attributes["email"] : attributes[:email],
1690
+ reason: attributes.key?("reason") ? attributes["reason"] : attributes[:reason],
1691
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
1692
+ contact_id: attributes.key?("contactId") ? attributes["contactId"] : attributes[:contact_id],
1693
+ )
1694
+ end
1695
+ end
1696
+
1697
+ # Schema type: PageInfo
1698
+ class PageInfo
1699
+ # @return [Integer]
1700
+ attr_accessor :page
1701
+ # @return [Integer]
1702
+ attr_accessor :size
1703
+ # @return [Integer]
1704
+ attr_accessor :total
1705
+ # @return [Integer]
1706
+ attr_accessor :total_pages
1707
+ # @return [Boolean]
1708
+ attr_accessor :has_next_page
1709
+ # @return [Boolean]
1710
+ attr_accessor :has_previous_page
1711
+
1712
+ # @param page [Integer], size [Integer], total [Integer], total_pages [Integer], has_next_page [Boolean], has_previous_page [Boolean]
1713
+ def initialize(page: , size: , total: , total_pages: , has_next_page: , has_previous_page: )
1714
+ @page = page
1715
+ @size = size
1716
+ @total = total
1717
+ @total_pages = total_pages
1718
+ @has_next_page = has_next_page
1719
+ @has_previous_page = has_previous_page
1720
+ end
1721
+
1722
+ # @return [Hash] a hash representation of this object
1723
+ def to_h
1724
+ {
1725
+ page: @page,
1726
+ size: @size,
1727
+ total: @total,
1728
+ total_pages: @total_pages,
1729
+ has_next_page: @has_next_page,
1730
+ has_previous_page: @has_previous_page,
1731
+ }.compact
1732
+ end
1733
+
1734
+ # Create an instance from a parsed JSON hash.
1735
+ # @param attributes [Hash]
1736
+ # @return [PageInfo]
1737
+ def self.from_json(attributes)
1738
+ return nil unless attributes.is_a?(Hash)
1739
+
1740
+ new(
1741
+ page: attributes.key?("page") ? attributes["page"] : attributes[:page],
1742
+ size: attributes.key?("size") ? attributes["size"] : attributes[:size],
1743
+ total: attributes.key?("total") ? attributes["total"] : attributes[:total],
1744
+ total_pages: attributes.key?("totalPages") ? attributes["totalPages"] : attributes[:total_pages],
1745
+ has_next_page: attributes.key?("hasNextPage") ? attributes["hasNextPage"] : attributes[:has_next_page],
1746
+ has_previous_page: attributes.key?("hasPreviousPage") ? attributes["hasPreviousPage"] : attributes[:has_previous_page],
1747
+ )
1748
+ end
1749
+ end
1750
+
1751
+ # Schema type: SuppressionPageResponse
1752
+ class SuppressionPageResponse
1753
+ # @return [Array<SuppressionResponse>]
1754
+ attr_accessor :data
1755
+ # @return [PageInfo]
1756
+ attr_accessor :page
1757
+
1758
+ # @param data [Array<SuppressionResponse>], page [PageInfo]
1759
+ def initialize(data: , page: )
1760
+ @data = data
1761
+ @page = page
1762
+ end
1763
+
1764
+ # @return [Hash] a hash representation of this object
1765
+ def to_h
1766
+ {
1767
+ data: @data,
1768
+ page: @page,
1769
+ }.compact
1770
+ end
1771
+
1772
+ # Create an instance from a parsed JSON hash.
1773
+ # @param attributes [Hash]
1774
+ # @return [SuppressionPageResponse]
1775
+ def self.from_json(attributes)
1776
+ return nil unless attributes.is_a?(Hash)
1777
+
1778
+ new(
1779
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
1780
+ page: attributes.key?("page") ? attributes["page"] : attributes[:page],
1781
+ )
1782
+ end
1783
+ end
1784
+
1785
+ # Schema type: AddSuppressionBody
1786
+ class AddSuppressionBody
1787
+ # @return [String]
1788
+ attr_accessor :email
1789
+
1790
+ # @param email [String]
1791
+ def initialize(email: )
1792
+ @email = email
1793
+ end
1794
+
1795
+ # @return [Hash] a hash representation of this object
1796
+ def to_h
1797
+ {
1798
+ email: @email,
1799
+ }.compact
1800
+ end
1801
+
1802
+ # Create an instance from a parsed JSON hash.
1803
+ # @param attributes [Hash]
1804
+ # @return [AddSuppressionBody]
1805
+ def self.from_json(attributes)
1806
+ return nil unless attributes.is_a?(Hash)
1807
+
1808
+ new(
1809
+ email: attributes.key?("email") ? attributes["email"] : attributes[:email],
1810
+ )
1811
+ end
1812
+ end
1813
+
1814
+ # Schema type: SuppressionImportRowSerializable
1815
+ class SuppressionImportRowSerializable
1816
+ # @return [String]
1817
+ attr_accessor :email
1818
+ # @return [String, nil]
1819
+ attr_accessor :reason
1820
+
1821
+ # @param email [String], reason [String, nil]
1822
+ def initialize(email: , reason: nil)
1823
+ @email = email
1824
+ @reason = reason
1825
+ end
1826
+
1827
+ # @return [Hash] a hash representation of this object
1828
+ def to_h
1829
+ {
1830
+ email: @email,
1831
+ reason: @reason,
1832
+ }.compact
1833
+ end
1834
+
1835
+ # Create an instance from a parsed JSON hash.
1836
+ # @param attributes [Hash]
1837
+ # @return [SuppressionImportRowSerializable]
1838
+ def self.from_json(attributes)
1839
+ return nil unless attributes.is_a?(Hash)
1840
+
1841
+ new(
1842
+ email: attributes.key?("email") ? attributes["email"] : attributes[:email],
1843
+ reason: attributes.key?("reason") ? attributes["reason"] : attributes[:reason],
1844
+ )
1845
+ end
1846
+ end
1847
+
1848
+ # Schema type: SuppressionImportBody
1849
+ class SuppressionImportBody
1850
+ # @return [Array<SuppressionImportRowSerializable>]
1851
+ attr_accessor :suppressions
1852
+
1853
+ # @param suppressions [Array<SuppressionImportRowSerializable>]
1854
+ def initialize(suppressions: )
1855
+ @suppressions = suppressions
1856
+ end
1857
+
1858
+ # @return [Hash] a hash representation of this object
1859
+ def to_h
1860
+ {
1861
+ suppressions: @suppressions,
1862
+ }.compact
1863
+ end
1864
+
1865
+ # Create an instance from a parsed JSON hash.
1866
+ # @param attributes [Hash]
1867
+ # @return [SuppressionImportBody]
1868
+ def self.from_json(attributes)
1869
+ return nil unless attributes.is_a?(Hash)
1870
+
1871
+ new(
1872
+ suppressions: attributes.key?("suppressions") ? attributes["suppressions"] : attributes[:suppressions],
1873
+ )
1874
+ end
1875
+ end
1876
+
1877
+ # Schema type: SuppressionImportResponse
1878
+ class SuppressionImportResponse
1879
+ # @return [Integer]
1880
+ attr_accessor :imported
1881
+ # @return [Integer]
1882
+ attr_accessor :skipped
1883
+
1884
+ # @param imported [Integer], skipped [Integer]
1885
+ def initialize(imported: , skipped: )
1886
+ @imported = imported
1887
+ @skipped = skipped
1888
+ end
1889
+
1890
+ # @return [Hash] a hash representation of this object
1891
+ def to_h
1892
+ {
1893
+ imported: @imported,
1894
+ skipped: @skipped,
1895
+ }.compact
1896
+ end
1897
+
1898
+ # Create an instance from a parsed JSON hash.
1899
+ # @param attributes [Hash]
1900
+ # @return [SuppressionImportResponse]
1901
+ def self.from_json(attributes)
1902
+ return nil unless attributes.is_a?(Hash)
1903
+
1904
+ new(
1905
+ imported: attributes.key?("imported") ? attributes["imported"] : attributes[:imported],
1906
+ skipped: attributes.key?("skipped") ? attributes["skipped"] : attributes[:skipped],
1907
+ )
1908
+ end
1909
+ end
1910
+
1911
+ # Schema type: SegmentResponse
1912
+ class SegmentResponse
1913
+ # @return [String]
1914
+ attr_accessor :object
1915
+ # @return [String]
1916
+ attr_accessor :id
1917
+ # @return [String]
1918
+ attr_accessor :name
1919
+ # @return [String]
1920
+ attr_accessor :project_id
1921
+ # @return [String]
1922
+ attr_accessor :created_at
1923
+ # @return [Integer]
1924
+ attr_accessor :contact_count
1925
+ # @return [Integer]
1926
+ attr_accessor :unsubscribed_count
1927
+
1928
+ # @param object [String], id [String], name [String], project_id [String], created_at [String], contact_count [Integer], unsubscribed_count [Integer]
1929
+ def initialize(object: nil, id: , name: , project_id: , created_at: , contact_count: nil, unsubscribed_count: nil)
1930
+ @object = object
1931
+ @id = id
1932
+ @name = name
1933
+ @project_id = project_id
1934
+ @created_at = created_at
1935
+ @contact_count = contact_count
1936
+ @unsubscribed_count = unsubscribed_count
1937
+ end
1938
+
1939
+ # @return [Hash] a hash representation of this object
1940
+ def to_h
1941
+ {
1942
+ object: @object,
1943
+ id: @id,
1944
+ name: @name,
1945
+ project_id: @project_id,
1946
+ created_at: @created_at,
1947
+ contact_count: @contact_count,
1948
+ unsubscribed_count: @unsubscribed_count,
1949
+ }.compact
1950
+ end
1951
+
1952
+ # Create an instance from a parsed JSON hash.
1953
+ # @param attributes [Hash]
1954
+ # @return [SegmentResponse]
1955
+ def self.from_json(attributes)
1956
+ return nil unless attributes.is_a?(Hash)
1957
+
1958
+ new(
1959
+ object: attributes.key?("object") ? attributes["object"] : attributes[:object],
1960
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
1961
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
1962
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
1963
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
1964
+ contact_count: attributes.key?("contactCount") ? attributes["contactCount"] : attributes[:contact_count],
1965
+ unsubscribed_count: attributes.key?("unsubscribedCount") ? attributes["unsubscribedCount"] : attributes[:unsubscribed_count],
1966
+ )
1967
+ end
1968
+ end
1969
+
1970
+ # Schema type: SegmentPageResponse
1971
+ class SegmentPageResponse
1972
+ # @return [Array<SegmentResponse>]
1973
+ attr_accessor :data
1974
+ # @return [PageInfo]
1975
+ attr_accessor :page
1976
+
1977
+ # @param data [Array<SegmentResponse>], page [PageInfo]
1978
+ def initialize(data: , page: )
1979
+ @data = data
1980
+ @page = page
1981
+ end
1982
+
1983
+ # @return [Hash] a hash representation of this object
1984
+ def to_h
1985
+ {
1986
+ data: @data,
1987
+ page: @page,
1988
+ }.compact
1989
+ end
1990
+
1991
+ # Create an instance from a parsed JSON hash.
1992
+ # @param attributes [Hash]
1993
+ # @return [SegmentPageResponse]
1994
+ def self.from_json(attributes)
1995
+ return nil unless attributes.is_a?(Hash)
1996
+
1997
+ new(
1998
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
1999
+ page: attributes.key?("page") ? attributes["page"] : attributes[:page],
2000
+ )
2001
+ end
2002
+ end
2003
+
2004
+ # Schema type: SegmentContactResponse
2005
+ class SegmentContactResponse
2006
+ # @return [String]
2007
+ attr_accessor :contact_id
2008
+ # @return [String]
2009
+ attr_accessor :email
2010
+ # @return [String, nil]
2011
+ attr_accessor :first_name
2012
+ # @return [String, nil]
2013
+ attr_accessor :last_name
2014
+ # @return [Array<String>]
2015
+ attr_accessor :segments
2016
+
2017
+ # @param contact_id [String], email [String], first_name [String, nil], last_name [String, nil], segments [Array<String>]
2018
+ def initialize(contact_id: , email: , first_name: , last_name: , segments: )
2019
+ @contact_id = contact_id
2020
+ @email = email
2021
+ @first_name = first_name
2022
+ @last_name = last_name
2023
+ @segments = segments
2024
+ end
2025
+
2026
+ # @return [Hash] a hash representation of this object
2027
+ def to_h
2028
+ {
2029
+ contact_id: @contact_id,
2030
+ email: @email,
2031
+ first_name: @first_name,
2032
+ last_name: @last_name,
2033
+ segments: @segments,
2034
+ }.compact
2035
+ end
2036
+
2037
+ # Create an instance from a parsed JSON hash.
2038
+ # @param attributes [Hash]
2039
+ # @return [SegmentContactResponse]
2040
+ def self.from_json(attributes)
2041
+ return nil unless attributes.is_a?(Hash)
2042
+
2043
+ new(
2044
+ contact_id: attributes.key?("contactId") ? attributes["contactId"] : attributes[:contact_id],
2045
+ email: attributes.key?("email") ? attributes["email"] : attributes[:email],
2046
+ first_name: attributes.key?("firstName") ? attributes["firstName"] : attributes[:first_name],
2047
+ last_name: attributes.key?("lastName") ? attributes["lastName"] : attributes[:last_name],
2048
+ segments: attributes.key?("segments") ? attributes["segments"] : attributes[:segments],
2049
+ )
2050
+ end
2051
+ end
2052
+
2053
+ # Schema type: CursorInfo
2054
+ class CursorInfo
2055
+ # @return [String, nil]
2056
+ attr_accessor :next_cursor
2057
+ # @return [String, nil]
2058
+ attr_accessor :previous_cursor
2059
+ # @return [Boolean]
2060
+ attr_accessor :has_next_page
2061
+ # @return [Boolean]
2062
+ attr_accessor :has_previous_page
2063
+
2064
+ # @param next_cursor [String, nil], previous_cursor [String, nil], has_next_page [Boolean], has_previous_page [Boolean]
2065
+ def initialize(next_cursor: , previous_cursor: , has_next_page: , has_previous_page: )
2066
+ @next_cursor = next_cursor
2067
+ @previous_cursor = previous_cursor
2068
+ @has_next_page = has_next_page
2069
+ @has_previous_page = has_previous_page
2070
+ end
2071
+
2072
+ # @return [Hash] a hash representation of this object
2073
+ def to_h
2074
+ {
2075
+ next_cursor: @next_cursor,
2076
+ previous_cursor: @previous_cursor,
2077
+ has_next_page: @has_next_page,
2078
+ has_previous_page: @has_previous_page,
2079
+ }.compact
2080
+ end
2081
+
2082
+ # Create an instance from a parsed JSON hash.
2083
+ # @param attributes [Hash]
2084
+ # @return [CursorInfo]
2085
+ def self.from_json(attributes)
2086
+ return nil unless attributes.is_a?(Hash)
2087
+
2088
+ new(
2089
+ next_cursor: attributes.key?("nextCursor") ? attributes["nextCursor"] : attributes[:next_cursor],
2090
+ previous_cursor: attributes.key?("previousCursor") ? attributes["previousCursor"] : attributes[:previous_cursor],
2091
+ has_next_page: attributes.key?("hasNextPage") ? attributes["hasNextPage"] : attributes[:has_next_page],
2092
+ has_previous_page: attributes.key?("hasPreviousPage") ? attributes["hasPreviousPage"] : attributes[:has_previous_page],
2093
+ )
2094
+ end
2095
+ end
2096
+
2097
+ # Schema type: CursorPage
2098
+ class CursorPage
2099
+ # @return [Array<SegmentContactResponse>]
2100
+ attr_accessor :data
2101
+ # @return [CursorInfo]
2102
+ attr_accessor :cursor
2103
+
2104
+ # @param data [Array<SegmentContactResponse>], cursor [CursorInfo]
2105
+ def initialize(data: , cursor: )
2106
+ @data = data
2107
+ @cursor = cursor
2108
+ end
2109
+
2110
+ # @return [Hash] a hash representation of this object
2111
+ def to_h
2112
+ {
2113
+ data: @data,
2114
+ cursor: @cursor,
2115
+ }.compact
2116
+ end
2117
+
2118
+ # Create an instance from a parsed JSON hash.
2119
+ # @param attributes [Hash]
2120
+ # @return [CursorPage]
2121
+ def self.from_json(attributes)
2122
+ return nil unless attributes.is_a?(Hash)
2123
+
2124
+ new(
2125
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
2126
+ cursor: attributes.key?("cursor") ? attributes["cursor"] : attributes[:cursor],
2127
+ )
2128
+ end
2129
+ end
2130
+
2131
+ # Schema type: CreateSegmentBody
2132
+ class CreateSegmentBody
2133
+ # @return [String]
2134
+ attr_accessor :name
2135
+
2136
+ # @param name [String]
2137
+ def initialize(name: )
2138
+ @name = name
2139
+ end
2140
+
2141
+ # @return [Hash] a hash representation of this object
2142
+ def to_h
2143
+ {
2144
+ name: @name,
2145
+ }.compact
2146
+ end
2147
+
2148
+ # Create an instance from a parsed JSON hash.
2149
+ # @param attributes [Hash]
2150
+ # @return [CreateSegmentBody]
2151
+ def self.from_json(attributes)
2152
+ return nil unless attributes.is_a?(Hash)
2153
+
2154
+ new(
2155
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
2156
+ )
2157
+ end
2158
+ end
2159
+
2160
+ # Schema type: TopicResponse
2161
+ class TopicResponse
2162
+ # @return [String]
2163
+ attr_accessor :object
2164
+ # @return [String]
2165
+ attr_accessor :id
2166
+ # @return [String]
2167
+ attr_accessor :name
2168
+ # @return [String]
2169
+ attr_accessor :default_subscription
2170
+ # @return [String, nil]
2171
+ attr_accessor :description
2172
+ # @return [String]
2173
+ attr_accessor :visibility
2174
+ # @return [String]
2175
+ attr_accessor :project_id
2176
+ # @return [Integer]
2177
+ attr_accessor :opt_in_count
2178
+ # @return [Integer]
2179
+ attr_accessor :opt_out_count
2180
+ # @return [String]
2181
+ attr_accessor :created_at
2182
+ # @return [String]
2183
+ attr_accessor :updated_at
2184
+
2185
+ # @param object [String], id [String], name [String], default_subscription [String], description [String, nil], visibility [String], project_id [String], opt_in_count [Integer], opt_out_count [Integer], created_at [String], updated_at [String]
2186
+ def initialize(object: nil, id: , name: , default_subscription: , description: , visibility: , project_id: , opt_in_count: , opt_out_count: , created_at: , updated_at: )
2187
+ @object = object
2188
+ @id = id
2189
+ @name = name
2190
+ @default_subscription = default_subscription
2191
+ @description = description
2192
+ @visibility = visibility
2193
+ @project_id = project_id
2194
+ @opt_in_count = opt_in_count
2195
+ @opt_out_count = opt_out_count
2196
+ @created_at = created_at
2197
+ @updated_at = updated_at
2198
+ end
2199
+
2200
+ # @return [Hash] a hash representation of this object
2201
+ def to_h
2202
+ {
2203
+ object: @object,
2204
+ id: @id,
2205
+ name: @name,
2206
+ default_subscription: @default_subscription,
2207
+ description: @description,
2208
+ visibility: @visibility,
2209
+ project_id: @project_id,
2210
+ opt_in_count: @opt_in_count,
2211
+ opt_out_count: @opt_out_count,
2212
+ created_at: @created_at,
2213
+ updated_at: @updated_at,
2214
+ }.compact
2215
+ end
2216
+
2217
+ # Create an instance from a parsed JSON hash.
2218
+ # @param attributes [Hash]
2219
+ # @return [TopicResponse]
2220
+ def self.from_json(attributes)
2221
+ return nil unless attributes.is_a?(Hash)
2222
+
2223
+ new(
2224
+ object: attributes.key?("object") ? attributes["object"] : attributes[:object],
2225
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
2226
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
2227
+ default_subscription: attributes.key?("defaultSubscription") ? attributes["defaultSubscription"] : attributes[:default_subscription],
2228
+ description: attributes.key?("description") ? attributes["description"] : attributes[:description],
2229
+ visibility: attributes.key?("visibility") ? attributes["visibility"] : attributes[:visibility],
2230
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
2231
+ opt_in_count: attributes.key?("optInCount") ? attributes["optInCount"] : attributes[:opt_in_count],
2232
+ opt_out_count: attributes.key?("optOutCount") ? attributes["optOutCount"] : attributes[:opt_out_count],
2233
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
2234
+ updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
2235
+ )
2236
+ end
2237
+ end
2238
+
2239
+ # Schema type: TopicPageResponse
2240
+ class TopicPageResponse
2241
+ # @return [Array<TopicResponse>]
2242
+ attr_accessor :data
2243
+ # @return [PageInfo]
2244
+ attr_accessor :page
2245
+
2246
+ # @param data [Array<TopicResponse>], page [PageInfo]
2247
+ def initialize(data: , page: )
2248
+ @data = data
2249
+ @page = page
2250
+ end
2251
+
2252
+ # @return [Hash] a hash representation of this object
2253
+ def to_h
2254
+ {
2255
+ data: @data,
2256
+ page: @page,
2257
+ }.compact
2258
+ end
2259
+
2260
+ # Create an instance from a parsed JSON hash.
2261
+ # @param attributes [Hash]
2262
+ # @return [TopicPageResponse]
2263
+ def self.from_json(attributes)
2264
+ return nil unless attributes.is_a?(Hash)
2265
+
2266
+ new(
2267
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
2268
+ page: attributes.key?("page") ? attributes["page"] : attributes[:page],
2269
+ )
2270
+ end
2271
+ end
2272
+
2273
+ # Schema type: CreateTopicBody
2274
+ class CreateTopicBody
2275
+ # @return [String]
2276
+ attr_accessor :name
2277
+ # @return [String]
2278
+ attr_accessor :default_subscription
2279
+ # @return [String, nil]
2280
+ attr_accessor :description
2281
+ # @return [String, nil]
2282
+ attr_accessor :visibility
2283
+
2284
+ # @param name [String], default_subscription [String], description [String, nil], visibility [String, nil]
2285
+ def initialize(name: , default_subscription: , description: nil, visibility: nil)
2286
+ @name = name
2287
+ @default_subscription = default_subscription
2288
+ @description = description
2289
+ @visibility = visibility
2290
+ end
2291
+
2292
+ # @return [Hash] a hash representation of this object
2293
+ def to_h
2294
+ {
2295
+ name: @name,
2296
+ default_subscription: @default_subscription,
2297
+ description: @description,
2298
+ visibility: @visibility,
2299
+ }.compact
2300
+ end
2301
+
2302
+ # Create an instance from a parsed JSON hash.
2303
+ # @param attributes [Hash]
2304
+ # @return [CreateTopicBody]
2305
+ def self.from_json(attributes)
2306
+ return nil unless attributes.is_a?(Hash)
2307
+
2308
+ new(
2309
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
2310
+ default_subscription: attributes.key?("defaultSubscription") ? attributes["defaultSubscription"] : attributes[:default_subscription],
2311
+ description: attributes.key?("description") ? attributes["description"] : attributes[:description],
2312
+ visibility: attributes.key?("visibility") ? attributes["visibility"] : attributes[:visibility],
2313
+ )
2314
+ end
2315
+ end
2316
+
2317
+ # Schema type: UpdateTopicBody
2318
+ class UpdateTopicBody
2319
+ # @return [String, nil]
2320
+ attr_accessor :name
2321
+ # @return [String, nil]
2322
+ attr_accessor :description
2323
+ # @return [String, nil]
2324
+ attr_accessor :visibility
2325
+
2326
+ # @param name [String, nil], description [String, nil], visibility [String, nil]
2327
+ def initialize(name: nil, description: nil, visibility: nil)
2328
+ @name = name
2329
+ @description = description
2330
+ @visibility = visibility
2331
+ end
2332
+
2333
+ # @return [Hash] a hash representation of this object
2334
+ def to_h
2335
+ {
2336
+ name: @name,
2337
+ description: @description,
2338
+ visibility: @visibility,
2339
+ }.compact
2340
+ end
2341
+
2342
+ # Create an instance from a parsed JSON hash.
2343
+ # @param attributes [Hash]
2344
+ # @return [UpdateTopicBody]
2345
+ def self.from_json(attributes)
2346
+ return nil unless attributes.is_a?(Hash)
2347
+
2348
+ new(
2349
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
2350
+ description: attributes.key?("description") ? attributes["description"] : attributes[:description],
2351
+ visibility: attributes.key?("visibility") ? attributes["visibility"] : attributes[:visibility],
2352
+ )
2353
+ end
2354
+ end
2355
+
2356
+ # Schema type: ContactPropertyResponse
2357
+ class ContactPropertyResponse
2358
+ # @return [String]
2359
+ attr_accessor :object
2360
+ # @return [String]
2361
+ attr_accessor :id
2362
+ # @return [String]
2363
+ attr_accessor :key
2364
+ # @return [String]
2365
+ attr_accessor :type
2366
+ # @return [String, nil]
2367
+ attr_accessor :fallback_value
2368
+ # @return [String]
2369
+ attr_accessor :project_id
2370
+ # @return [String]
2371
+ attr_accessor :created_at
2372
+ # @return [String]
2373
+ attr_accessor :updated_at
2374
+
2375
+ # @param object [String], id [String], key [String], type [String], fallback_value [String, nil], project_id [String], created_at [String], updated_at [String]
2376
+ def initialize(object: nil, id: , key: , type: , fallback_value: , project_id: , created_at: , updated_at: )
2377
+ @object = object
2378
+ @id = id
2379
+ @key = key
2380
+ @type = type
2381
+ @fallback_value = fallback_value
2382
+ @project_id = project_id
2383
+ @created_at = created_at
2384
+ @updated_at = updated_at
2385
+ end
2386
+
2387
+ # @return [Hash] a hash representation of this object
2388
+ def to_h
2389
+ {
2390
+ object: @object,
2391
+ id: @id,
2392
+ key: @key,
2393
+ type: @type,
2394
+ fallback_value: @fallback_value,
2395
+ project_id: @project_id,
2396
+ created_at: @created_at,
2397
+ updated_at: @updated_at,
2398
+ }.compact
2399
+ end
2400
+
2401
+ # Create an instance from a parsed JSON hash.
2402
+ # @param attributes [Hash]
2403
+ # @return [ContactPropertyResponse]
2404
+ def self.from_json(attributes)
2405
+ return nil unless attributes.is_a?(Hash)
2406
+
2407
+ new(
2408
+ object: attributes.key?("object") ? attributes["object"] : attributes[:object],
2409
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
2410
+ key: attributes.key?("key") ? attributes["key"] : attributes[:key],
2411
+ type: attributes.key?("type") ? attributes["type"] : attributes[:type],
2412
+ fallback_value: attributes.key?("fallbackValue") ? attributes["fallbackValue"] : attributes[:fallback_value],
2413
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
2414
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
2415
+ updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
2416
+ )
2417
+ end
2418
+ end
2419
+
2420
+ # Schema type: ContactPropertyPageResponse
2421
+ class ContactPropertyPageResponse
2422
+ # @return [Array<ContactPropertyResponse>]
2423
+ attr_accessor :data
2424
+ # @return [PageInfo]
2425
+ attr_accessor :page
2426
+
2427
+ # @param data [Array<ContactPropertyResponse>], page [PageInfo]
2428
+ def initialize(data: , page: )
2429
+ @data = data
2430
+ @page = page
2431
+ end
2432
+
2433
+ # @return [Hash] a hash representation of this object
2434
+ def to_h
2435
+ {
2436
+ data: @data,
2437
+ page: @page,
2438
+ }.compact
2439
+ end
2440
+
2441
+ # Create an instance from a parsed JSON hash.
2442
+ # @param attributes [Hash]
2443
+ # @return [ContactPropertyPageResponse]
2444
+ def self.from_json(attributes)
2445
+ return nil unless attributes.is_a?(Hash)
2446
+
2447
+ new(
2448
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
2449
+ page: attributes.key?("page") ? attributes["page"] : attributes[:page],
2450
+ )
2451
+ end
2452
+ end
2453
+
2454
+ # Schema type: CreateContactPropertyBody
2455
+ class CreateContactPropertyBody
2456
+ # @return [String]
2457
+ attr_accessor :key
2458
+ # @return [String]
2459
+ attr_accessor :type
2460
+ # @return [String, nil]
2461
+ attr_accessor :fallback_value
2462
+
2463
+ # @param key [String], type [String], fallback_value [String, nil]
2464
+ def initialize(key: , type: , fallback_value: nil)
2465
+ @key = key
2466
+ @type = type
2467
+ @fallback_value = fallback_value
2468
+ end
2469
+
2470
+ # @return [Hash] a hash representation of this object
2471
+ def to_h
2472
+ {
2473
+ key: @key,
2474
+ type: @type,
2475
+ fallback_value: @fallback_value,
2476
+ }.compact
2477
+ end
2478
+
2479
+ # Create an instance from a parsed JSON hash.
2480
+ # @param attributes [Hash]
2481
+ # @return [CreateContactPropertyBody]
2482
+ def self.from_json(attributes)
2483
+ return nil unless attributes.is_a?(Hash)
2484
+
2485
+ new(
2486
+ key: attributes.key?("key") ? attributes["key"] : attributes[:key],
2487
+ type: attributes.key?("type") ? attributes["type"] : attributes[:type],
2488
+ fallback_value: attributes.key?("fallbackValue") ? attributes["fallbackValue"] : attributes[:fallback_value],
2489
+ )
2490
+ end
2491
+ end
2492
+
2493
+ # Schema type: UpdateContactPropertyBody
2494
+ class UpdateContactPropertyBody
2495
+ # @return [String, nil]
2496
+ attr_accessor :fallback_value
2497
+
2498
+ # @param fallback_value [String, nil]
2499
+ def initialize(fallback_value: nil)
2500
+ @fallback_value = fallback_value
2501
+ end
2502
+
2503
+ # @return [Hash] a hash representation of this object
2504
+ def to_h
2505
+ {
2506
+ fallback_value: @fallback_value,
2507
+ }.compact
2508
+ end
2509
+
2510
+ # Create an instance from a parsed JSON hash.
2511
+ # @param attributes [Hash]
2512
+ # @return [UpdateContactPropertyBody]
2513
+ def self.from_json(attributes)
2514
+ return nil unless attributes.is_a?(Hash)
2515
+
2516
+ new(
2517
+ fallback_value: attributes.key?("fallbackValue") ? attributes["fallbackValue"] : attributes[:fallback_value],
2518
+ )
2519
+ end
2520
+ end
2521
+
2522
+ # Schema type: TopicSubscriptionResponse
2523
+ class TopicSubscriptionResponse
2524
+ # @return [String]
2525
+ attr_accessor :topic_id
2526
+ # @return [String]
2527
+ attr_accessor :subscription
2528
+
2529
+ # @param topic_id [String], subscription [String]
2530
+ def initialize(topic_id: , subscription: )
2531
+ @topic_id = topic_id
2532
+ @subscription = subscription
2533
+ end
2534
+
2535
+ # @return [Hash] a hash representation of this object
2536
+ def to_h
2537
+ {
2538
+ topic_id: @topic_id,
2539
+ subscription: @subscription,
2540
+ }.compact
2541
+ end
2542
+
2543
+ # Create an instance from a parsed JSON hash.
2544
+ # @param attributes [Hash]
2545
+ # @return [TopicSubscriptionResponse]
2546
+ def self.from_json(attributes)
2547
+ return nil unless attributes.is_a?(Hash)
2548
+
2549
+ new(
2550
+ topic_id: attributes.key?("topicId") ? attributes["topicId"] : attributes[:topic_id],
2551
+ subscription: attributes.key?("subscription") ? attributes["subscription"] : attributes[:subscription],
2552
+ )
2553
+ end
2554
+ end
2555
+
2556
+ # Schema type: ContactResponse
2557
+ class ContactResponse
2558
+ # @return [String]
2559
+ attr_accessor :object
2560
+ # @return [String]
2561
+ attr_accessor :id
2562
+ # @return [String]
2563
+ attr_accessor :email
2564
+ # @return [String, nil]
2565
+ attr_accessor :phone
2566
+ # @return [String, nil]
2567
+ attr_accessor :first_name
2568
+ # @return [String, nil]
2569
+ attr_accessor :last_name
2570
+ # @return [Boolean]
2571
+ attr_accessor :unsubscribed
2572
+ # @return [Hash{String => String}]
2573
+ attr_accessor :properties
2574
+ # @return [String, nil]
2575
+ attr_accessor :profile_image_url
2576
+ # @return [String]
2577
+ attr_accessor :project_id
2578
+ # @return [Array<String>]
2579
+ attr_accessor :segments
2580
+ # @return [Array<TopicSubscriptionResponse>]
2581
+ attr_accessor :topics
2582
+ # @return [String]
2583
+ attr_accessor :created_at
2584
+ # @return [String]
2585
+ attr_accessor :updated_at
2586
+
2587
+ # @param object [String], id [String], email [String], phone [String, nil], first_name [String, nil], last_name [String, nil], unsubscribed [Boolean], properties [Hash{String => String}], profile_image_url [String, nil], project_id [String], segments [Array<String>], topics [Array<TopicSubscriptionResponse>], created_at [String], updated_at [String]
2588
+ def initialize(object: nil, id: , email: , phone: nil, first_name: , last_name: , unsubscribed: , properties: , profile_image_url: , project_id: , segments: , topics: , created_at: , updated_at: )
2589
+ @object = object
2590
+ @id = id
2591
+ @email = email
2592
+ @phone = phone
2593
+ @first_name = first_name
2594
+ @last_name = last_name
2595
+ @unsubscribed = unsubscribed
2596
+ @properties = properties
2597
+ @profile_image_url = profile_image_url
2598
+ @project_id = project_id
2599
+ @segments = segments
2600
+ @topics = topics
2601
+ @created_at = created_at
2602
+ @updated_at = updated_at
2603
+ end
2604
+
2605
+ # @return [Hash] a hash representation of this object
2606
+ def to_h
2607
+ {
2608
+ object: @object,
2609
+ id: @id,
2610
+ email: @email,
2611
+ phone: @phone,
2612
+ first_name: @first_name,
2613
+ last_name: @last_name,
2614
+ unsubscribed: @unsubscribed,
2615
+ properties: @properties,
2616
+ profile_image_url: @profile_image_url,
2617
+ project_id: @project_id,
2618
+ segments: @segments,
2619
+ topics: @topics,
2620
+ created_at: @created_at,
2621
+ updated_at: @updated_at,
2622
+ }.compact
2623
+ end
2624
+
2625
+ # Create an instance from a parsed JSON hash.
2626
+ # @param attributes [Hash]
2627
+ # @return [ContactResponse]
2628
+ def self.from_json(attributes)
2629
+ return nil unless attributes.is_a?(Hash)
2630
+
2631
+ new(
2632
+ object: attributes.key?("object") ? attributes["object"] : attributes[:object],
2633
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
2634
+ email: attributes.key?("email") ? attributes["email"] : attributes[:email],
2635
+ phone: attributes.key?("phone") ? attributes["phone"] : attributes[:phone],
2636
+ first_name: attributes.key?("firstName") ? attributes["firstName"] : attributes[:first_name],
2637
+ last_name: attributes.key?("lastName") ? attributes["lastName"] : attributes[:last_name],
2638
+ unsubscribed: attributes.key?("unsubscribed") ? attributes["unsubscribed"] : attributes[:unsubscribed],
2639
+ properties: attributes.key?("properties") ? attributes["properties"] : attributes[:properties],
2640
+ profile_image_url: attributes.key?("profileImageUrl") ? attributes["profileImageUrl"] : attributes[:profile_image_url],
2641
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
2642
+ segments: attributes.key?("segments") ? attributes["segments"] : attributes[:segments],
2643
+ topics: attributes.key?("topics") ? attributes["topics"] : attributes[:topics],
2644
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
2645
+ updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
2646
+ )
2647
+ end
2648
+ end
2649
+
2650
+ # Schema type: ContactPageResponse
2651
+ class ContactPageResponse
2652
+ # @return [Array<ContactResponse>]
2653
+ attr_accessor :data
2654
+ # @return [PageInfo]
2655
+ attr_accessor :page
2656
+
2657
+ # @param data [Array<ContactResponse>], page [PageInfo]
2658
+ def initialize(data: , page: )
2659
+ @data = data
2660
+ @page = page
2661
+ end
2662
+
2663
+ # @return [Hash] a hash representation of this object
2664
+ def to_h
2665
+ {
2666
+ data: @data,
2667
+ page: @page,
2668
+ }.compact
2669
+ end
2670
+
2671
+ # Create an instance from a parsed JSON hash.
2672
+ # @param attributes [Hash]
2673
+ # @return [ContactPageResponse]
2674
+ def self.from_json(attributes)
2675
+ return nil unless attributes.is_a?(Hash)
2676
+
2677
+ new(
2678
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
2679
+ page: attributes.key?("page") ? attributes["page"] : attributes[:page],
2680
+ )
2681
+ end
2682
+ end
2683
+
2684
+ # Schema type: SegmentRef
2685
+ class SegmentRef
2686
+ # @return [String]
2687
+ attr_accessor :id
2688
+
2689
+ # @param id [String]
2690
+ def initialize(id: )
2691
+ @id = id
2692
+ end
2693
+
2694
+ # @return [Hash] a hash representation of this object
2695
+ def to_h
2696
+ {
2697
+ id: @id,
2698
+ }.compact
2699
+ end
2700
+
2701
+ # Create an instance from a parsed JSON hash.
2702
+ # @param attributes [Hash]
2703
+ # @return [SegmentRef]
2704
+ def self.from_json(attributes)
2705
+ return nil unless attributes.is_a?(Hash)
2706
+
2707
+ new(
2708
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
2709
+ )
2710
+ end
2711
+ end
2712
+
2713
+ # Schema type: TopicSubscriptionBody
2714
+ class TopicSubscriptionBody
2715
+ # @return [String]
2716
+ attr_accessor :id
2717
+ # @return [String]
2718
+ attr_accessor :subscription
2719
+
2720
+ # @param id [String], subscription [String]
2721
+ def initialize(id: , subscription: )
2722
+ @id = id
2723
+ @subscription = subscription
2724
+ end
2725
+
2726
+ # @return [Hash] a hash representation of this object
2727
+ def to_h
2728
+ {
2729
+ id: @id,
2730
+ subscription: @subscription,
2731
+ }.compact
2732
+ end
2733
+
2734
+ # Create an instance from a parsed JSON hash.
2735
+ # @param attributes [Hash]
2736
+ # @return [TopicSubscriptionBody]
2737
+ def self.from_json(attributes)
2738
+ return nil unless attributes.is_a?(Hash)
2739
+
2740
+ new(
2741
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
2742
+ subscription: attributes.key?("subscription") ? attributes["subscription"] : attributes[:subscription],
2743
+ )
2744
+ end
2745
+ end
2746
+
2747
+ # Schema type: CreateContactBody
2748
+ class CreateContactBody
2749
+ # @return [String]
2750
+ attr_accessor :email
2751
+ # @return [String, nil]
2752
+ attr_accessor :phone
2753
+ # @return [String, nil]
2754
+ attr_accessor :first_name
2755
+ # @return [String, nil]
2756
+ attr_accessor :last_name
2757
+ # @return [Boolean]
2758
+ attr_accessor :unsubscribed
2759
+ # @return [Hash{String => String}]
2760
+ attr_accessor :properties
2761
+ # @return [Array<SegmentRef>]
2762
+ attr_accessor :segments
2763
+ # @return [Array<TopicSubscriptionBody>]
2764
+ attr_accessor :topics
2765
+
2766
+ # @param email [String], phone [String, nil], first_name [String, nil], last_name [String, nil], unsubscribed [Boolean], properties [Hash{String => String}], segments [Array<SegmentRef>], topics [Array<TopicSubscriptionBody>]
2767
+ def initialize(email: , phone: nil, first_name: nil, last_name: nil, unsubscribed: nil, properties: nil, segments: nil, topics: nil)
2768
+ @email = email
2769
+ @phone = phone
2770
+ @first_name = first_name
2771
+ @last_name = last_name
2772
+ @unsubscribed = unsubscribed
2773
+ @properties = properties
2774
+ @segments = segments
2775
+ @topics = topics
2776
+ end
2777
+
2778
+ # @return [Hash] a hash representation of this object
2779
+ def to_h
2780
+ {
2781
+ email: @email,
2782
+ phone: @phone,
2783
+ first_name: @first_name,
2784
+ last_name: @last_name,
2785
+ unsubscribed: @unsubscribed,
2786
+ properties: @properties,
2787
+ segments: @segments,
2788
+ topics: @topics,
2789
+ }.compact
2790
+ end
2791
+
2792
+ # Create an instance from a parsed JSON hash.
2793
+ # @param attributes [Hash]
2794
+ # @return [CreateContactBody]
2795
+ def self.from_json(attributes)
2796
+ return nil unless attributes.is_a?(Hash)
2797
+
2798
+ new(
2799
+ email: attributes.key?("email") ? attributes["email"] : attributes[:email],
2800
+ phone: attributes.key?("phone") ? attributes["phone"] : attributes[:phone],
2801
+ first_name: attributes.key?("firstName") ? attributes["firstName"] : attributes[:first_name],
2802
+ last_name: attributes.key?("lastName") ? attributes["lastName"] : attributes[:last_name],
2803
+ unsubscribed: attributes.key?("unsubscribed") ? attributes["unsubscribed"] : attributes[:unsubscribed],
2804
+ properties: attributes.key?("properties") ? attributes["properties"] : attributes[:properties],
2805
+ segments: attributes.key?("segments") ? attributes["segments"] : attributes[:segments],
2806
+ topics: attributes.key?("topics") ? attributes["topics"] : attributes[:topics],
2807
+ )
2808
+ end
2809
+ end
2810
+
2811
+ # Schema type: UpdateContactBody
2812
+ class UpdateContactBody
2813
+ # @return [String, nil]
2814
+ attr_accessor :first_name
2815
+ # @return [String, nil]
2816
+ attr_accessor :last_name
2817
+ # @return [String, nil]
2818
+ attr_accessor :phone
2819
+ # @return [Boolean, nil]
2820
+ attr_accessor :unsubscribed
2821
+ # @return [Hash{String => String}]
2822
+ attr_accessor :properties
2823
+
2824
+ # @param first_name [String, nil], last_name [String, nil], phone [String, nil], unsubscribed [Boolean, nil], properties [Hash{String => String}]
2825
+ def initialize(first_name: nil, last_name: nil, phone: nil, unsubscribed: nil, properties: nil)
2826
+ @first_name = first_name
2827
+ @last_name = last_name
2828
+ @phone = phone
2829
+ @unsubscribed = unsubscribed
2830
+ @properties = properties
2831
+ end
2832
+
2833
+ # @return [Hash] a hash representation of this object
2834
+ def to_h
2835
+ {
2836
+ first_name: @first_name,
2837
+ last_name: @last_name,
2838
+ phone: @phone,
2839
+ unsubscribed: @unsubscribed,
2840
+ properties: @properties,
2841
+ }.compact
2842
+ end
2843
+
2844
+ # Create an instance from a parsed JSON hash.
2845
+ # @param attributes [Hash]
2846
+ # @return [UpdateContactBody]
2847
+ def self.from_json(attributes)
2848
+ return nil unless attributes.is_a?(Hash)
2849
+
2850
+ new(
2851
+ first_name: attributes.key?("firstName") ? attributes["firstName"] : attributes[:first_name],
2852
+ last_name: attributes.key?("lastName") ? attributes["lastName"] : attributes[:last_name],
2853
+ phone: attributes.key?("phone") ? attributes["phone"] : attributes[:phone],
2854
+ unsubscribed: attributes.key?("unsubscribed") ? attributes["unsubscribed"] : attributes[:unsubscribed],
2855
+ properties: attributes.key?("properties") ? attributes["properties"] : attributes[:properties],
2856
+ )
2857
+ end
2858
+ end
2859
+
2860
+ # Schema type: SetImageUrlBody
2861
+ class SetImageUrlBody
2862
+ # @return [String]
2863
+ attr_accessor :url
2864
+
2865
+ # @param url [String]
2866
+ def initialize(url: )
2867
+ @url = url
2868
+ end
2869
+
2870
+ # @return [Hash] a hash representation of this object
2871
+ def to_h
2872
+ {
2873
+ url: @url,
2874
+ }.compact
2875
+ end
2876
+
2877
+ # Create an instance from a parsed JSON hash.
2878
+ # @param attributes [Hash]
2879
+ # @return [SetImageUrlBody]
2880
+ def self.from_json(attributes)
2881
+ return nil unless attributes.is_a?(Hash)
2882
+
2883
+ new(
2884
+ url: attributes.key?("url") ? attributes["url"] : attributes[:url],
2885
+ )
2886
+ end
2887
+ end
2888
+
2889
+ # Schema type: AddToSegmentBody
2890
+ class AddToSegmentBody
2891
+ # @return [String]
2892
+ attr_accessor :segment_id
2893
+
2894
+ # @param segment_id [String]
2895
+ def initialize(segment_id: )
2896
+ @segment_id = segment_id
2897
+ end
2898
+
2899
+ # @return [Hash] a hash representation of this object
2900
+ def to_h
2901
+ {
2902
+ segment_id: @segment_id,
2903
+ }.compact
2904
+ end
2905
+
2906
+ # Create an instance from a parsed JSON hash.
2907
+ # @param attributes [Hash]
2908
+ # @return [AddToSegmentBody]
2909
+ def self.from_json(attributes)
2910
+ return nil unless attributes.is_a?(Hash)
2911
+
2912
+ new(
2913
+ segment_id: attributes.key?("segmentId") ? attributes["segmentId"] : attributes[:segment_id],
2914
+ )
2915
+ end
2916
+ end
2917
+
2918
+ # Schema type: UpdateTopicsBody
2919
+ class UpdateTopicsBody
2920
+ # @return [Array<TopicSubscriptionBody>]
2921
+ attr_accessor :topics
2922
+
2923
+ # @param topics [Array<TopicSubscriptionBody>]
2924
+ def initialize(topics: )
2925
+ @topics = topics
2926
+ end
2927
+
2928
+ # @return [Hash] a hash representation of this object
2929
+ def to_h
2930
+ {
2931
+ topics: @topics,
2932
+ }.compact
2933
+ end
2934
+
2935
+ # Create an instance from a parsed JSON hash.
2936
+ # @param attributes [Hash]
2937
+ # @return [UpdateTopicsBody]
2938
+ def self.from_json(attributes)
2939
+ return nil unless attributes.is_a?(Hash)
2940
+
2941
+ new(
2942
+ topics: attributes.key?("topics") ? attributes["topics"] : attributes[:topics],
2943
+ )
2944
+ end
2945
+ end
2946
+
2947
+ # Schema type: ActivityMetadataResponse
2948
+ class ActivityMetadataResponse
2949
+ # @return [String, nil]
2950
+ attr_accessor :topic_id
2951
+
2952
+ # @param topic_id [String, nil]
2953
+ def initialize(topic_id: nil)
2954
+ @topic_id = topic_id
2955
+ end
2956
+
2957
+ # @return [Hash] a hash representation of this object
2958
+ def to_h
2959
+ {
2960
+ topic_id: @topic_id,
2961
+ }.compact
2962
+ end
2963
+
2964
+ # Create an instance from a parsed JSON hash.
2965
+ # @param attributes [Hash]
2966
+ # @return [ActivityMetadataResponse]
2967
+ def self.from_json(attributes)
2968
+ return nil unless attributes.is_a?(Hash)
2969
+
2970
+ new(
2971
+ topic_id: attributes.key?("topicId") ? attributes["topicId"] : attributes[:topic_id],
2972
+ )
2973
+ end
2974
+ end
2975
+
2976
+ # Schema type: ActivityResponse
2977
+ class ActivityResponse
2978
+ # @return [String]
2979
+ attr_accessor :object
2980
+ # @return [String]
2981
+ attr_accessor :id
2982
+ # @return [String]
2983
+ attr_accessor :type
2984
+ # @return [String, nil]
2985
+ attr_accessor :reference_id
2986
+ # @return [String, nil]
2987
+ attr_accessor :reference_name
2988
+ # @return [ActivityMetadataResponse, nil]
2989
+ attr_accessor :metadata
2990
+ # @return [String]
2991
+ attr_accessor :occurred_at
2992
+
2993
+ # @param object [String], id [String], type [String], reference_id [String, nil], reference_name [String, nil], metadata [ActivityMetadataResponse, nil], occurred_at [String]
2994
+ def initialize(object: nil, id: , type: , reference_id: nil, reference_name: nil, metadata: nil, occurred_at: )
2995
+ @object = object
2996
+ @id = id
2997
+ @type = type
2998
+ @reference_id = reference_id
2999
+ @reference_name = reference_name
3000
+ @metadata = metadata
3001
+ @occurred_at = occurred_at
3002
+ end
3003
+
3004
+ # @return [Hash] a hash representation of this object
3005
+ def to_h
3006
+ {
3007
+ object: @object,
3008
+ id: @id,
3009
+ type: @type,
3010
+ reference_id: @reference_id,
3011
+ reference_name: @reference_name,
3012
+ metadata: @metadata,
3013
+ occurred_at: @occurred_at,
3014
+ }.compact
3015
+ end
3016
+
3017
+ # Create an instance from a parsed JSON hash.
3018
+ # @param attributes [Hash]
3019
+ # @return [ActivityResponse]
3020
+ def self.from_json(attributes)
3021
+ return nil unless attributes.is_a?(Hash)
3022
+
3023
+ new(
3024
+ object: attributes.key?("object") ? attributes["object"] : attributes[:object],
3025
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
3026
+ type: attributes.key?("type") ? attributes["type"] : attributes[:type],
3027
+ reference_id: attributes.key?("referenceId") ? attributes["referenceId"] : attributes[:reference_id],
3028
+ reference_name: attributes.key?("referenceName") ? attributes["referenceName"] : attributes[:reference_name],
3029
+ metadata: attributes.key?("metadata") ? attributes["metadata"] : attributes[:metadata],
3030
+ occurred_at: attributes.key?("occurredAt") ? attributes["occurredAt"] : attributes[:occurred_at],
3031
+ )
3032
+ end
3033
+ end
3034
+
3035
+ # Schema type: EngagementScoreResponse
3036
+ class EngagementScoreResponse
3037
+ # @return [String]
3038
+ attr_accessor :object
3039
+ # @return [Integer]
3040
+ attr_accessor :score
3041
+ # @return [String]
3042
+ attr_accessor :tier
3043
+ # @return [String]
3044
+ attr_accessor :scored_at
3045
+
3046
+ # @param object [String], score [Integer], tier [String], scored_at [String]
3047
+ def initialize(object: nil, score: , tier: , scored_at: )
3048
+ @object = object
3049
+ @score = score
3050
+ @tier = tier
3051
+ @scored_at = scored_at
3052
+ end
3053
+
3054
+ # @return [Hash] a hash representation of this object
3055
+ def to_h
3056
+ {
3057
+ object: @object,
3058
+ score: @score,
3059
+ tier: @tier,
3060
+ scored_at: @scored_at,
3061
+ }.compact
3062
+ end
3063
+
3064
+ # Create an instance from a parsed JSON hash.
3065
+ # @param attributes [Hash]
3066
+ # @return [EngagementScoreResponse]
3067
+ def self.from_json(attributes)
3068
+ return nil unless attributes.is_a?(Hash)
3069
+
3070
+ new(
3071
+ object: attributes.key?("object") ? attributes["object"] : attributes[:object],
3072
+ score: attributes.key?("score") ? attributes["score"] : attributes[:score],
3073
+ tier: attributes.key?("tier") ? attributes["tier"] : attributes[:tier],
3074
+ scored_at: attributes.key?("scoredAt") ? attributes["scoredAt"] : attributes[:scored_at],
3075
+ )
3076
+ end
3077
+ end
3078
+
3079
+ # Schema type: EmailValidationStatusResponse
3080
+ class EmailValidationStatusResponse
3081
+ # @return [String]
3082
+ attr_accessor :object
3083
+ # @return [String]
3084
+ attr_accessor :status
3085
+ # @return [String, nil]
3086
+ attr_accessor :reason
3087
+ # @return [String, nil]
3088
+ attr_accessor :validated_at
3089
+
3090
+ # @param object [String], status [String], reason [String, nil], validated_at [String, nil]
3091
+ def initialize(object: nil, status: , reason: , validated_at: )
3092
+ @object = object
3093
+ @status = status
3094
+ @reason = reason
3095
+ @validated_at = validated_at
3096
+ end
3097
+
3098
+ # @return [Hash] a hash representation of this object
3099
+ def to_h
3100
+ {
3101
+ object: @object,
3102
+ status: @status,
3103
+ reason: @reason,
3104
+ validated_at: @validated_at,
3105
+ }.compact
3106
+ end
3107
+
3108
+ # Create an instance from a parsed JSON hash.
3109
+ # @param attributes [Hash]
3110
+ # @return [EmailValidationStatusResponse]
3111
+ def self.from_json(attributes)
3112
+ return nil unless attributes.is_a?(Hash)
3113
+
3114
+ new(
3115
+ object: attributes.key?("object") ? attributes["object"] : attributes[:object],
3116
+ status: attributes.key?("status") ? attributes["status"] : attributes[:status],
3117
+ reason: attributes.key?("reason") ? attributes["reason"] : attributes[:reason],
3118
+ validated_at: attributes.key?("validatedAt") ? attributes["validatedAt"] : attributes[:validated_at],
3119
+ )
3120
+ end
3121
+ end
3122
+
3123
+ # Schema type: RecordValidationBody
3124
+ class RecordValidationBody
3125
+ # @return [EmailValidationStatusInput]
3126
+ attr_accessor :status
3127
+ # @return [String, nil]
3128
+ attr_accessor :reason
3129
+
3130
+ # @param status [EmailValidationStatusInput], reason [String, nil]
3131
+ def initialize(status: , reason: nil)
3132
+ @status = status
3133
+ @reason = reason
3134
+ end
3135
+
3136
+ # @return [Hash] a hash representation of this object
3137
+ def to_h
3138
+ {
3139
+ status: @status,
3140
+ reason: @reason,
3141
+ }.compact
3142
+ end
3143
+
3144
+ # Create an instance from a parsed JSON hash.
3145
+ # @param attributes [Hash]
3146
+ # @return [RecordValidationBody]
3147
+ def self.from_json(attributes)
3148
+ return nil unless attributes.is_a?(Hash)
3149
+
3150
+ new(
3151
+ status: attributes.key?("status") ? attributes["status"] : attributes[:status],
3152
+ reason: attributes.key?("reason") ? attributes["reason"] : attributes[:reason],
3153
+ )
3154
+ end
3155
+ end
3156
+
3157
+ # Schema type: WebhookFilterSerializable
3158
+ class WebhookFilterSerializable
3159
+ # @return [String]
3160
+ attr_accessor :field
3161
+ # @return [String]
3162
+ attr_accessor :operator
3163
+ # @return [String, nil]
3164
+ attr_accessor :value
3165
+
3166
+ # @param field [String], operator [String], value [String, nil]
3167
+ def initialize(field: , operator: , value: nil)
3168
+ @field = field
3169
+ @operator = operator
3170
+ @value = value
3171
+ end
3172
+
3173
+ # @return [Hash] a hash representation of this object
3174
+ def to_h
3175
+ {
3176
+ field: @field,
3177
+ operator: @operator,
3178
+ value: @value,
3179
+ }.compact
3180
+ end
3181
+
3182
+ # Create an instance from a parsed JSON hash.
3183
+ # @param attributes [Hash]
3184
+ # @return [WebhookFilterSerializable]
3185
+ def self.from_json(attributes)
3186
+ return nil unless attributes.is_a?(Hash)
3187
+
3188
+ new(
3189
+ field: attributes.key?("field") ? attributes["field"] : attributes[:field],
3190
+ operator: attributes.key?("operator") ? attributes["operator"] : attributes[:operator],
3191
+ value: attributes.key?("value") ? attributes["value"] : attributes[:value],
3192
+ )
3193
+ end
3194
+ end
3195
+
3196
+ # Schema type: WebhookTransformationSerializable
3197
+ class WebhookTransformationSerializable
3198
+ # @return [String]
3199
+ attr_accessor :type
3200
+ # @return [String, nil]
3201
+ attr_accessor :from
3202
+ # @return [String, nil]
3203
+ attr_accessor :to
3204
+ # @return [String, nil]
3205
+ attr_accessor :field
3206
+ # @return [String, nil]
3207
+ attr_accessor :value
3208
+ # @return [String, nil]
3209
+ attr_accessor :template
3210
+
3211
+ # @param type [String], from [String, nil], to [String, nil], field [String, nil], value [String, nil], template [String, nil]
3212
+ def initialize(type: , from: nil, to: nil, field: nil, value: nil, template: nil)
3213
+ @type = type
3214
+ @from = from
3215
+ @to = to
3216
+ @field = field
3217
+ @value = value
3218
+ @template = template
3219
+ end
3220
+
3221
+ # @return [Hash] a hash representation of this object
3222
+ def to_h
3223
+ {
3224
+ type: @type,
3225
+ from: @from,
3226
+ to: @to,
3227
+ field: @field,
3228
+ value: @value,
3229
+ template: @template,
3230
+ }.compact
3231
+ end
3232
+
3233
+ # Create an instance from a parsed JSON hash.
3234
+ # @param attributes [Hash]
3235
+ # @return [WebhookTransformationSerializable]
3236
+ def self.from_json(attributes)
3237
+ return nil unless attributes.is_a?(Hash)
3238
+
3239
+ new(
3240
+ type: attributes.key?("type") ? attributes["type"] : attributes[:type],
3241
+ from: attributes.key?("from") ? attributes["from"] : attributes[:from],
3242
+ to: attributes.key?("to") ? attributes["to"] : attributes[:to],
3243
+ field: attributes.key?("field") ? attributes["field"] : attributes[:field],
3244
+ value: attributes.key?("value") ? attributes["value"] : attributes[:value],
3245
+ template: attributes.key?("template") ? attributes["template"] : attributes[:template],
3246
+ )
3247
+ end
3248
+ end
3249
+
3250
+ # Schema type: WebhookResponse
3251
+ class WebhookResponse
3252
+ # @return [String]
3253
+ attr_accessor :id
3254
+ # @return [String]
3255
+ attr_accessor :project_id
3256
+ # @return [String]
3257
+ attr_accessor :name
3258
+ # @return [String]
3259
+ attr_accessor :url
3260
+ # @return [Array<String>]
3261
+ attr_accessor :events
3262
+ # @return [Boolean]
3263
+ attr_accessor :enabled
3264
+ # @return [Array<WebhookFilterSerializable>]
3265
+ attr_accessor :filters
3266
+ # @return [Array<WebhookTransformationSerializable>]
3267
+ attr_accessor :transformations
3268
+ # @return [String]
3269
+ attr_accessor :created_at
3270
+ # @return [String]
3271
+ attr_accessor :updated_at
3272
+
3273
+ # @param id [String], project_id [String], name [String], url [String], events [Array<String>], enabled [Boolean], filters [Array<WebhookFilterSerializable>], transformations [Array<WebhookTransformationSerializable>], created_at [String], updated_at [String]
3274
+ def initialize(id: , project_id: , name: , url: , events: , enabled: , filters: , transformations: , created_at: , updated_at: )
3275
+ @id = id
3276
+ @project_id = project_id
3277
+ @name = name
3278
+ @url = url
3279
+ @events = events
3280
+ @enabled = enabled
3281
+ @filters = filters
3282
+ @transformations = transformations
3283
+ @created_at = created_at
3284
+ @updated_at = updated_at
3285
+ end
3286
+
3287
+ # @return [Hash] a hash representation of this object
3288
+ def to_h
3289
+ {
3290
+ id: @id,
3291
+ project_id: @project_id,
3292
+ name: @name,
3293
+ url: @url,
3294
+ events: @events,
3295
+ enabled: @enabled,
3296
+ filters: @filters,
3297
+ transformations: @transformations,
3298
+ created_at: @created_at,
3299
+ updated_at: @updated_at,
3300
+ }.compact
3301
+ end
3302
+
3303
+ # Create an instance from a parsed JSON hash.
3304
+ # @param attributes [Hash]
3305
+ # @return [WebhookResponse]
3306
+ def self.from_json(attributes)
3307
+ return nil unless attributes.is_a?(Hash)
3308
+
3309
+ new(
3310
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
3311
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
3312
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
3313
+ url: attributes.key?("url") ? attributes["url"] : attributes[:url],
3314
+ events: attributes.key?("events") ? attributes["events"] : attributes[:events],
3315
+ enabled: attributes.key?("enabled") ? attributes["enabled"] : attributes[:enabled],
3316
+ filters: attributes.key?("filters") ? attributes["filters"] : attributes[:filters],
3317
+ transformations: attributes.key?("transformations") ? attributes["transformations"] : attributes[:transformations],
3318
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
3319
+ updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
3320
+ )
3321
+ end
3322
+ end
3323
+
3324
+ # Schema type: WebhookPageResponse
3325
+ class WebhookPageResponse
3326
+ # @return [Array<WebhookResponse>]
3327
+ attr_accessor :data
3328
+ # @return [PageInfo]
3329
+ attr_accessor :page
3330
+
3331
+ # @param data [Array<WebhookResponse>], page [PageInfo]
3332
+ def initialize(data: , page: )
3333
+ @data = data
3334
+ @page = page
3335
+ end
3336
+
3337
+ # @return [Hash] a hash representation of this object
3338
+ def to_h
3339
+ {
3340
+ data: @data,
3341
+ page: @page,
3342
+ }.compact
3343
+ end
3344
+
3345
+ # Create an instance from a parsed JSON hash.
3346
+ # @param attributes [Hash]
3347
+ # @return [WebhookPageResponse]
3348
+ def self.from_json(attributes)
3349
+ return nil unless attributes.is_a?(Hash)
3350
+
3351
+ new(
3352
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
3353
+ page: attributes.key?("page") ? attributes["page"] : attributes[:page],
3354
+ )
3355
+ end
3356
+ end
3357
+
3358
+ # Schema type: WebhookDeliveryResponse
3359
+ class WebhookDeliveryResponse
3360
+ # @return [String]
3361
+ attr_accessor :id
3362
+ # @return [String]
3363
+ attr_accessor :project_id
3364
+ # @return [String]
3365
+ attr_accessor :webhook_endpoint_id
3366
+ # @return [String]
3367
+ attr_accessor :event_type
3368
+ # @return [String]
3369
+ attr_accessor :status
3370
+ # @return [Integer]
3371
+ attr_accessor :attempt_count
3372
+ # @return [Integer, nil]
3373
+ attr_accessor :last_status_code
3374
+ # @return [String, nil]
3375
+ attr_accessor :last_error
3376
+ # @return [String, nil]
3377
+ attr_accessor :response_body_snippet
3378
+ # @return [String, nil]
3379
+ attr_accessor :next_attempt_at
3380
+ # @return [String]
3381
+ attr_accessor :created_at
3382
+ # @return [String]
3383
+ attr_accessor :updated_at
3384
+
3385
+ # @param id [String], project_id [String], webhook_endpoint_id [String], event_type [String], status [String], attempt_count [Integer], last_status_code [Integer, nil], last_error [String, nil], response_body_snippet [String, nil], next_attempt_at [String, nil], created_at [String], updated_at [String]
3386
+ def initialize(id: , project_id: , webhook_endpoint_id: , event_type: , status: , attempt_count: , last_status_code: , last_error: , response_body_snippet: , next_attempt_at: , created_at: , updated_at: )
3387
+ @id = id
3388
+ @project_id = project_id
3389
+ @webhook_endpoint_id = webhook_endpoint_id
3390
+ @event_type = event_type
3391
+ @status = status
3392
+ @attempt_count = attempt_count
3393
+ @last_status_code = last_status_code
3394
+ @last_error = last_error
3395
+ @response_body_snippet = response_body_snippet
3396
+ @next_attempt_at = next_attempt_at
3397
+ @created_at = created_at
3398
+ @updated_at = updated_at
3399
+ end
3400
+
3401
+ # @return [Hash] a hash representation of this object
3402
+ def to_h
3403
+ {
3404
+ id: @id,
3405
+ project_id: @project_id,
3406
+ webhook_endpoint_id: @webhook_endpoint_id,
3407
+ event_type: @event_type,
3408
+ status: @status,
3409
+ attempt_count: @attempt_count,
3410
+ last_status_code: @last_status_code,
3411
+ last_error: @last_error,
3412
+ response_body_snippet: @response_body_snippet,
3413
+ next_attempt_at: @next_attempt_at,
3414
+ created_at: @created_at,
3415
+ updated_at: @updated_at,
3416
+ }.compact
3417
+ end
3418
+
3419
+ # Create an instance from a parsed JSON hash.
3420
+ # @param attributes [Hash]
3421
+ # @return [WebhookDeliveryResponse]
3422
+ def self.from_json(attributes)
3423
+ return nil unless attributes.is_a?(Hash)
3424
+
3425
+ new(
3426
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
3427
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
3428
+ webhook_endpoint_id: attributes.key?("webhookEndpointId") ? attributes["webhookEndpointId"] : attributes[:webhook_endpoint_id],
3429
+ event_type: attributes.key?("eventType") ? attributes["eventType"] : attributes[:event_type],
3430
+ status: attributes.key?("status") ? attributes["status"] : attributes[:status],
3431
+ attempt_count: attributes.key?("attemptCount") ? attributes["attemptCount"] : attributes[:attempt_count],
3432
+ last_status_code: attributes.key?("lastStatusCode") ? attributes["lastStatusCode"] : attributes[:last_status_code],
3433
+ last_error: attributes.key?("lastError") ? attributes["lastError"] : attributes[:last_error],
3434
+ response_body_snippet: attributes.key?("responseBodySnippet") ? attributes["responseBodySnippet"] : attributes[:response_body_snippet],
3435
+ next_attempt_at: attributes.key?("nextAttemptAt") ? attributes["nextAttemptAt"] : attributes[:next_attempt_at],
3436
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
3437
+ updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
3438
+ )
3439
+ end
3440
+ end
3441
+
3442
+ # Schema type: WebhookDeliveryPageResponse
3443
+ class WebhookDeliveryPageResponse
3444
+ # @return [Array<WebhookDeliveryResponse>]
3445
+ attr_accessor :data
3446
+ # @return [PageInfo]
3447
+ attr_accessor :page
3448
+
3449
+ # @param data [Array<WebhookDeliveryResponse>], page [PageInfo]
3450
+ def initialize(data: , page: )
3451
+ @data = data
3452
+ @page = page
3453
+ end
3454
+
3455
+ # @return [Hash] a hash representation of this object
3456
+ def to_h
3457
+ {
3458
+ data: @data,
3459
+ page: @page,
3460
+ }.compact
3461
+ end
3462
+
3463
+ # Create an instance from a parsed JSON hash.
3464
+ # @param attributes [Hash]
3465
+ # @return [WebhookDeliveryPageResponse]
3466
+ def self.from_json(attributes)
3467
+ return nil unless attributes.is_a?(Hash)
3468
+
3469
+ new(
3470
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
3471
+ page: attributes.key?("page") ? attributes["page"] : attributes[:page],
3472
+ )
3473
+ end
3474
+ end
3475
+
3476
+ # Schema type: CreateWebhookBody
3477
+ class CreateWebhookBody
3478
+ # @return [String]
3479
+ attr_accessor :url
3480
+ # @return [Array<String>]
3481
+ attr_accessor :events
3482
+ # @return [String, nil]
3483
+ attr_accessor :name
3484
+ # @return [String, nil]
3485
+ attr_accessor :secret
3486
+ # @return [Array<WebhookFilterSerializable>]
3487
+ attr_accessor :filters
3488
+ # @return [Array<WebhookTransformationSerializable>]
3489
+ attr_accessor :transformations
3490
+
3491
+ # @param url [String], events [Array<String>], name [String, nil], secret [String, nil], filters [Array<WebhookFilterSerializable>], transformations [Array<WebhookTransformationSerializable>]
3492
+ def initialize(url: , events: , name: nil, secret: nil, filters: nil, transformations: nil)
3493
+ @url = url
3494
+ @events = events
3495
+ @name = name
3496
+ @secret = secret
3497
+ @filters = filters
3498
+ @transformations = transformations
3499
+ end
3500
+
3501
+ # @return [Hash] a hash representation of this object
3502
+ def to_h
3503
+ {
3504
+ url: @url,
3505
+ events: @events,
3506
+ name: @name,
3507
+ secret: @secret,
3508
+ filters: @filters,
3509
+ transformations: @transformations,
3510
+ }.compact
3511
+ end
3512
+
3513
+ # Create an instance from a parsed JSON hash.
3514
+ # @param attributes [Hash]
3515
+ # @return [CreateWebhookBody]
3516
+ def self.from_json(attributes)
3517
+ return nil unless attributes.is_a?(Hash)
3518
+
3519
+ new(
3520
+ url: attributes.key?("url") ? attributes["url"] : attributes[:url],
3521
+ events: attributes.key?("events") ? attributes["events"] : attributes[:events],
3522
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
3523
+ secret: attributes.key?("secret") ? attributes["secret"] : attributes[:secret],
3524
+ filters: attributes.key?("filters") ? attributes["filters"] : attributes[:filters],
3525
+ transformations: attributes.key?("transformations") ? attributes["transformations"] : attributes[:transformations],
3526
+ )
3527
+ end
3528
+ end
3529
+
3530
+ # Schema type: WebhookCreateResponse
3531
+ class WebhookCreateResponse
3532
+ # @return [String]
3533
+ attr_accessor :id
3534
+ # @return [String]
3535
+ attr_accessor :project_id
3536
+ # @return [String]
3537
+ attr_accessor :name
3538
+ # @return [String]
3539
+ attr_accessor :url
3540
+ # @return [Array<String>]
3541
+ attr_accessor :events
3542
+ # @return [Boolean]
3543
+ attr_accessor :enabled
3544
+ # @return [Array<WebhookFilterSerializable>]
3545
+ attr_accessor :filters
3546
+ # @return [Array<WebhookTransformationSerializable>]
3547
+ attr_accessor :transformations
3548
+ # @return [String]
3549
+ attr_accessor :created_at
3550
+ # @return [String]
3551
+ attr_accessor :updated_at
3552
+ # @return [String]
3553
+ attr_accessor :secret
3554
+
3555
+ # @param id [String], project_id [String], name [String], url [String], events [Array<String>], enabled [Boolean], filters [Array<WebhookFilterSerializable>], transformations [Array<WebhookTransformationSerializable>], created_at [String], updated_at [String], secret [String]
3556
+ def initialize(id: , project_id: , name: , url: , events: , enabled: , filters: , transformations: , created_at: , updated_at: , secret: )
3557
+ @id = id
3558
+ @project_id = project_id
3559
+ @name = name
3560
+ @url = url
3561
+ @events = events
3562
+ @enabled = enabled
3563
+ @filters = filters
3564
+ @transformations = transformations
3565
+ @created_at = created_at
3566
+ @updated_at = updated_at
3567
+ @secret = secret
3568
+ end
3569
+
3570
+ # @return [Hash] a hash representation of this object
3571
+ def to_h
3572
+ {
3573
+ id: @id,
3574
+ project_id: @project_id,
3575
+ name: @name,
3576
+ url: @url,
3577
+ events: @events,
3578
+ enabled: @enabled,
3579
+ filters: @filters,
3580
+ transformations: @transformations,
3581
+ created_at: @created_at,
3582
+ updated_at: @updated_at,
3583
+ secret: @secret,
3584
+ }.compact
3585
+ end
3586
+
3587
+ # Create an instance from a parsed JSON hash.
3588
+ # @param attributes [Hash]
3589
+ # @return [WebhookCreateResponse]
3590
+ def self.from_json(attributes)
3591
+ return nil unless attributes.is_a?(Hash)
3592
+
3593
+ new(
3594
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
3595
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
3596
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
3597
+ url: attributes.key?("url") ? attributes["url"] : attributes[:url],
3598
+ events: attributes.key?("events") ? attributes["events"] : attributes[:events],
3599
+ enabled: attributes.key?("enabled") ? attributes["enabled"] : attributes[:enabled],
3600
+ filters: attributes.key?("filters") ? attributes["filters"] : attributes[:filters],
3601
+ transformations: attributes.key?("transformations") ? attributes["transformations"] : attributes[:transformations],
3602
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
3603
+ updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
3604
+ secret: attributes.key?("secret") ? attributes["secret"] : attributes[:secret],
3605
+ )
3606
+ end
3607
+ end
3608
+
3609
+ # Schema type: UpdateWebhookBody
3610
+ class UpdateWebhookBody
3611
+ # @return [String, nil]
3612
+ attr_accessor :name
3613
+ # @return [String, nil]
3614
+ attr_accessor :url
3615
+ # @return [Array<String>]
3616
+ attr_accessor :events
3617
+ # @return [String, nil]
3618
+ attr_accessor :secret
3619
+ # @return [Boolean, nil]
3620
+ attr_accessor :enabled
3621
+ # @return [Array<WebhookFilterSerializable>]
3622
+ attr_accessor :filters
3623
+ # @return [Array<WebhookTransformationSerializable>]
3624
+ attr_accessor :transformations
3625
+
3626
+ # @param name [String, nil], url [String, nil], events [Array<String>], secret [String, nil], enabled [Boolean, nil], filters [Array<WebhookFilterSerializable>], transformations [Array<WebhookTransformationSerializable>]
3627
+ def initialize(name: nil, url: nil, events: nil, secret: nil, enabled: nil, filters: nil, transformations: nil)
3628
+ @name = name
3629
+ @url = url
3630
+ @events = events
3631
+ @secret = secret
3632
+ @enabled = enabled
3633
+ @filters = filters
3634
+ @transformations = transformations
3635
+ end
3636
+
3637
+ # @return [Hash] a hash representation of this object
3638
+ def to_h
3639
+ {
3640
+ name: @name,
3641
+ url: @url,
3642
+ events: @events,
3643
+ secret: @secret,
3644
+ enabled: @enabled,
3645
+ filters: @filters,
3646
+ transformations: @transformations,
3647
+ }.compact
3648
+ end
3649
+
3650
+ # Create an instance from a parsed JSON hash.
3651
+ # @param attributes [Hash]
3652
+ # @return [UpdateWebhookBody]
3653
+ def self.from_json(attributes)
3654
+ return nil unless attributes.is_a?(Hash)
3655
+
3656
+ new(
3657
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
3658
+ url: attributes.key?("url") ? attributes["url"] : attributes[:url],
3659
+ events: attributes.key?("events") ? attributes["events"] : attributes[:events],
3660
+ secret: attributes.key?("secret") ? attributes["secret"] : attributes[:secret],
3661
+ enabled: attributes.key?("enabled") ? attributes["enabled"] : attributes[:enabled],
3662
+ filters: attributes.key?("filters") ? attributes["filters"] : attributes[:filters],
3663
+ transformations: attributes.key?("transformations") ? attributes["transformations"] : attributes[:transformations],
3664
+ )
3665
+ end
3666
+ end
3667
+
3668
+ # Schema type: ApiKey
3669
+ class ApiKey
3670
+ # @return [String]
3671
+ attr_accessor :id
3672
+ # @return [String]
3673
+ attr_accessor :config_id
3674
+ # @return [String, nil]
3675
+ attr_accessor :name
3676
+ # @return [String, nil]
3677
+ attr_accessor :start
3678
+ # @return [String, nil]
3679
+ attr_accessor :prefix
3680
+ # @return [String]
3681
+ attr_accessor :organization_id
3682
+ # @return [String, nil]
3683
+ attr_accessor :project_id
3684
+ # @return [Boolean]
3685
+ attr_accessor :enabled
3686
+ # @return [Boolean]
3687
+ attr_accessor :rate_limit_enabled
3688
+ # @return [Integer, nil]
3689
+ attr_accessor :rate_limit_time_window
3690
+ # @return [Integer, nil]
3691
+ attr_accessor :rate_limit_max
3692
+ # @return [Integer]
3693
+ attr_accessor :request_count
3694
+ # @return [Integer, nil]
3695
+ attr_accessor :remaining
3696
+ # @return [String, nil]
3697
+ attr_accessor :last_request
3698
+ # @return [String, nil]
3699
+ attr_accessor :expires_at
3700
+ # @return [String]
3701
+ attr_accessor :created_at
3702
+ # @return [String]
3703
+ attr_accessor :updated_at
3704
+ # @return [Hash{String => String}]
3705
+ attr_accessor :metadata
3706
+ # @return [Hash{String => Array<String>}]
3707
+ attr_accessor :permissions
3708
+
3709
+ # @param id [String], config_id [String], name [String, nil], start [String, nil], prefix [String, nil], organization_id [String], project_id [String, nil], enabled [Boolean], rate_limit_enabled [Boolean], rate_limit_time_window [Integer, nil], rate_limit_max [Integer, nil], request_count [Integer], remaining [Integer, nil], last_request [String, nil], expires_at [String, nil], created_at [String], updated_at [String], metadata [Hash{String => String}], permissions [Hash{String => Array<String>}]
3710
+ def initialize(id: , config_id: , name: , start: , prefix: , organization_id: , project_id: , enabled: , rate_limit_enabled: , rate_limit_time_window: , rate_limit_max: , request_count: , remaining: , last_request: , expires_at: , created_at: , updated_at: , metadata: , permissions: )
3711
+ @id = id
3712
+ @config_id = config_id
3713
+ @name = name
3714
+ @start = start
3715
+ @prefix = prefix
3716
+ @organization_id = organization_id
3717
+ @project_id = project_id
3718
+ @enabled = enabled
3719
+ @rate_limit_enabled = rate_limit_enabled
3720
+ @rate_limit_time_window = rate_limit_time_window
3721
+ @rate_limit_max = rate_limit_max
3722
+ @request_count = request_count
3723
+ @remaining = remaining
3724
+ @last_request = last_request
3725
+ @expires_at = expires_at
3726
+ @created_at = created_at
3727
+ @updated_at = updated_at
3728
+ @metadata = metadata
3729
+ @permissions = permissions
3730
+ end
3731
+
3732
+ # @return [Hash] a hash representation of this object
3733
+ def to_h
3734
+ {
3735
+ id: @id,
3736
+ config_id: @config_id,
3737
+ name: @name,
3738
+ start: @start,
3739
+ prefix: @prefix,
3740
+ organization_id: @organization_id,
3741
+ project_id: @project_id,
3742
+ enabled: @enabled,
3743
+ rate_limit_enabled: @rate_limit_enabled,
3744
+ rate_limit_time_window: @rate_limit_time_window,
3745
+ rate_limit_max: @rate_limit_max,
3746
+ request_count: @request_count,
3747
+ remaining: @remaining,
3748
+ last_request: @last_request,
3749
+ expires_at: @expires_at,
3750
+ created_at: @created_at,
3751
+ updated_at: @updated_at,
3752
+ metadata: @metadata,
3753
+ permissions: @permissions,
3754
+ }.compact
3755
+ end
3756
+
3757
+ # Create an instance from a parsed JSON hash.
3758
+ # @param attributes [Hash]
3759
+ # @return [ApiKey]
3760
+ def self.from_json(attributes)
3761
+ return nil unless attributes.is_a?(Hash)
3762
+
3763
+ new(
3764
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
3765
+ config_id: attributes.key?("configId") ? attributes["configId"] : attributes[:config_id],
3766
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
3767
+ start: attributes.key?("start") ? attributes["start"] : attributes[:start],
3768
+ prefix: attributes.key?("prefix") ? attributes["prefix"] : attributes[:prefix],
3769
+ organization_id: attributes.key?("organizationId") ? attributes["organizationId"] : attributes[:organization_id],
3770
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
3771
+ enabled: attributes.key?("enabled") ? attributes["enabled"] : attributes[:enabled],
3772
+ rate_limit_enabled: attributes.key?("rateLimitEnabled") ? attributes["rateLimitEnabled"] : attributes[:rate_limit_enabled],
3773
+ rate_limit_time_window: attributes.key?("rateLimitTimeWindow") ? attributes["rateLimitTimeWindow"] : attributes[:rate_limit_time_window],
3774
+ rate_limit_max: attributes.key?("rateLimitMax") ? attributes["rateLimitMax"] : attributes[:rate_limit_max],
3775
+ request_count: attributes.key?("requestCount") ? attributes["requestCount"] : attributes[:request_count],
3776
+ remaining: attributes.key?("remaining") ? attributes["remaining"] : attributes[:remaining],
3777
+ last_request: attributes.key?("lastRequest") ? attributes["lastRequest"] : attributes[:last_request],
3778
+ expires_at: attributes.key?("expiresAt") ? attributes["expiresAt"] : attributes[:expires_at],
3779
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
3780
+ updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
3781
+ metadata: attributes.key?("metadata") ? attributes["metadata"] : attributes[:metadata],
3782
+ permissions: attributes.key?("permissions") ? attributes["permissions"] : attributes[:permissions],
3783
+ )
3784
+ end
3785
+ end
3786
+
3787
+ # Schema type: ApiKeyUsageRecord
3788
+ class ApiKeyUsageRecord
3789
+ # @return [String]
3790
+ attr_accessor :id
3791
+ # @return [String]
3792
+ attr_accessor :key_id
3793
+ # @return [String]
3794
+ attr_accessor :org_id
3795
+ # @return [String]
3796
+ attr_accessor :method
3797
+ # @return [String]
3798
+ attr_accessor :route
3799
+ # @return [Integer]
3800
+ attr_accessor :status_code
3801
+ # @return [Integer, nil]
3802
+ attr_accessor :duration_ms
3803
+ # @return [String, nil]
3804
+ attr_accessor :ip
3805
+ # @return [String]
3806
+ attr_accessor :ts
3807
+
3808
+ # @param id [String], key_id [String], org_id [String], method [String], route [String], status_code [Integer], duration_ms [Integer, nil], ip [String, nil], ts [String]
3809
+ def initialize(id: , key_id: , org_id: , method: , route: , status_code: , duration_ms: , ip: , ts: )
3810
+ @id = id
3811
+ @key_id = key_id
3812
+ @org_id = org_id
3813
+ @method = method
3814
+ @route = route
3815
+ @status_code = status_code
3816
+ @duration_ms = duration_ms
3817
+ @ip = ip
3818
+ @ts = ts
3819
+ end
3820
+
3821
+ # @return [Hash] a hash representation of this object
3822
+ def to_h
3823
+ {
3824
+ id: @id,
3825
+ key_id: @key_id,
3826
+ org_id: @org_id,
3827
+ method: @method,
3828
+ route: @route,
3829
+ status_code: @status_code,
3830
+ duration_ms: @duration_ms,
3831
+ ip: @ip,
3832
+ ts: @ts,
3833
+ }.compact
3834
+ end
3835
+
3836
+ # Create an instance from a parsed JSON hash.
3837
+ # @param attributes [Hash]
3838
+ # @return [ApiKeyUsageRecord]
3839
+ def self.from_json(attributes)
3840
+ return nil unless attributes.is_a?(Hash)
3841
+
3842
+ new(
3843
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
3844
+ key_id: attributes.key?("keyId") ? attributes["keyId"] : attributes[:key_id],
3845
+ org_id: attributes.key?("orgId") ? attributes["orgId"] : attributes[:org_id],
3846
+ method: attributes.key?("method") ? attributes["method"] : attributes[:method],
3847
+ route: attributes.key?("route") ? attributes["route"] : attributes[:route],
3848
+ status_code: attributes.key?("statusCode") ? attributes["statusCode"] : attributes[:status_code],
3849
+ duration_ms: attributes.key?("durationMs") ? attributes["durationMs"] : attributes[:duration_ms],
3850
+ ip: attributes.key?("ip") ? attributes["ip"] : attributes[:ip],
3851
+ ts: attributes.key?("ts") ? attributes["ts"] : attributes[:ts],
3852
+ )
3853
+ end
3854
+ end
3855
+
3856
+ # Schema type: UsagePage
3857
+ class UsagePage
3858
+ # @return [Integer]
3859
+ attr_accessor :size
3860
+ # @return [Integer]
3861
+ attr_accessor :total_pages
3862
+ # @return [Boolean]
3863
+ attr_accessor :has_more
3864
+
3865
+ # @param size [Integer], total_pages [Integer], has_more [Boolean]
3866
+ def initialize(size: , total_pages: , has_more: )
3867
+ @size = size
3868
+ @total_pages = total_pages
3869
+ @has_more = has_more
3870
+ end
3871
+
3872
+ # @return [Hash] a hash representation of this object
3873
+ def to_h
3874
+ {
3875
+ size: @size,
3876
+ total_pages: @total_pages,
3877
+ has_more: @has_more,
3878
+ }.compact
3879
+ end
3880
+
3881
+ # Create an instance from a parsed JSON hash.
3882
+ # @param attributes [Hash]
3883
+ # @return [UsagePage]
3884
+ def self.from_json(attributes)
3885
+ return nil unless attributes.is_a?(Hash)
3886
+
3887
+ new(
3888
+ size: attributes.key?("size") ? attributes["size"] : attributes[:size],
3889
+ total_pages: attributes.key?("totalPages") ? attributes["totalPages"] : attributes[:total_pages],
3890
+ has_more: attributes.key?("hasMore") ? attributes["hasMore"] : attributes[:has_more],
3891
+ )
3892
+ end
3893
+ end
3894
+
3895
+ # Schema type: ApiKeyUsageResponse
3896
+ class ApiKeyUsageResponse
3897
+ # @return [Array<ApiKeyUsageRecord>]
3898
+ attr_accessor :data
3899
+ # @return [UsagePage]
3900
+ attr_accessor :page
3901
+
3902
+ # @param data [Array<ApiKeyUsageRecord>], page [UsagePage]
3903
+ def initialize(data: , page: )
3904
+ @data = data
3905
+ @page = page
3906
+ end
3907
+
3908
+ # @return [Hash] a hash representation of this object
3909
+ def to_h
3910
+ {
3911
+ data: @data,
3912
+ page: @page,
3913
+ }.compact
3914
+ end
3915
+
3916
+ # Create an instance from a parsed JSON hash.
3917
+ # @param attributes [Hash]
3918
+ # @return [ApiKeyUsageResponse]
3919
+ def self.from_json(attributes)
3920
+ return nil unless attributes.is_a?(Hash)
3921
+
3922
+ new(
3923
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
3924
+ page: attributes.key?("page") ? attributes["page"] : attributes[:page],
3925
+ )
3926
+ end
3927
+ end
3928
+
3929
+ # Schema type: ProjectLimitsModel
3930
+ class ProjectLimitsModel
3931
+ # @return [Integer]
3932
+ attr_accessor :daily_sends
3933
+ # @return [Integer]
3934
+ attr_accessor :per_second_sends
3935
+ # @return [Integer]
3936
+ attr_accessor :max_recipients_per_message
3937
+ # @return [Integer]
3938
+ attr_accessor :max_domains
3939
+ # @return [Integer]
3940
+ attr_accessor :max_api_keys
3941
+ # @return [Integer]
3942
+ attr_accessor :max_webhooks
3943
+
3944
+ # @param daily_sends [Integer], per_second_sends [Integer], max_recipients_per_message [Integer], max_domains [Integer], max_api_keys [Integer], max_webhooks [Integer]
3945
+ def initialize(daily_sends: , per_second_sends: , max_recipients_per_message: , max_domains: , max_api_keys: , max_webhooks: )
3946
+ @daily_sends = daily_sends
3947
+ @per_second_sends = per_second_sends
3948
+ @max_recipients_per_message = max_recipients_per_message
3949
+ @max_domains = max_domains
3950
+ @max_api_keys = max_api_keys
3951
+ @max_webhooks = max_webhooks
3952
+ end
3953
+
3954
+ # @return [Hash] a hash representation of this object
3955
+ def to_h
3956
+ {
3957
+ daily_sends: @daily_sends,
3958
+ per_second_sends: @per_second_sends,
3959
+ max_recipients_per_message: @max_recipients_per_message,
3960
+ max_domains: @max_domains,
3961
+ max_api_keys: @max_api_keys,
3962
+ max_webhooks: @max_webhooks,
3963
+ }.compact
3964
+ end
3965
+
3966
+ # Create an instance from a parsed JSON hash.
3967
+ # @param attributes [Hash]
3968
+ # @return [ProjectLimitsModel]
3969
+ def self.from_json(attributes)
3970
+ return nil unless attributes.is_a?(Hash)
3971
+
3972
+ new(
3973
+ daily_sends: attributes.key?("dailySends") ? attributes["dailySends"] : attributes[:daily_sends],
3974
+ per_second_sends: attributes.key?("perSecondSends") ? attributes["perSecondSends"] : attributes[:per_second_sends],
3975
+ max_recipients_per_message: attributes.key?("maxRecipientsPerMessage") ? attributes["maxRecipientsPerMessage"] : attributes[:max_recipients_per_message],
3976
+ max_domains: attributes.key?("maxDomains") ? attributes["maxDomains"] : attributes[:max_domains],
3977
+ max_api_keys: attributes.key?("maxApiKeys") ? attributes["maxApiKeys"] : attributes[:max_api_keys],
3978
+ max_webhooks: attributes.key?("maxWebhooks") ? attributes["maxWebhooks"] : attributes[:max_webhooks],
3979
+ )
3980
+ end
3981
+ end
3982
+
3983
+ # Schema type: ProjectTrackingSettingsModel
3984
+ class ProjectTrackingSettingsModel
3985
+ # @return [Boolean]
3986
+ attr_accessor :open_tracking
3987
+ # @return [Boolean]
3988
+ attr_accessor :click_tracking
3989
+ # @return [Boolean]
3990
+ attr_accessor :unsubscribe_tracking
3991
+ # @return [Boolean]
3992
+ attr_accessor :read_engagement
3993
+ # @return [Boolean]
3994
+ attr_accessor :scroll_depth
3995
+
3996
+ # @param open_tracking [Boolean], click_tracking [Boolean], unsubscribe_tracking [Boolean], read_engagement [Boolean], scroll_depth [Boolean]
3997
+ def initialize(open_tracking: , click_tracking: , unsubscribe_tracking: , read_engagement: , scroll_depth: nil)
3998
+ @open_tracking = open_tracking
3999
+ @click_tracking = click_tracking
4000
+ @unsubscribe_tracking = unsubscribe_tracking
4001
+ @read_engagement = read_engagement
4002
+ @scroll_depth = scroll_depth
4003
+ end
4004
+
4005
+ # @return [Hash] a hash representation of this object
4006
+ def to_h
4007
+ {
4008
+ open_tracking: @open_tracking,
4009
+ click_tracking: @click_tracking,
4010
+ unsubscribe_tracking: @unsubscribe_tracking,
4011
+ read_engagement: @read_engagement,
4012
+ scroll_depth: @scroll_depth,
4013
+ }.compact
4014
+ end
4015
+
4016
+ # Create an instance from a parsed JSON hash.
4017
+ # @param attributes [Hash]
4018
+ # @return [ProjectTrackingSettingsModel]
4019
+ def self.from_json(attributes)
4020
+ return nil unless attributes.is_a?(Hash)
4021
+
4022
+ new(
4023
+ open_tracking: attributes.key?("openTracking") ? attributes["openTracking"] : attributes[:open_tracking],
4024
+ click_tracking: attributes.key?("clickTracking") ? attributes["clickTracking"] : attributes[:click_tracking],
4025
+ unsubscribe_tracking: attributes.key?("unsubscribeTracking") ? attributes["unsubscribeTracking"] : attributes[:unsubscribe_tracking],
4026
+ read_engagement: attributes.key?("readEngagement") ? attributes["readEngagement"] : attributes[:read_engagement],
4027
+ scroll_depth: attributes.key?("scrollDepth") ? attributes["scrollDepth"] : attributes[:scroll_depth],
4028
+ )
4029
+ end
4030
+ end
4031
+
4032
+ # Schema type: ProjectResponse
4033
+ class ProjectResponse
4034
+ # @return [String]
4035
+ attr_accessor :id
4036
+ # @return [String]
4037
+ attr_accessor :name
4038
+ # @return [String]
4039
+ attr_accessor :slug
4040
+ # @return [String]
4041
+ attr_accessor :status
4042
+ # @return [String, nil]
4043
+ attr_accessor :suspension_reason
4044
+ # @return [String]
4045
+ attr_accessor :region
4046
+ # @return [ProjectLimitsModel]
4047
+ attr_accessor :limits
4048
+ # @return [ProjectTrackingSettingsModel]
4049
+ attr_accessor :tracking_settings
4050
+ # @return [String]
4051
+ attr_accessor :created_at
4052
+ # @return [String]
4053
+ attr_accessor :updated_at
4054
+
4055
+ # @param id [String], name [String], slug [String], status [String], suspension_reason [String, nil], region [String], limits [ProjectLimitsModel], tracking_settings [ProjectTrackingSettingsModel], created_at [String], updated_at [String]
4056
+ def initialize(id: , name: , slug: , status: , suspension_reason: , region: , limits: , tracking_settings: , created_at: , updated_at: )
4057
+ @id = id
4058
+ @name = name
4059
+ @slug = slug
4060
+ @status = status
4061
+ @suspension_reason = suspension_reason
4062
+ @region = region
4063
+ @limits = limits
4064
+ @tracking_settings = tracking_settings
4065
+ @created_at = created_at
4066
+ @updated_at = updated_at
4067
+ end
4068
+
4069
+ # @return [Hash] a hash representation of this object
4070
+ def to_h
4071
+ {
4072
+ id: @id,
4073
+ name: @name,
4074
+ slug: @slug,
4075
+ status: @status,
4076
+ suspension_reason: @suspension_reason,
4077
+ region: @region,
4078
+ limits: @limits,
4079
+ tracking_settings: @tracking_settings,
4080
+ created_at: @created_at,
4081
+ updated_at: @updated_at,
4082
+ }.compact
4083
+ end
4084
+
4085
+ # Create an instance from a parsed JSON hash.
4086
+ # @param attributes [Hash]
4087
+ # @return [ProjectResponse]
4088
+ def self.from_json(attributes)
4089
+ return nil unless attributes.is_a?(Hash)
4090
+
4091
+ new(
4092
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
4093
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
4094
+ slug: attributes.key?("slug") ? attributes["slug"] : attributes[:slug],
4095
+ status: attributes.key?("status") ? attributes["status"] : attributes[:status],
4096
+ suspension_reason: attributes.key?("suspensionReason") ? attributes["suspensionReason"] : attributes[:suspension_reason],
4097
+ region: attributes.key?("region") ? attributes["region"] : attributes[:region],
4098
+ limits: attributes.key?("limits") ? attributes["limits"] : attributes[:limits],
4099
+ tracking_settings: attributes.key?("trackingSettings") ? attributes["trackingSettings"] : attributes[:tracking_settings],
4100
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
4101
+ updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
4102
+ )
4103
+ end
4104
+ end
4105
+
4106
+ # Schema type: ProjectPageResponse
4107
+ class ProjectPageResponse
4108
+ # @return [Array<ProjectResponse>]
4109
+ attr_accessor :data
4110
+ # @return [PageInfo]
4111
+ attr_accessor :page
4112
+
4113
+ # @param data [Array<ProjectResponse>], page [PageInfo]
4114
+ def initialize(data: , page: )
4115
+ @data = data
4116
+ @page = page
4117
+ end
4118
+
4119
+ # @return [Hash] a hash representation of this object
4120
+ def to_h
4121
+ {
4122
+ data: @data,
4123
+ page: @page,
4124
+ }.compact
4125
+ end
4126
+
4127
+ # Create an instance from a parsed JSON hash.
4128
+ # @param attributes [Hash]
4129
+ # @return [ProjectPageResponse]
4130
+ def self.from_json(attributes)
4131
+ return nil unless attributes.is_a?(Hash)
4132
+
4133
+ new(
4134
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
4135
+ page: attributes.key?("page") ? attributes["page"] : attributes[:page],
4136
+ )
4137
+ end
4138
+ end
4139
+
4140
+ # Schema type: UpdateProjectRequest
4141
+ class UpdateProjectRequest
4142
+ # @return [String, nil]
4143
+ attr_accessor :name
4144
+ # @return [String, nil]
4145
+ attr_accessor :slug
4146
+ # @return [ProjectLimitsModel, nil]
4147
+ attr_accessor :limits
4148
+ # @return [ProjectTrackingSettingsModel, nil]
4149
+ attr_accessor :tracking_settings
4150
+
4151
+ # @param name [String, nil], slug [String, nil], limits [ProjectLimitsModel, nil], tracking_settings [ProjectTrackingSettingsModel, nil]
4152
+ def initialize(name: nil, slug: nil, limits: nil, tracking_settings: nil)
4153
+ @name = name
4154
+ @slug = slug
4155
+ @limits = limits
4156
+ @tracking_settings = tracking_settings
4157
+ end
4158
+
4159
+ # @return [Hash] a hash representation of this object
4160
+ def to_h
4161
+ {
4162
+ name: @name,
4163
+ slug: @slug,
4164
+ limits: @limits,
4165
+ tracking_settings: @tracking_settings,
4166
+ }.compact
4167
+ end
4168
+
4169
+ # Create an instance from a parsed JSON hash.
4170
+ # @param attributes [Hash]
4171
+ # @return [UpdateProjectRequest]
4172
+ def self.from_json(attributes)
4173
+ return nil unless attributes.is_a?(Hash)
4174
+
4175
+ new(
4176
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
4177
+ slug: attributes.key?("slug") ? attributes["slug"] : attributes[:slug],
4178
+ limits: attributes.key?("limits") ? attributes["limits"] : attributes[:limits],
4179
+ tracking_settings: attributes.key?("trackingSettings") ? attributes["trackingSettings"] : attributes[:tracking_settings],
4180
+ )
4181
+ end
4182
+ end
4183
+
4184
+ # Schema type: EmailPageResponse
4185
+ class EmailPageResponse
4186
+ # @return [Array<EmailDetailResponse>]
4187
+ attr_accessor :data
4188
+ # @return [PageInfo]
4189
+ attr_accessor :page
4190
+
4191
+ # @param data [Array<EmailDetailResponse>], page [PageInfo]
4192
+ def initialize(data: , page: )
4193
+ @data = data
4194
+ @page = page
4195
+ end
4196
+
4197
+ # @return [Hash] a hash representation of this object
4198
+ def to_h
4199
+ {
4200
+ data: @data,
4201
+ page: @page,
4202
+ }.compact
4203
+ end
4204
+
4205
+ # Create an instance from a parsed JSON hash.
4206
+ # @param attributes [Hash]
4207
+ # @return [EmailPageResponse]
4208
+ def self.from_json(attributes)
4209
+ return nil unless attributes.is_a?(Hash)
4210
+
4211
+ new(
4212
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
4213
+ page: attributes.key?("page") ? attributes["page"] : attributes[:page],
4214
+ )
4215
+ end
4216
+ end
4217
+
4218
+ # Schema type: EmailTimelineItem
4219
+ class EmailTimelineItem
4220
+ # @return [String]
4221
+ attr_accessor :id
4222
+ # @return [String]
4223
+ attr_accessor :type
4224
+ # @return [String, nil]
4225
+ attr_accessor :provider_event_id
4226
+ # @return [Hash{String => String, nil}]
4227
+ attr_accessor :payload
4228
+ # @return [String]
4229
+ attr_accessor :occurred_at
4230
+ # @return [String]
4231
+ attr_accessor :created_at
4232
+
4233
+ # @param id [String], type [String], provider_event_id [String, nil], payload [Hash{String => String, nil}], occurred_at [String], created_at [String]
4234
+ def initialize(id: , type: , provider_event_id: , payload: , occurred_at: , created_at: )
4235
+ @id = id
4236
+ @type = type
4237
+ @provider_event_id = provider_event_id
4238
+ @payload = payload
4239
+ @occurred_at = occurred_at
4240
+ @created_at = created_at
4241
+ end
4242
+
4243
+ # @return [Hash] a hash representation of this object
4244
+ def to_h
4245
+ {
4246
+ id: @id,
4247
+ type: @type,
4248
+ provider_event_id: @provider_event_id,
4249
+ payload: @payload,
4250
+ occurred_at: @occurred_at,
4251
+ created_at: @created_at,
4252
+ }.compact
4253
+ end
4254
+
4255
+ # Create an instance from a parsed JSON hash.
4256
+ # @param attributes [Hash]
4257
+ # @return [EmailTimelineItem]
4258
+ def self.from_json(attributes)
4259
+ return nil unless attributes.is_a?(Hash)
4260
+
4261
+ new(
4262
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
4263
+ type: attributes.key?("type") ? attributes["type"] : attributes[:type],
4264
+ provider_event_id: attributes.key?("providerEventId") ? attributes["providerEventId"] : attributes[:provider_event_id],
4265
+ payload: attributes.key?("payload") ? attributes["payload"] : attributes[:payload],
4266
+ occurred_at: attributes.key?("occurredAt") ? attributes["occurredAt"] : attributes[:occurred_at],
4267
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
4268
+ )
4269
+ end
4270
+ end
4271
+
4272
+ # Schema type: EmailTimelineResponse
4273
+ class EmailTimelineResponse
4274
+ # @return [Array<EmailTimelineItem>]
4275
+ attr_accessor :items
4276
+
4277
+ # @param items [Array<EmailTimelineItem>]
4278
+ def initialize(items: )
4279
+ @items = items
4280
+ end
4281
+
4282
+ # @return [Hash] a hash representation of this object
4283
+ def to_h
4284
+ {
4285
+ items: @items,
4286
+ }.compact
4287
+ end
4288
+
4289
+ # Create an instance from a parsed JSON hash.
4290
+ # @param attributes [Hash]
4291
+ # @return [EmailTimelineResponse]
4292
+ def self.from_json(attributes)
4293
+ return nil unless attributes.is_a?(Hash)
4294
+
4295
+ new(
4296
+ items: attributes.key?("items") ? attributes["items"] : attributes[:items],
4297
+ )
4298
+ end
4299
+ end
4300
+
4301
+ # Schema type: DomainListItemResponse
4302
+ class DomainListItemResponse
4303
+ # @return [String]
4304
+ attr_accessor :id
4305
+ # @return [String]
4306
+ attr_accessor :domain
4307
+ # @return [String]
4308
+ attr_accessor :region
4309
+ # @return [String]
4310
+ attr_accessor :status
4311
+ # @return [String]
4312
+ attr_accessor :dkim_status
4313
+ # @return [String]
4314
+ attr_accessor :bimi_status
4315
+ # @return [String]
4316
+ attr_accessor :tracking_status
4317
+ # @return [String]
4318
+ attr_accessor :updated_at
4319
+
4320
+ # @param id [String], domain [String], region [String], status [String], dkim_status [String], bimi_status [String], tracking_status [String], updated_at [String]
4321
+ def initialize(id: , domain: , region: , status: , dkim_status: , bimi_status: , tracking_status: , updated_at: )
4322
+ @id = id
4323
+ @domain = domain
4324
+ @region = region
4325
+ @status = status
4326
+ @dkim_status = dkim_status
4327
+ @bimi_status = bimi_status
4328
+ @tracking_status = tracking_status
4329
+ @updated_at = updated_at
4330
+ end
4331
+
4332
+ # @return [Hash] a hash representation of this object
4333
+ def to_h
4334
+ {
4335
+ id: @id,
4336
+ domain: @domain,
4337
+ region: @region,
4338
+ status: @status,
4339
+ dkim_status: @dkim_status,
4340
+ bimi_status: @bimi_status,
4341
+ tracking_status: @tracking_status,
4342
+ updated_at: @updated_at,
4343
+ }.compact
4344
+ end
4345
+
4346
+ # Create an instance from a parsed JSON hash.
4347
+ # @param attributes [Hash]
4348
+ # @return [DomainListItemResponse]
4349
+ def self.from_json(attributes)
4350
+ return nil unless attributes.is_a?(Hash)
4351
+
4352
+ new(
4353
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
4354
+ domain: attributes.key?("domain") ? attributes["domain"] : attributes[:domain],
4355
+ region: attributes.key?("region") ? attributes["region"] : attributes[:region],
4356
+ status: attributes.key?("status") ? attributes["status"] : attributes[:status],
4357
+ dkim_status: attributes.key?("dkimStatus") ? attributes["dkimStatus"] : attributes[:dkim_status],
4358
+ bimi_status: attributes.key?("bimiStatus") ? attributes["bimiStatus"] : attributes[:bimi_status],
4359
+ tracking_status: attributes.key?("trackingStatus") ? attributes["trackingStatus"] : attributes[:tracking_status],
4360
+ updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
4361
+ )
4362
+ end
4363
+ end
4364
+
4365
+ # Schema type: DomainListPageResponse
4366
+ class DomainListPageResponse
4367
+ # @return [Array<DomainListItemResponse>]
4368
+ attr_accessor :data
4369
+ # @return [PageInfo]
4370
+ attr_accessor :page
4371
+
4372
+ # @param data [Array<DomainListItemResponse>], page [PageInfo]
4373
+ def initialize(data: , page: )
4374
+ @data = data
4375
+ @page = page
4376
+ end
4377
+
4378
+ # @return [Hash] a hash representation of this object
4379
+ def to_h
4380
+ {
4381
+ data: @data,
4382
+ page: @page,
4383
+ }.compact
4384
+ end
4385
+
4386
+ # Create an instance from a parsed JSON hash.
4387
+ # @param attributes [Hash]
4388
+ # @return [DomainListPageResponse]
4389
+ def self.from_json(attributes)
4390
+ return nil unless attributes.is_a?(Hash)
4391
+
4392
+ new(
4393
+ data: attributes.key?("data") ? attributes["data"] : attributes[:data],
4394
+ page: attributes.key?("page") ? attributes["page"] : attributes[:page],
4395
+ )
4396
+ end
4397
+ end
4398
+
4399
+ # Schema type: DkimRecordResponse
4400
+ class DkimRecordResponse
4401
+ # @return [String]
4402
+ attr_accessor :name
4403
+ # @return [String]
4404
+ attr_accessor :type
4405
+ # @return [String]
4406
+ attr_accessor :value
4407
+ # @return [String, nil]
4408
+ attr_accessor :status
4409
+
4410
+ # @param name [String], type [String], value [String], status [String, nil]
4411
+ def initialize(name: , type: , value: , status: nil)
4412
+ @name = name
4413
+ @type = type
4414
+ @value = value
4415
+ @status = status
4416
+ end
4417
+
4418
+ # @return [Hash] a hash representation of this object
4419
+ def to_h
4420
+ {
4421
+ name: @name,
4422
+ type: @type,
4423
+ value: @value,
4424
+ status: @status,
4425
+ }.compact
4426
+ end
4427
+
4428
+ # Create an instance from a parsed JSON hash.
4429
+ # @param attributes [Hash]
4430
+ # @return [DkimRecordResponse]
4431
+ def self.from_json(attributes)
4432
+ return nil unless attributes.is_a?(Hash)
4433
+
4434
+ new(
4435
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
4436
+ type: attributes.key?("type") ? attributes["type"] : attributes[:type],
4437
+ value: attributes.key?("value") ? attributes["value"] : attributes[:value],
4438
+ status: attributes.key?("status") ? attributes["status"] : attributes[:status],
4439
+ )
4440
+ end
4441
+ end
4442
+
4443
+ # Schema type: DnsRecordResponse
4444
+ class DnsRecordResponse
4445
+ # @return [String]
4446
+ attr_accessor :name
4447
+ # @return [String]
4448
+ attr_accessor :type
4449
+ # @return [String]
4450
+ attr_accessor :value
4451
+ # @return [Integer, nil]
4452
+ attr_accessor :priority
4453
+ # @return [Boolean, nil]
4454
+ attr_accessor :optional
4455
+ # @return [String, nil]
4456
+ attr_accessor :status
4457
+
4458
+ # @param name [String], type [String], value [String], priority [Integer, nil], optional [Boolean, nil], status [String, nil]
4459
+ def initialize(name: , type: , value: , priority: nil, optional: nil, status: nil)
4460
+ @name = name
4461
+ @type = type
4462
+ @value = value
4463
+ @priority = priority
4464
+ @optional = optional
4465
+ @status = status
4466
+ end
4467
+
4468
+ # @return [Hash] a hash representation of this object
4469
+ def to_h
4470
+ {
4471
+ name: @name,
4472
+ type: @type,
4473
+ value: @value,
4474
+ priority: @priority,
4475
+ optional: @optional,
4476
+ status: @status,
4477
+ }.compact
4478
+ end
4479
+
4480
+ # Create an instance from a parsed JSON hash.
4481
+ # @param attributes [Hash]
4482
+ # @return [DnsRecordResponse]
4483
+ def self.from_json(attributes)
4484
+ return nil unless attributes.is_a?(Hash)
4485
+
4486
+ new(
4487
+ name: attributes.key?("name") ? attributes["name"] : attributes[:name],
4488
+ type: attributes.key?("type") ? attributes["type"] : attributes[:type],
4489
+ value: attributes.key?("value") ? attributes["value"] : attributes[:value],
4490
+ priority: attributes.key?("priority") ? attributes["priority"] : attributes[:priority],
4491
+ optional: attributes.key?("optional") ? attributes["optional"] : attributes[:optional],
4492
+ status: attributes.key?("status") ? attributes["status"] : attributes[:status],
4493
+ )
4494
+ end
4495
+ end
4496
+
4497
+ # Schema type: VerificationRecordsResponse
4498
+ class VerificationRecordsResponse
4499
+ # @return [Array<DkimRecordResponse>]
4500
+ attr_accessor :dkim
4501
+ # @return [DnsRecordResponse]
4502
+ attr_accessor :mail_from_mx
4503
+ # @return [DnsRecordResponse]
4504
+ attr_accessor :mail_from_spf
4505
+ # @return [DnsRecordResponse, nil]
4506
+ attr_accessor :dmarc_recommended
4507
+ # @return [DnsRecordResponse, nil]
4508
+ attr_accessor :bimi
4509
+ # @return [DnsRecordResponse, nil]
4510
+ attr_accessor :tracking_cname
4511
+
4512
+ # @param dkim [Array<DkimRecordResponse>], mail_from_mx [DnsRecordResponse], mail_from_spf [DnsRecordResponse], dmarc_recommended [DnsRecordResponse, nil], bimi [DnsRecordResponse, nil], tracking_cname [DnsRecordResponse, nil]
4513
+ def initialize(dkim: , mail_from_mx: , mail_from_spf: , dmarc_recommended: nil, bimi: nil, tracking_cname: nil)
4514
+ @dkim = dkim
4515
+ @mail_from_mx = mail_from_mx
4516
+ @mail_from_spf = mail_from_spf
4517
+ @dmarc_recommended = dmarc_recommended
4518
+ @bimi = bimi
4519
+ @tracking_cname = tracking_cname
4520
+ end
4521
+
4522
+ # @return [Hash] a hash representation of this object
4523
+ def to_h
4524
+ {
4525
+ dkim: @dkim,
4526
+ mail_from_mx: @mail_from_mx,
4527
+ mail_from_spf: @mail_from_spf,
4528
+ dmarc_recommended: @dmarc_recommended,
4529
+ bimi: @bimi,
4530
+ tracking_cname: @tracking_cname,
4531
+ }.compact
4532
+ end
4533
+
4534
+ # Create an instance from a parsed JSON hash.
4535
+ # @param attributes [Hash]
4536
+ # @return [VerificationRecordsResponse]
4537
+ def self.from_json(attributes)
4538
+ return nil unless attributes.is_a?(Hash)
4539
+
4540
+ new(
4541
+ dkim: attributes.key?("dkim") ? attributes["dkim"] : attributes[:dkim],
4542
+ mail_from_mx: attributes.key?("mailFromMx") ? attributes["mailFromMx"] : attributes[:mail_from_mx],
4543
+ mail_from_spf: attributes.key?("mailFromSpf") ? attributes["mailFromSpf"] : attributes[:mail_from_spf],
4544
+ dmarc_recommended: attributes.key?("dmarcRecommended") ? attributes["dmarcRecommended"] : attributes[:dmarc_recommended],
4545
+ bimi: attributes.key?("bimi") ? attributes["bimi"] : attributes[:bimi],
4546
+ tracking_cname: attributes.key?("trackingCname") ? attributes["trackingCname"] : attributes[:tracking_cname],
4547
+ )
4548
+ end
4549
+ end
4550
+
4551
+ # Schema type: DomainResponse
4552
+ class DomainResponse
4553
+ # @return [String]
4554
+ attr_accessor :id
4555
+ # @return [String]
4556
+ attr_accessor :project_id
4557
+ # @return [String]
4558
+ attr_accessor :domain
4559
+ # @return [String]
4560
+ attr_accessor :region
4561
+ # @return [String]
4562
+ attr_accessor :status
4563
+ # @return [String]
4564
+ attr_accessor :dkim_status
4565
+ # @return [String]
4566
+ attr_accessor :spf_status
4567
+ # @return [String]
4568
+ attr_accessor :dmarc_status
4569
+ # @return [String]
4570
+ attr_accessor :mail_from_status
4571
+ # @return [String]
4572
+ attr_accessor :mail_from_domain
4573
+ # @return [VerificationRecordsResponse]
4574
+ attr_accessor :verification_records
4575
+ # @return [String]
4576
+ attr_accessor :bimi_status
4577
+ # @return [String, nil]
4578
+ attr_accessor :bimi_logo_url
4579
+ # @return [String]
4580
+ attr_accessor :created_at
4581
+ # @return [String]
4582
+ attr_accessor :updated_at
4583
+ # @return [String, nil]
4584
+ attr_accessor :verified_at
4585
+
4586
+ # @param id [String], project_id [String], domain [String], region [String], status [String], dkim_status [String], spf_status [String], dmarc_status [String], mail_from_status [String], mail_from_domain [String], verification_records [VerificationRecordsResponse], bimi_status [String], bimi_logo_url [String, nil], created_at [String], updated_at [String], verified_at [String, nil]
4587
+ def initialize(id: , project_id: , domain: , region: , status: , dkim_status: , spf_status: , dmarc_status: , mail_from_status: , mail_from_domain: , verification_records: , bimi_status: , bimi_logo_url: , created_at: , updated_at: , verified_at: )
4588
+ @id = id
4589
+ @project_id = project_id
4590
+ @domain = domain
4591
+ @region = region
4592
+ @status = status
4593
+ @dkim_status = dkim_status
4594
+ @spf_status = spf_status
4595
+ @dmarc_status = dmarc_status
4596
+ @mail_from_status = mail_from_status
4597
+ @mail_from_domain = mail_from_domain
4598
+ @verification_records = verification_records
4599
+ @bimi_status = bimi_status
4600
+ @bimi_logo_url = bimi_logo_url
4601
+ @created_at = created_at
4602
+ @updated_at = updated_at
4603
+ @verified_at = verified_at
4604
+ end
4605
+
4606
+ # @return [Hash] a hash representation of this object
4607
+ def to_h
4608
+ {
4609
+ id: @id,
4610
+ project_id: @project_id,
4611
+ domain: @domain,
4612
+ region: @region,
4613
+ status: @status,
4614
+ dkim_status: @dkim_status,
4615
+ spf_status: @spf_status,
4616
+ dmarc_status: @dmarc_status,
4617
+ mail_from_status: @mail_from_status,
4618
+ mail_from_domain: @mail_from_domain,
4619
+ verification_records: @verification_records,
4620
+ bimi_status: @bimi_status,
4621
+ bimi_logo_url: @bimi_logo_url,
4622
+ created_at: @created_at,
4623
+ updated_at: @updated_at,
4624
+ verified_at: @verified_at,
4625
+ }.compact
4626
+ end
4627
+
4628
+ # Create an instance from a parsed JSON hash.
4629
+ # @param attributes [Hash]
4630
+ # @return [DomainResponse]
4631
+ def self.from_json(attributes)
4632
+ return nil unless attributes.is_a?(Hash)
4633
+
4634
+ new(
4635
+ id: attributes.key?("id") ? attributes["id"] : attributes[:id],
4636
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
4637
+ domain: attributes.key?("domain") ? attributes["domain"] : attributes[:domain],
4638
+ region: attributes.key?("region") ? attributes["region"] : attributes[:region],
4639
+ status: attributes.key?("status") ? attributes["status"] : attributes[:status],
4640
+ dkim_status: attributes.key?("dkimStatus") ? attributes["dkimStatus"] : attributes[:dkim_status],
4641
+ spf_status: attributes.key?("spfStatus") ? attributes["spfStatus"] : attributes[:spf_status],
4642
+ dmarc_status: attributes.key?("dmarcStatus") ? attributes["dmarcStatus"] : attributes[:dmarc_status],
4643
+ mail_from_status: attributes.key?("mailFromStatus") ? attributes["mailFromStatus"] : attributes[:mail_from_status],
4644
+ mail_from_domain: attributes.key?("mailFromDomain") ? attributes["mailFromDomain"] : attributes[:mail_from_domain],
4645
+ verification_records: attributes.key?("verificationRecords") ? attributes["verificationRecords"] : attributes[:verification_records],
4646
+ bimi_status: attributes.key?("bimiStatus") ? attributes["bimiStatus"] : attributes[:bimi_status],
4647
+ bimi_logo_url: attributes.key?("bimiLogoUrl") ? attributes["bimiLogoUrl"] : attributes[:bimi_logo_url],
4648
+ created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
4649
+ updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
4650
+ verified_at: attributes.key?("verifiedAt") ? attributes["verifiedAt"] : attributes[:verified_at],
4651
+ )
4652
+ end
4653
+ end
4654
+
4655
+ # Schema type: RegisterDomainRequest
4656
+ class RegisterDomainRequest
4657
+ # @return [String]
4658
+ attr_accessor :domain
4659
+ # @return [String]
4660
+ attr_accessor :region
4661
+
4662
+ # @param domain [String], region [String]
4663
+ def initialize(domain: , region: )
4664
+ @domain = domain
4665
+ @region = region
4666
+ end
4667
+
4668
+ # @return [Hash] a hash representation of this object
4669
+ def to_h
4670
+ {
4671
+ domain: @domain,
4672
+ region: @region,
4673
+ }.compact
4674
+ end
4675
+
4676
+ # Create an instance from a parsed JSON hash.
4677
+ # @param attributes [Hash]
4678
+ # @return [RegisterDomainRequest]
4679
+ def self.from_json(attributes)
4680
+ return nil unless attributes.is_a?(Hash)
4681
+
4682
+ new(
4683
+ domain: attributes.key?("domain") ? attributes["domain"] : attributes[:domain],
4684
+ region: attributes.key?("region") ? attributes["region"] : attributes[:region],
4685
+ )
4686
+ end
4687
+ end
4688
+
4689
+ # Schema type: UpdateBimiRequest
4690
+ class UpdateBimiRequest
4691
+ # @return [String, nil]
4692
+ attr_accessor :logo_url
4693
+
4694
+ # @param logo_url [String, nil]
4695
+ def initialize(logo_url: nil)
4696
+ @logo_url = logo_url
4697
+ end
4698
+
4699
+ # @return [Hash] a hash representation of this object
4700
+ def to_h
4701
+ {
4702
+ logo_url: @logo_url,
4703
+ }.compact
4704
+ end
4705
+
4706
+ # Create an instance from a parsed JSON hash.
4707
+ # @param attributes [Hash]
4708
+ # @return [UpdateBimiRequest]
4709
+ def self.from_json(attributes)
4710
+ return nil unless attributes.is_a?(Hash)
4711
+
4712
+ new(
4713
+ logo_url: attributes.key?("logoUrl") ? attributes["logoUrl"] : attributes[:logo_url],
4714
+ )
4715
+ end
4716
+ end
4717
+
4718
+ # Enum for EmailValidationStatusInput values.
4719
+ module EmailValidationStatusInput
4720
+ VALID = "valid"
4721
+ RISKY = "risky"
4722
+ INVALID = "invalid"
4723
+ UNKNOWN = "unknown"
4724
+
4725
+ # All valid enum values.
4726
+ # @return [Array]
4727
+ ALL = [
4728
+ VALID,
4729
+ RISKY,
4730
+ INVALID,
4731
+ UNKNOWN,
4732
+ ].freeze
4733
+
4734
+ # Check if a value is valid for this enum.
4735
+ # @param value [String, Integer]
4736
+ # @return [Boolean]
4737
+ def self.valid?(value)
4738
+ ALL.include?(value)
4739
+ end
4740
+ end
4741
+
4742
+ # Schema type: GetTopicPerformanceQuery
4743
+ class GetTopicPerformanceQuery
4744
+ # @return [String] Time window.
4745
+ attr_accessor :window
4746
+ # @return [String] Required for session auth; ignored for API key auth.
4747
+ attr_accessor :project_id
4748
+
4749
+ # @param window [String], project_id [String]
4750
+ def initialize(window: nil, project_id: nil)
4751
+ @window = window
4752
+ @project_id = project_id
4753
+ end
4754
+
4755
+ # @return [Hash] a hash representation of this object
4756
+ def to_h
4757
+ {
4758
+ window: @window,
4759
+ project_id: @project_id,
4760
+ }.compact
4761
+ end
4762
+
4763
+ # Create an instance from a parsed JSON hash.
4764
+ # @param attributes [Hash]
4765
+ # @return [GetTopicPerformanceQuery]
4766
+ def self.from_json(attributes)
4767
+ return nil unless attributes.is_a?(Hash)
4768
+
4769
+ new(
4770
+ window: attributes.key?("window") ? attributes["window"] : attributes[:window],
4771
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
4772
+ )
4773
+ end
4774
+ end
4775
+
4776
+ # Schema type: GetProjectMetricsSummaryQuery
4777
+ class GetProjectMetricsSummaryQuery
4778
+ # @return [String] Metrics time window.
4779
+ attr_accessor :window
4780
+ # @return [String] Required for session auth; ignored for API key auth.
4781
+ attr_accessor :project_id
4782
+
4783
+ # @param window [String], project_id [String]
4784
+ def initialize(window: nil, project_id: nil)
4785
+ @window = window
4786
+ @project_id = project_id
4787
+ end
4788
+
4789
+ # @return [Hash] a hash representation of this object
4790
+ def to_h
4791
+ {
4792
+ window: @window,
4793
+ project_id: @project_id,
4794
+ }.compact
4795
+ end
4796
+
4797
+ # Create an instance from a parsed JSON hash.
4798
+ # @param attributes [Hash]
4799
+ # @return [GetProjectMetricsSummaryQuery]
4800
+ def self.from_json(attributes)
4801
+ return nil unless attributes.is_a?(Hash)
4802
+
4803
+ new(
4804
+ window: attributes.key?("window") ? attributes["window"] : attributes[:window],
4805
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
4806
+ )
4807
+ end
4808
+ end
4809
+
4810
+ # Schema type: GetProjectMetricsTimelineQuery
4811
+ class GetProjectMetricsTimelineQuery
4812
+ # @return [String] Metrics time window.
4813
+ attr_accessor :window
4814
+ # @return [String] `hour` or `day`.
4815
+ attr_accessor :granularity
4816
+ # @return [String] `compact` or `detailed`.
4817
+ attr_accessor :format
4818
+ # @return [String] Required for session auth; ignored for API key auth.
4819
+ attr_accessor :project_id
4820
+
4821
+ # @param window [String], granularity [String], format [String], project_id [String]
4822
+ def initialize(window: nil, granularity: nil, format: nil, project_id: nil)
4823
+ @window = window
4824
+ @granularity = granularity
4825
+ @format = format
4826
+ @project_id = project_id
4827
+ end
4828
+
4829
+ # @return [Hash] a hash representation of this object
4830
+ def to_h
4831
+ {
4832
+ window: @window,
4833
+ granularity: @granularity,
4834
+ format: @format,
4835
+ project_id: @project_id,
4836
+ }.compact
4837
+ end
4838
+
4839
+ # Create an instance from a parsed JSON hash.
4840
+ # @param attributes [Hash]
4841
+ # @return [GetProjectMetricsTimelineQuery]
4842
+ def self.from_json(attributes)
4843
+ return nil unless attributes.is_a?(Hash)
4844
+
4845
+ new(
4846
+ window: attributes.key?("window") ? attributes["window"] : attributes[:window],
4847
+ granularity: attributes.key?("granularity") ? attributes["granularity"] : attributes[:granularity],
4848
+ format: attributes.key?("format") ? attributes["format"] : attributes[:format],
4849
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
4850
+ )
4851
+ end
4852
+ end
4853
+
4854
+ # Schema type: GetMetricsAdvisorQuery
4855
+ class GetMetricsAdvisorQuery
4856
+ # @return [String] Required for session auth; ignored for API key auth.
4857
+ attr_accessor :project_id
4858
+
4859
+ # @param project_id [String]
4860
+ def initialize(project_id: nil)
4861
+ @project_id = project_id
4862
+ end
4863
+
4864
+ # @return [Hash] a hash representation of this object
4865
+ def to_h
4866
+ {
4867
+ project_id: @project_id,
4868
+ }.compact
4869
+ end
4870
+
4871
+ # Create an instance from a parsed JSON hash.
4872
+ # @param attributes [Hash]
4873
+ # @return [GetMetricsAdvisorQuery]
4874
+ def self.from_json(attributes)
4875
+ return nil unless attributes.is_a?(Hash)
4876
+
4877
+ new(
4878
+ project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
4879
+ )
4880
+ end
4881
+ end
4882
+
4883
+ # ListContactSegmentsResponse — type alias for Array<String>
4884
+ ListContactSegmentsResponse = Array
4885
+
4886
+ # GetContactTopicsResponse — type alias for Array<TopicSubscriptionResponse>
4887
+ GetContactTopicsResponse = Array
4888
+
4889
+ # GetContactActivityResponse — type alias for Array<ActivityResponse>
4890
+ GetContactActivityResponse = Array
4891
+
4892
+ # Schema type without properties: ListApiKeysResponse
4893
+ class ListApiKeysResponse
4894
+ # @return [Hash] raw attributes
4895
+ attr_reader :attributes
4896
+
4897
+ # @param attributes [Hash]
4898
+ def initialize(attributes = {})
4899
+ @attributes = attributes
4900
+ end
4901
+
4902
+ # @return [Hash]
4903
+ def to_h
4904
+ @attributes.dup
4905
+ end
4906
+
4907
+ # Create an instance from a parsed JSON hash.
4908
+ # @param attributes [Hash]
4909
+ # @return [ListApiKeysResponse]
4910
+ def self.from_json(attributes)
4911
+ return nil unless attributes.is_a?(Hash)
4912
+
4913
+ new(attributes)
4914
+ end
4915
+ end
4916
+
4917
+ end