sendmux-management 1.0.0

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 (131) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +3 -0
  4. data/lib/sendmux/management/client.rb +66 -0
  5. data/lib/sendmux/management/version.rb +7 -0
  6. data/lib/sendmux/management.rb +12 -0
  7. data/lib/sendmux_management_generated/api/billing_api.rb +221 -0
  8. data/lib/sendmux_management_generated/api/domain_filters_api.rb +161 -0
  9. data/lib/sendmux_management_generated/api/domains_api.rb +419 -0
  10. data/lib/sendmux_management_generated/api/emails_api.rb +258 -0
  11. data/lib/sendmux_management_generated/api/inboxes_api.rb +175 -0
  12. data/lib/sendmux_management_generated/api/mailbox_filters_api.rb +161 -0
  13. data/lib/sendmux_management_generated/api/mailboxes_api.rb +659 -0
  14. data/lib/sendmux_management_generated/api/sending_accounts_api.rb +946 -0
  15. data/lib/sendmux_management_generated/api/webhooks_api.rb +666 -0
  16. data/lib/sendmux_management_generated/api_client.rb +441 -0
  17. data/lib/sendmux_management_generated/api_error.rb +58 -0
  18. data/lib/sendmux_management_generated/api_model_base.rb +88 -0
  19. data/lib/sendmux_management_generated/configuration.rb +393 -0
  20. data/lib/sendmux_management_generated/models/api_error_detail.rb +219 -0
  21. data/lib/sendmux_management_generated/models/api_error_error.rb +275 -0
  22. data/lib/sendmux_management_generated/models/api_error_meta.rb +164 -0
  23. data/lib/sendmux_management_generated/models/api_error_response.rb +216 -0
  24. data/lib/sendmux_management_generated/models/balance.rb +293 -0
  25. data/lib/sendmux_management_generated/models/balance_auto_topup.rb +226 -0
  26. data/lib/sendmux_management_generated/models/balance_response.rb +223 -0
  27. data/lib/sendmux_management_generated/models/cursor_pagination.rb +173 -0
  28. data/lib/sendmux_management_generated/models/delivery_log_item.rb +393 -0
  29. data/lib/sendmux_management_generated/models/delivery_log_item_cursor_list_response.rb +251 -0
  30. data/lib/sendmux_management_generated/models/delivery_log_item_response.rb +223 -0
  31. data/lib/sendmux_management_generated/models/domain_deleted_response.rb +223 -0
  32. data/lib/sendmux_management_generated/models/domain_deleted_response_all_of_data.rb +190 -0
  33. data/lib/sendmux_management_generated/models/domain_item_cursor_list_response.rb +251 -0
  34. data/lib/sendmux_management_generated/models/domain_item_response.rb +223 -0
  35. data/lib/sendmux_management_generated/models/domain_verify_response.rb +223 -0
  36. data/lib/sendmux_management_generated/models/email_metrics.rb +218 -0
  37. data/lib/sendmux_management_generated/models/email_metrics_comparison.rb +294 -0
  38. data/lib/sendmux_management_generated/models/email_metrics_comparison_change_pct.rb +268 -0
  39. data/lib/sendmux_management_generated/models/email_metrics_response.rb +223 -0
  40. data/lib/sendmux_management_generated/models/email_metrics_summary.rb +268 -0
  41. data/lib/sendmux_management_generated/models/email_metrics_timeseries_inner.rb +294 -0
  42. data/lib/sendmux_management_generated/models/filter_rule.rb +242 -0
  43. data/lib/sendmux_management_generated/models/filter_state.rb +218 -0
  44. data/lib/sendmux_management_generated/models/filter_state_response.rb +223 -0
  45. data/lib/sendmux_management_generated/models/incoming_log_item.rb +465 -0
  46. data/lib/sendmux_management_generated/models/incoming_log_item_cursor_list_response.rb +251 -0
  47. data/lib/sendmux_management_generated/models/incoming_log_item_response.rb +223 -0
  48. data/lib/sendmux_management_generated/models/mailbox.rb +284 -0
  49. data/lib/sendmux_management_generated/models/mailbox_app_password_result.rb +164 -0
  50. data/lib/sendmux_management_generated/models/mailbox_app_password_result_credential.rb +359 -0
  51. data/lib/sendmux_management_generated/models/mailbox_app_password_result_response.rb +223 -0
  52. data/lib/sendmux_management_generated/models/mailbox_create_result.rb +189 -0
  53. data/lib/sendmux_management_generated/models/mailbox_create_result_response.rb +223 -0
  54. data/lib/sendmux_management_generated/models/mailbox_credential.rb +353 -0
  55. data/lib/sendmux_management_generated/models/mailbox_deleted_response.rb +223 -0
  56. data/lib/sendmux_management_generated/models/mailbox_domain.rb +358 -0
  57. data/lib/sendmux_management_generated/models/mailbox_domain_dns_records.rb +276 -0
  58. data/lib/sendmux_management_generated/models/mailbox_domain_mx_record.rb +190 -0
  59. data/lib/sendmux_management_generated/models/mailbox_domain_name_value_record.rb +191 -0
  60. data/lib/sendmux_management_generated/models/mailbox_domain_verify_checks.rb +246 -0
  61. data/lib/sendmux_management_generated/models/mailbox_domain_verify_result.rb +242 -0
  62. data/lib/sendmux_management_generated/models/mailbox_item_cursor_list_response.rb +251 -0
  63. data/lib/sendmux_management_generated/models/mailbox_item_response.rb +223 -0
  64. data/lib/sendmux_management_generated/models/mailbox_key_deleted_response.rb +223 -0
  65. data/lib/sendmux_management_generated/models/mailbox_send_scope.rb +213 -0
  66. data/lib/sendmux_management_generated/models/management_create_domain_request.rb +165 -0
  67. data/lib/sendmux_management_generated/models/management_create_mailbox_key_request.rb +182 -0
  68. data/lib/sendmux_management_generated/models/management_create_mailbox_request.rb +257 -0
  69. data/lib/sendmux_management_generated/models/management_create_mailbox_request_send_scope.rb +210 -0
  70. data/lib/sendmux_management_generated/models/management_test_webhook200_response.rb +223 -0
  71. data/lib/sendmux_management_generated/models/provider_allowed_actions.rb +268 -0
  72. data/lib/sendmux_management_generated/models/provider_create_body.rb +579 -0
  73. data/lib/sendmux_management_generated/models/provider_create_body_quotas.rb +174 -0
  74. data/lib/sendmux_management_generated/models/provider_create_body_quotas_per_day.rb +104 -0
  75. data/lib/sendmux_management_generated/models/provider_create_body_quotas_per_day_any_of.rb +215 -0
  76. data/lib/sendmux_management_generated/models/provider_deleted.rb +190 -0
  77. data/lib/sendmux_management_generated/models/provider_deleted_response.rb +223 -0
  78. data/lib/sendmux_management_generated/models/provider_item.rb +695 -0
  79. data/lib/sendmux_management_generated/models/provider_item_cursor_list_response.rb +251 -0
  80. data/lib/sendmux_management_generated/models/provider_item_response.rb +223 -0
  81. data/lib/sendmux_management_generated/models/provider_limits.rb +190 -0
  82. data/lib/sendmux_management_generated/models/provider_limits_response.rb +223 -0
  83. data/lib/sendmux_management_generated/models/provider_quota_range.rb +208 -0
  84. data/lib/sendmux_management_generated/models/provider_quotas.rb +186 -0
  85. data/lib/sendmux_management_generated/models/provider_stats.rb +325 -0
  86. data/lib/sendmux_management_generated/models/provider_stats_response.rb +223 -0
  87. data/lib/sendmux_management_generated/models/provider_status_counts.rb +242 -0
  88. data/lib/sendmux_management_generated/models/provider_test_result.rb +251 -0
  89. data/lib/sendmux_management_generated/models/provider_test_result_response.rb +223 -0
  90. data/lib/sendmux_management_generated/models/provider_type_counts.rb +246 -0
  91. data/lib/sendmux_management_generated/models/provider_update_body.rb +537 -0
  92. data/lib/sendmux_management_generated/models/provider_usage.rb +216 -0
  93. data/lib/sendmux_management_generated/models/provider_usage_item.rb +374 -0
  94. data/lib/sendmux_management_generated/models/provider_usage_response.rb +223 -0
  95. data/lib/sendmux_management_generated/models/resource_limit_snapshot.rb +420 -0
  96. data/lib/sendmux_management_generated/models/response_meta.rb +164 -0
  97. data/lib/sendmux_management_generated/models/sending_account_limit_request.rb +190 -0
  98. data/lib/sendmux_management_generated/models/sending_account_limit_request_response.rb +223 -0
  99. data/lib/sendmux_management_generated/models/set_filter_state_body.rb +226 -0
  100. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit.rb +315 -0
  101. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request.rb +361 -0
  102. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_create.rb +190 -0
  103. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_create_request.rb +368 -0
  104. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_create_response.rb +223 -0
  105. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_page.rb +176 -0
  106. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_page_response.rb +223 -0
  107. data/lib/sendmux_management_generated/models/spend_summary.rb +292 -0
  108. data/lib/sendmux_management_generated/models/spend_summary_response.rb +223 -0
  109. data/lib/sendmux_management_generated/models/success_envelope.rb +192 -0
  110. data/lib/sendmux_management_generated/models/transaction.rb +332 -0
  111. data/lib/sendmux_management_generated/models/transaction_cursor_list_response.rb +251 -0
  112. data/lib/sendmux_management_generated/models/update_mailbox_body.rb +210 -0
  113. data/lib/sendmux_management_generated/models/webhook_create_body.rb +269 -0
  114. data/lib/sendmux_management_generated/models/webhook_deleted_response.rb +223 -0
  115. data/lib/sendmux_management_generated/models/webhook_delivery_attempt.rb +562 -0
  116. data/lib/sendmux_management_generated/models/webhook_delivery_attempt_cursor_list_response.rb +251 -0
  117. data/lib/sendmux_management_generated/models/webhook_delivery_payload.rb +359 -0
  118. data/lib/sendmux_management_generated/models/webhook_delivery_payload_response.rb +223 -0
  119. data/lib/sendmux_management_generated/models/webhook_event_data.rb +395 -0
  120. data/lib/sendmux_management_generated/models/webhook_event_payload.rb +297 -0
  121. data/lib/sendmux_management_generated/models/webhook_filters.rb +168 -0
  122. data/lib/sendmux_management_generated/models/webhook_subscription.rb +380 -0
  123. data/lib/sendmux_management_generated/models/webhook_subscription_cursor_list_response.rb +251 -0
  124. data/lib/sendmux_management_generated/models/webhook_subscription_response.rb +223 -0
  125. data/lib/sendmux_management_generated/models/webhook_subscription_with_secret.rb +414 -0
  126. data/lib/sendmux_management_generated/models/webhook_subscription_with_secret_response.rb +223 -0
  127. data/lib/sendmux_management_generated/models/webhook_test_response.rb +165 -0
  128. data/lib/sendmux_management_generated/models/webhook_update_body.rb +233 -0
  129. data/lib/sendmux_management_generated/version.rb +15 -0
  130. data/lib/sendmux_management_generated.rb +158 -0
  131. metadata +247 -0
@@ -0,0 +1,465 @@
1
+ =begin
2
+ #Sendmux API
3
+
4
+ #Programmatic access to your Sendmux email infrastructure.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Sendmux::Management::Generated
17
+ class IncomingLogItem < ApiModelBase
18
+ # Billable amount for this message in USD
19
+ attr_accessor :amount
20
+
21
+ # ISO 8601 usage bucket start
22
+ attr_accessor :billing_bucket_start
23
+
24
+ attr_accessor :event_type
25
+
26
+ attr_accessor :from_email
27
+
28
+ # Incoming log public ID
29
+ attr_accessor :id
30
+
31
+ attr_accessor :is_spam
32
+
33
+ # Mailbox email address
34
+ attr_accessor :mailbox_email
35
+
36
+ # Mailbox public ID
37
+ attr_accessor :mailbox_id
38
+
39
+ # Message identifier when available
40
+ attr_accessor :message_id
41
+
42
+ # Identifier source when available
43
+ attr_accessor :message_id_kind
44
+
45
+ # ISO 8601 received timestamp
46
+ attr_accessor :received_at
47
+
48
+ attr_accessor :size_bytes
49
+
50
+ attr_accessor :subject
51
+
52
+ attr_accessor :to_emails
53
+
54
+ # Per-message unit amount in USD
55
+ attr_accessor :unit_amount
56
+
57
+ class EnumAttributeValidator
58
+ attr_reader :datatype
59
+ attr_reader :allowable_values
60
+
61
+ def initialize(datatype, allowable_values)
62
+ @allowable_values = allowable_values.map do |value|
63
+ case datatype.to_s
64
+ when /Integer/i
65
+ value.to_i
66
+ when /Float/i
67
+ value.to_f
68
+ else
69
+ value
70
+ end
71
+ end
72
+ end
73
+
74
+ def valid?(value)
75
+ !value || allowable_values.include?(value)
76
+ end
77
+ end
78
+
79
+ # Attribute mapping from ruby-style variable name to JSON key.
80
+ def self.attribute_map
81
+ {
82
+ :'amount' => :'amount',
83
+ :'billing_bucket_start' => :'billing_bucket_start',
84
+ :'event_type' => :'event_type',
85
+ :'from_email' => :'from_email',
86
+ :'id' => :'id',
87
+ :'is_spam' => :'is_spam',
88
+ :'mailbox_email' => :'mailbox_email',
89
+ :'mailbox_id' => :'mailbox_id',
90
+ :'message_id' => :'message_id',
91
+ :'message_id_kind' => :'message_id_kind',
92
+ :'received_at' => :'received_at',
93
+ :'size_bytes' => :'size_bytes',
94
+ :'subject' => :'subject',
95
+ :'to_emails' => :'to_emails',
96
+ :'unit_amount' => :'unit_amount'
97
+ }
98
+ end
99
+
100
+ # Returns attribute mapping this model knows about
101
+ def self.acceptable_attribute_map
102
+ attribute_map
103
+ end
104
+
105
+ # Returns all the JSON keys this model knows about
106
+ def self.acceptable_attributes
107
+ acceptable_attribute_map.values
108
+ end
109
+
110
+ # Attribute type mapping.
111
+ def self.openapi_types
112
+ {
113
+ :'amount' => :'String',
114
+ :'billing_bucket_start' => :'String',
115
+ :'event_type' => :'String',
116
+ :'from_email' => :'String',
117
+ :'id' => :'String',
118
+ :'is_spam' => :'Boolean',
119
+ :'mailbox_email' => :'String',
120
+ :'mailbox_id' => :'String',
121
+ :'message_id' => :'String',
122
+ :'message_id_kind' => :'String',
123
+ :'received_at' => :'String',
124
+ :'size_bytes' => :'Float',
125
+ :'subject' => :'String',
126
+ :'to_emails' => :'Array<String>',
127
+ :'unit_amount' => :'String'
128
+ }
129
+ end
130
+
131
+ # List of attributes with nullable: true
132
+ def self.openapi_nullable
133
+ Set.new([
134
+ :'from_email',
135
+ :'mailbox_email',
136
+ :'mailbox_id',
137
+ :'message_id',
138
+ :'message_id_kind',
139
+ :'size_bytes',
140
+ :'subject',
141
+ ])
142
+ end
143
+
144
+ # Initializes the object
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ def initialize(attributes = {})
147
+ if (!attributes.is_a?(Hash))
148
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Management::Generated::IncomingLogItem` initialize method"
149
+ end
150
+
151
+ # check to see if the attribute exists and convert string to symbol for hash key
152
+ acceptable_attribute_map = self.class.acceptable_attribute_map
153
+ attributes = attributes.each_with_object({}) { |(k, v), h|
154
+ if (!acceptable_attribute_map.key?(k.to_sym))
155
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Management::Generated::IncomingLogItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
156
+ end
157
+ h[k.to_sym] = v
158
+ }
159
+
160
+ if attributes.key?(:'amount')
161
+ self.amount = attributes[:'amount']
162
+ else
163
+ self.amount = nil
164
+ end
165
+
166
+ if attributes.key?(:'billing_bucket_start')
167
+ self.billing_bucket_start = attributes[:'billing_bucket_start']
168
+ else
169
+ self.billing_bucket_start = nil
170
+ end
171
+
172
+ if attributes.key?(:'event_type')
173
+ self.event_type = attributes[:'event_type']
174
+ else
175
+ self.event_type = nil
176
+ end
177
+
178
+ if attributes.key?(:'from_email')
179
+ self.from_email = attributes[:'from_email']
180
+ else
181
+ self.from_email = nil
182
+ end
183
+
184
+ if attributes.key?(:'id')
185
+ self.id = attributes[:'id']
186
+ else
187
+ self.id = nil
188
+ end
189
+
190
+ if attributes.key?(:'is_spam')
191
+ self.is_spam = attributes[:'is_spam']
192
+ else
193
+ self.is_spam = nil
194
+ end
195
+
196
+ if attributes.key?(:'mailbox_email')
197
+ self.mailbox_email = attributes[:'mailbox_email']
198
+ else
199
+ self.mailbox_email = nil
200
+ end
201
+
202
+ if attributes.key?(:'mailbox_id')
203
+ self.mailbox_id = attributes[:'mailbox_id']
204
+ else
205
+ self.mailbox_id = nil
206
+ end
207
+
208
+ if attributes.key?(:'message_id')
209
+ self.message_id = attributes[:'message_id']
210
+ else
211
+ self.message_id = nil
212
+ end
213
+
214
+ if attributes.key?(:'message_id_kind')
215
+ self.message_id_kind = attributes[:'message_id_kind']
216
+ else
217
+ self.message_id_kind = nil
218
+ end
219
+
220
+ if attributes.key?(:'received_at')
221
+ self.received_at = attributes[:'received_at']
222
+ else
223
+ self.received_at = nil
224
+ end
225
+
226
+ if attributes.key?(:'size_bytes')
227
+ self.size_bytes = attributes[:'size_bytes']
228
+ else
229
+ self.size_bytes = nil
230
+ end
231
+
232
+ if attributes.key?(:'subject')
233
+ self.subject = attributes[:'subject']
234
+ else
235
+ self.subject = nil
236
+ end
237
+
238
+ if attributes.key?(:'to_emails')
239
+ if (value = attributes[:'to_emails']).is_a?(Array)
240
+ self.to_emails = value
241
+ end
242
+ else
243
+ self.to_emails = nil
244
+ end
245
+
246
+ if attributes.key?(:'unit_amount')
247
+ self.unit_amount = attributes[:'unit_amount']
248
+ else
249
+ self.unit_amount = nil
250
+ end
251
+ end
252
+
253
+ # Show invalid properties with the reasons. Usually used together with valid?
254
+ # @return Array for valid properties with the reasons
255
+ def list_invalid_properties
256
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
257
+ invalid_properties = Array.new
258
+ if @amount.nil?
259
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
260
+ end
261
+
262
+ if @billing_bucket_start.nil?
263
+ invalid_properties.push('invalid value for "billing_bucket_start", billing_bucket_start cannot be nil.')
264
+ end
265
+
266
+ if @event_type.nil?
267
+ invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
268
+ end
269
+
270
+ if @id.nil?
271
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
272
+ end
273
+
274
+ if @is_spam.nil?
275
+ invalid_properties.push('invalid value for "is_spam", is_spam cannot be nil.')
276
+ end
277
+
278
+ if @received_at.nil?
279
+ invalid_properties.push('invalid value for "received_at", received_at cannot be nil.')
280
+ end
281
+
282
+ if @to_emails.nil?
283
+ invalid_properties.push('invalid value for "to_emails", to_emails cannot be nil.')
284
+ end
285
+
286
+ if @unit_amount.nil?
287
+ invalid_properties.push('invalid value for "unit_amount", unit_amount cannot be nil.')
288
+ end
289
+
290
+ invalid_properties
291
+ end
292
+
293
+ # Check to see if the all the properties in the model are valid
294
+ # @return true if the model is valid
295
+ def valid?
296
+ warn '[DEPRECATED] the `valid?` method is obsolete'
297
+ return false if @amount.nil?
298
+ return false if @billing_bucket_start.nil?
299
+ return false if @event_type.nil?
300
+ event_type_validator = EnumAttributeValidator.new('String', ["message.received", "message.received.spam", "unknown_default_open_api"])
301
+ return false unless event_type_validator.valid?(@event_type)
302
+ return false if @id.nil?
303
+ return false if @is_spam.nil?
304
+ return false if @received_at.nil?
305
+ return false if @to_emails.nil?
306
+ return false if @unit_amount.nil?
307
+ true
308
+ end
309
+
310
+ # Custom attribute writer method with validation
311
+ # @param [Object] amount Value to be assigned
312
+ def amount=(amount)
313
+ if amount.nil?
314
+ fail ArgumentError, 'amount cannot be nil'
315
+ end
316
+
317
+ @amount = amount
318
+ end
319
+
320
+ # Custom attribute writer method with validation
321
+ # @param [Object] billing_bucket_start Value to be assigned
322
+ def billing_bucket_start=(billing_bucket_start)
323
+ if billing_bucket_start.nil?
324
+ fail ArgumentError, 'billing_bucket_start cannot be nil'
325
+ end
326
+
327
+ @billing_bucket_start = billing_bucket_start
328
+ end
329
+
330
+ # Custom attribute writer method checking allowed values (enum).
331
+ # @param [Object] event_type Object to be assigned
332
+ def event_type=(event_type)
333
+ validator = EnumAttributeValidator.new('String', ["message.received", "message.received.spam", "unknown_default_open_api"])
334
+ unless validator.valid?(event_type)
335
+ fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
336
+ end
337
+ @event_type = event_type
338
+ end
339
+
340
+ # Custom attribute writer method with validation
341
+ # @param [Object] id Value to be assigned
342
+ def id=(id)
343
+ if id.nil?
344
+ fail ArgumentError, 'id cannot be nil'
345
+ end
346
+
347
+ @id = id
348
+ end
349
+
350
+ # Custom attribute writer method with validation
351
+ # @param [Object] is_spam Value to be assigned
352
+ def is_spam=(is_spam)
353
+ if is_spam.nil?
354
+ fail ArgumentError, 'is_spam cannot be nil'
355
+ end
356
+
357
+ @is_spam = is_spam
358
+ end
359
+
360
+ # Custom attribute writer method with validation
361
+ # @param [Object] received_at Value to be assigned
362
+ def received_at=(received_at)
363
+ if received_at.nil?
364
+ fail ArgumentError, 'received_at cannot be nil'
365
+ end
366
+
367
+ @received_at = received_at
368
+ end
369
+
370
+ # Custom attribute writer method with validation
371
+ # @param [Object] to_emails Value to be assigned
372
+ def to_emails=(to_emails)
373
+ if to_emails.nil?
374
+ fail ArgumentError, 'to_emails cannot be nil'
375
+ end
376
+
377
+ @to_emails = to_emails
378
+ end
379
+
380
+ # Custom attribute writer method with validation
381
+ # @param [Object] unit_amount Value to be assigned
382
+ def unit_amount=(unit_amount)
383
+ if unit_amount.nil?
384
+ fail ArgumentError, 'unit_amount cannot be nil'
385
+ end
386
+
387
+ @unit_amount = unit_amount
388
+ end
389
+
390
+ # Checks equality by comparing each attribute.
391
+ # @param [Object] Object to be compared
392
+ def ==(o)
393
+ return true if self.equal?(o)
394
+ self.class == o.class &&
395
+ amount == o.amount &&
396
+ billing_bucket_start == o.billing_bucket_start &&
397
+ event_type == o.event_type &&
398
+ from_email == o.from_email &&
399
+ id == o.id &&
400
+ is_spam == o.is_spam &&
401
+ mailbox_email == o.mailbox_email &&
402
+ mailbox_id == o.mailbox_id &&
403
+ message_id == o.message_id &&
404
+ message_id_kind == o.message_id_kind &&
405
+ received_at == o.received_at &&
406
+ size_bytes == o.size_bytes &&
407
+ subject == o.subject &&
408
+ to_emails == o.to_emails &&
409
+ unit_amount == o.unit_amount
410
+ end
411
+
412
+ # @see the `==` method
413
+ # @param [Object] Object to be compared
414
+ def eql?(o)
415
+ self == o
416
+ end
417
+
418
+ # Calculates hash code according to all attributes.
419
+ # @return [Integer] Hash code
420
+ def hash
421
+ [amount, billing_bucket_start, event_type, from_email, id, is_spam, mailbox_email, mailbox_id, message_id, message_id_kind, received_at, size_bytes, subject, to_emails, unit_amount].hash
422
+ end
423
+
424
+ # Builds the object from hash
425
+ # @param [Hash] attributes Model attributes in the form of hash
426
+ # @return [Object] Returns the model itself
427
+ def self.build_from_hash(attributes)
428
+ return nil unless attributes.is_a?(Hash)
429
+ attributes = attributes.transform_keys(&:to_sym)
430
+ transformed_hash = {}
431
+ openapi_types.each_pair do |key, type|
432
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
433
+ transformed_hash["#{key}"] = nil
434
+ elsif type =~ /\AArray<(.*)>/i
435
+ # check to ensure the input is an array given that the attribute
436
+ # is documented as an array but the input is not
437
+ if attributes[attribute_map[key]].is_a?(Array)
438
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
439
+ end
440
+ elsif !attributes[attribute_map[key]].nil?
441
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
442
+ end
443
+ end
444
+ new(transformed_hash)
445
+ end
446
+
447
+ # Returns the object in the form of hash
448
+ # @return [Hash] Returns the object in the form of hash
449
+ def to_hash
450
+ hash = {}
451
+ self.class.attribute_map.each_pair do |attr, param|
452
+ value = self.send(attr)
453
+ if value.nil?
454
+ is_nullable = self.class.openapi_nullable.include?(attr)
455
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
456
+ end
457
+
458
+ hash[param] = _to_hash(value)
459
+ end
460
+ hash
461
+ end
462
+
463
+ end
464
+
465
+ end
@@ -0,0 +1,251 @@
1
+ =begin
2
+ #Sendmux API
3
+
4
+ #Programmatic access to your Sendmux email infrastructure.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Sendmux::Management::Generated
17
+ class IncomingLogItemCursorListResponse < ApiModelBase
18
+ attr_accessor :meta
19
+
20
+ attr_accessor :ok
21
+
22
+ attr_accessor :data
23
+
24
+ attr_accessor :pagination
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'meta' => :'meta',
30
+ :'ok' => :'ok',
31
+ :'data' => :'data',
32
+ :'pagination' => :'pagination'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'meta' => :'ResponseMeta',
50
+ :'ok' => :'Boolean',
51
+ :'data' => :'Array<IncomingLogItem>',
52
+ :'pagination' => :'CursorPagination'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # List of class defined in allOf (OpenAPI v3)
63
+ def self.openapi_all_of
64
+ [
65
+ :'SuccessEnvelope'
66
+ ]
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ if (!attributes.is_a?(Hash))
73
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Management::Generated::IncomingLogItemCursorListResponse` initialize method"
74
+ end
75
+
76
+ # check to see if the attribute exists and convert string to symbol for hash key
77
+ acceptable_attribute_map = self.class.acceptable_attribute_map
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!acceptable_attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Management::Generated::IncomingLogItemCursorListResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'meta')
86
+ self.meta = attributes[:'meta']
87
+ else
88
+ self.meta = nil
89
+ end
90
+
91
+ if attributes.key?(:'ok')
92
+ self.ok = attributes[:'ok']
93
+ else
94
+ self.ok = nil
95
+ end
96
+
97
+ if attributes.key?(:'data')
98
+ if (value = attributes[:'data']).is_a?(Array)
99
+ self.data = value
100
+ end
101
+ else
102
+ self.data = nil
103
+ end
104
+
105
+ if attributes.key?(:'pagination')
106
+ self.pagination = attributes[:'pagination']
107
+ else
108
+ self.pagination = nil
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
+ invalid_properties = Array.new
117
+ if @meta.nil?
118
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
119
+ end
120
+
121
+ if @ok.nil?
122
+ invalid_properties.push('invalid value for "ok", ok cannot be nil.')
123
+ end
124
+
125
+ if @data.nil?
126
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
127
+ end
128
+
129
+ if @pagination.nil?
130
+ invalid_properties.push('invalid value for "pagination", pagination cannot be nil.')
131
+ end
132
+
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ warn '[DEPRECATED] the `valid?` method is obsolete'
140
+ return false if @meta.nil?
141
+ return false if @ok.nil?
142
+ return false if @data.nil?
143
+ return false if @pagination.nil?
144
+ true
145
+ end
146
+
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] meta Value to be assigned
149
+ def meta=(meta)
150
+ if meta.nil?
151
+ fail ArgumentError, 'meta cannot be nil'
152
+ end
153
+
154
+ @meta = meta
155
+ end
156
+
157
+ # Custom attribute writer method with validation
158
+ # @param [Object] ok Value to be assigned
159
+ def ok=(ok)
160
+ if ok.nil?
161
+ fail ArgumentError, 'ok cannot be nil'
162
+ end
163
+
164
+ @ok = ok
165
+ end
166
+
167
+ # Custom attribute writer method with validation
168
+ # @param [Object] data Value to be assigned
169
+ def data=(data)
170
+ if data.nil?
171
+ fail ArgumentError, 'data cannot be nil'
172
+ end
173
+
174
+ @data = data
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] pagination Value to be assigned
179
+ def pagination=(pagination)
180
+ if pagination.nil?
181
+ fail ArgumentError, 'pagination cannot be nil'
182
+ end
183
+
184
+ @pagination = pagination
185
+ end
186
+
187
+ # Checks equality by comparing each attribute.
188
+ # @param [Object] Object to be compared
189
+ def ==(o)
190
+ return true if self.equal?(o)
191
+ self.class == o.class &&
192
+ meta == o.meta &&
193
+ ok == o.ok &&
194
+ data == o.data &&
195
+ pagination == o.pagination
196
+ end
197
+
198
+ # @see the `==` method
199
+ # @param [Object] Object to be compared
200
+ def eql?(o)
201
+ self == o
202
+ end
203
+
204
+ # Calculates hash code according to all attributes.
205
+ # @return [Integer] Hash code
206
+ def hash
207
+ [meta, ok, data, pagination].hash
208
+ end
209
+
210
+ # Builds the object from hash
211
+ # @param [Hash] attributes Model attributes in the form of hash
212
+ # @return [Object] Returns the model itself
213
+ def self.build_from_hash(attributes)
214
+ return nil unless attributes.is_a?(Hash)
215
+ attributes = attributes.transform_keys(&:to_sym)
216
+ transformed_hash = {}
217
+ openapi_types.each_pair do |key, type|
218
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
219
+ transformed_hash["#{key}"] = nil
220
+ elsif type =~ /\AArray<(.*)>/i
221
+ # check to ensure the input is an array given that the attribute
222
+ # is documented as an array but the input is not
223
+ if attributes[attribute_map[key]].is_a?(Array)
224
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
225
+ end
226
+ elsif !attributes[attribute_map[key]].nil?
227
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
228
+ end
229
+ end
230
+ new(transformed_hash)
231
+ end
232
+
233
+ # Returns the object in the form of hash
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_hash
236
+ hash = {}
237
+ self.class.attribute_map.each_pair do |attr, param|
238
+ value = self.send(attr)
239
+ if value.nil?
240
+ is_nullable = self.class.openapi_nullable.include?(attr)
241
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
+ end
243
+
244
+ hash[param] = _to_hash(value)
245
+ end
246
+ hash
247
+ end
248
+
249
+ end
250
+
251
+ end