sendmux-mailbox 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 (139) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +3 -0
  4. data/lib/sendmux/mailbox/client.rb +34 -0
  5. data/lib/sendmux/mailbox/version.rb +7 -0
  6. data/lib/sendmux/mailbox.rb +12 -0
  7. data/lib/sendmux_mailbox_generated/api/mailbox_api_api.rb +3226 -0
  8. data/lib/sendmux_mailbox_generated/api_client.rb +441 -0
  9. data/lib/sendmux_mailbox_generated/api_error.rb +58 -0
  10. data/lib/sendmux_mailbox_generated/api_model_base.rb +88 -0
  11. data/lib/sendmux_mailbox_generated/configuration.rb +393 -0
  12. data/lib/sendmux_mailbox_generated/models/api_error_detail.rb +219 -0
  13. data/lib/sendmux_mailbox_generated/models/api_error_error.rb +275 -0
  14. data/lib/sendmux_mailbox_generated/models/api_error_meta.rb +164 -0
  15. data/lib/sendmux_mailbox_generated/models/api_error_response.rb +216 -0
  16. data/lib/sendmux_mailbox_generated/models/batch_delete_mailbox_messages_body.rb +204 -0
  17. data/lib/sendmux_mailbox_generated/models/batch_update_mailbox_messages_body.rb +224 -0
  18. data/lib/sendmux_mailbox_generated/models/create_mailbox_folder_body.rb +183 -0
  19. data/lib/sendmux_mailbox_generated/models/cursor_pagination.rb +173 -0
  20. data/lib/sendmux_mailbox_generated/models/mailbox.rb +284 -0
  21. data/lib/sendmux_mailbox_generated/models/mailbox_address.rb +176 -0
  22. data/lib/sendmux_mailbox_generated/models/mailbox_attachment.rb +248 -0
  23. data/lib/sendmux_mailbox_generated/models/mailbox_attachment_upload_result.rb +243 -0
  24. data/lib/sendmux_mailbox_generated/models/mailbox_attachment_upload_result_response.rb +223 -0
  25. data/lib/sendmux_mailbox_generated/models/mailbox_batch_delete_messages_result.rb +248 -0
  26. data/lib/sendmux_mailbox_generated/models/mailbox_batch_delete_messages_result_response.rb +223 -0
  27. data/lib/sendmux_mailbox_generated/models/mailbox_batch_get_body.rb +363 -0
  28. data/lib/sendmux_mailbox_generated/models/mailbox_batch_get_item.rb +188 -0
  29. data/lib/sendmux_mailbox_generated/models/mailbox_batch_get_result.rb +220 -0
  30. data/lib/sendmux_mailbox_generated/models/mailbox_batch_get_result_response.rb +223 -0
  31. data/lib/sendmux_mailbox_generated/models/mailbox_batch_get_result_states.rb +150 -0
  32. data/lib/sendmux_mailbox_generated/models/mailbox_batch_message_failure.rb +216 -0
  33. data/lib/sendmux_mailbox_generated/models/mailbox_batch_message_states.rb +162 -0
  34. data/lib/sendmux_mailbox_generated/models/mailbox_batch_update_messages_result.rb +248 -0
  35. data/lib/sendmux_mailbox_generated/models/mailbox_batch_update_messages_result_response.rb +223 -0
  36. data/lib/sendmux_mailbox_generated/models/mailbox_changes.rb +297 -0
  37. data/lib/sendmux_mailbox_generated/models/mailbox_changes_response.rb +223 -0
  38. data/lib/sendmux_mailbox_generated/models/mailbox_content_headers.rb +214 -0
  39. data/lib/sendmux_mailbox_generated/models/mailbox_content_headers_full_inner.rb +190 -0
  40. data/lib/sendmux_mailbox_generated/models/mailbox_content_headers_selected.rb +234 -0
  41. data/lib/sendmux_mailbox_generated/models/mailbox_folder.rb +307 -0
  42. data/lib/sendmux_mailbox_generated/models/mailbox_folder_cursor_list_response.rb +251 -0
  43. data/lib/sendmux_mailbox_generated/models/mailbox_folder_deleted_response.rb +223 -0
  44. data/lib/sendmux_mailbox_generated/models/mailbox_folder_deleted_response_all_of_data.rb +190 -0
  45. data/lib/sendmux_mailbox_generated/models/mailbox_folder_query_changes.rb +270 -0
  46. data/lib/sendmux_mailbox_generated/models/mailbox_folder_query_changes_added_inner.rb +190 -0
  47. data/lib/sendmux_mailbox_generated/models/mailbox_folder_query_changes_response.rb +223 -0
  48. data/lib/sendmux_mailbox_generated/models/mailbox_folder_response.rb +223 -0
  49. data/lib/sendmux_mailbox_generated/models/mailbox_get_changes200_response.rb +103 -0
  50. data/lib/sendmux_mailbox_generated/models/mailbox_identity.rb +352 -0
  51. data/lib/sendmux_mailbox_generated/models/mailbox_identity_cursor_list_response.rb +251 -0
  52. data/lib/sendmux_mailbox_generated/models/mailbox_identity_response.rb +223 -0
  53. data/lib/sendmux_mailbox_generated/models/mailbox_me.rb +301 -0
  54. data/lib/sendmux_mailbox_generated/models/mailbox_me_item_response.rb +223 -0
  55. data/lib/sendmux_mailbox_generated/models/mailbox_message.rb +515 -0
  56. data/lib/sendmux_mailbox_generated/models/mailbox_message_content.rb +348 -0
  57. data/lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb +327 -0
  58. data/lib/sendmux_mailbox_generated/models/mailbox_message_content_dates.rb +162 -0
  59. data/lib/sendmux_mailbox_generated/models/mailbox_message_content_participants.rb +276 -0
  60. data/lib/sendmux_mailbox_generated/models/mailbox_message_content_response.rb +223 -0
  61. data/lib/sendmux_mailbox_generated/models/mailbox_message_content_response_all_of_data.rb +355 -0
  62. data/lib/sendmux_mailbox_generated/models/mailbox_message_content_states.rb +176 -0
  63. data/lib/sendmux_mailbox_generated/models/mailbox_message_count.rb +176 -0
  64. data/lib/sendmux_mailbox_generated/models/mailbox_message_count_response.rb +223 -0
  65. data/lib/sendmux_mailbox_generated/models/mailbox_message_deleted_response.rb +223 -0
  66. data/lib/sendmux_mailbox_generated/models/mailbox_message_detail_response.rb +223 -0
  67. data/lib/sendmux_mailbox_generated/models/mailbox_message_flags.rb +242 -0
  68. data/lib/sendmux_mailbox_generated/models/mailbox_message_query_changes.rb +270 -0
  69. data/lib/sendmux_mailbox_generated/models/mailbox_message_query_changes_response.rb +223 -0
  70. data/lib/sendmux_mailbox_generated/models/mailbox_message_summary.rb +456 -0
  71. data/lib/sendmux_mailbox_generated/models/mailbox_message_summary_cursor_list_response.rb +251 -0
  72. data/lib/sendmux_mailbox_generated/models/mailbox_message_summary_from.rb +183 -0
  73. data/lib/sendmux_mailbox_generated/models/mailbox_quota.rb +359 -0
  74. data/lib/sendmux_mailbox_generated/models/mailbox_quota_cursor_list_response.rb +251 -0
  75. data/lib/sendmux_mailbox_generated/models/mailbox_raw_body.rb +279 -0
  76. data/lib/sendmux_mailbox_generated/models/mailbox_raw_body_body.rb +200 -0
  77. data/lib/sendmux_mailbox_generated/models/mailbox_raw_body_response.rb +223 -0
  78. data/lib/sendmux_mailbox_generated/models/mailbox_raw_body_response_all_of_data.rb +286 -0
  79. data/lib/sendmux_mailbox_generated/models/mailbox_realtime_event.rb +380 -0
  80. data/lib/sendmux_mailbox_generated/models/mailbox_realtime_message.rb +529 -0
  81. data/lib/sendmux_mailbox_generated/models/mailbox_realtime_message_all_of_body.rb +214 -0
  82. data/lib/sendmux_mailbox_generated/models/mailbox_search_snippet.rb +190 -0
  83. data/lib/sendmux_mailbox_generated/models/mailbox_search_snippets_result.rb +206 -0
  84. data/lib/sendmux_mailbox_generated/models/mailbox_search_snippets_result_response.rb +223 -0
  85. data/lib/sendmux_mailbox_generated/models/mailbox_send_result_response.rb +223 -0
  86. data/lib/sendmux_mailbox_generated/models/mailbox_send_scope.rb +213 -0
  87. data/lib/sendmux_mailbox_generated/models/mailbox_session.rb +294 -0
  88. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities.rb +346 -0
  89. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_attachments.rb +294 -0
  90. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_folders.rb +320 -0
  91. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_identities.rb +268 -0
  92. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_messages.rb +516 -0
  93. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_quotas.rb +242 -0
  94. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_submissions.rb +242 -0
  95. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_sync.rb +222 -0
  96. data/lib/sendmux_mailbox_generated/models/mailbox_session_capabilities_threads.rb +268 -0
  97. data/lib/sendmux_mailbox_generated/models/mailbox_session_endpoints.rb +334 -0
  98. data/lib/sendmux_mailbox_generated/models/mailbox_session_gated.rb +451 -0
  99. data/lib/sendmux_mailbox_generated/models/mailbox_session_limits.rb +398 -0
  100. data/lib/sendmux_mailbox_generated/models/mailbox_session_mailbox.rb +203 -0
  101. data/lib/sendmux_mailbox_generated/models/mailbox_session_response.rb +223 -0
  102. data/lib/sendmux_mailbox_generated/models/mailbox_session_states.rb +294 -0
  103. data/lib/sendmux_mailbox_generated/models/mailbox_submission.rb +321 -0
  104. data/lib/sendmux_mailbox_generated/models/mailbox_submission_cursor_list_response.rb +251 -0
  105. data/lib/sendmux_mailbox_generated/models/mailbox_submission_delivery_status.rb +200 -0
  106. data/lib/sendmux_mailbox_generated/models/mailbox_submission_envelope.rb +178 -0
  107. data/lib/sendmux_mailbox_generated/models/mailbox_submission_envelope_address.rb +178 -0
  108. data/lib/sendmux_mailbox_generated/models/mailbox_submission_envelope_rcpt_to_inner.rb +185 -0
  109. data/lib/sendmux_mailbox_generated/models/mailbox_submission_response.rb +223 -0
  110. data/lib/sendmux_mailbox_generated/models/mailbox_thread.rb +398 -0
  111. data/lib/sendmux_mailbox_generated/models/mailbox_thread_content_meta.rb +244 -0
  112. data/lib/sendmux_mailbox_generated/models/mailbox_thread_content_meta_states.rb +188 -0
  113. data/lib/sendmux_mailbox_generated/models/mailbox_thread_content_response.rb +251 -0
  114. data/lib/sendmux_mailbox_generated/models/mailbox_thread_content_response_all_of_data.rb +355 -0
  115. data/lib/sendmux_mailbox_generated/models/mailbox_thread_detail_response.rb +223 -0
  116. data/lib/sendmux_mailbox_generated/models/mailbox_thread_summary.rb +363 -0
  117. data/lib/sendmux_mailbox_generated/models/mailbox_thread_summary_cursor_list_response.rb +251 -0
  118. data/lib/sendmux_mailbox_generated/models/mailbox_thread_summary_last_message.rb +463 -0
  119. data/lib/sendmux_mailbox_generated/models/mailbox_thread_summary_states.rb +162 -0
  120. data/lib/sendmux_mailbox_generated/models/mailbox_typed_changes.rb +164 -0
  121. data/lib/sendmux_mailbox_generated/models/mailbox_typed_changes_response.rb +223 -0
  122. data/lib/sendmux_mailbox_generated/models/mailbox_typed_changes_types.rb +192 -0
  123. data/lib/sendmux_mailbox_generated/models/mailbox_usage.rb +192 -0
  124. data/lib/sendmux_mailbox_generated/models/mailbox_usage_resource.rb +408 -0
  125. data/lib/sendmux_mailbox_generated/models/mailbox_usage_response.rb +223 -0
  126. data/lib/sendmux_mailbox_generated/models/mailbox_usage_states.rb +150 -0
  127. data/lib/sendmux_mailbox_generated/models/patch_mailbox_folder_body.rb +166 -0
  128. data/lib/sendmux_mailbox_generated/models/patch_mailbox_message_body.rb +168 -0
  129. data/lib/sendmux_mailbox_generated/models/response_meta.rb +164 -0
  130. data/lib/sendmux_mailbox_generated/models/send_mailbox_message_body.rb +283 -0
  131. data/lib/sendmux_mailbox_generated/models/send_mailbox_message_body_attachments_inner.rb +103 -0
  132. data/lib/sendmux_mailbox_generated/models/send_mailbox_message_body_attachments_inner_any_of.rb +217 -0
  133. data/lib/sendmux_mailbox_generated/models/send_mailbox_message_body_attachments_inner_any_of1.rb +217 -0
  134. data/lib/sendmux_mailbox_generated/models/send_mailbox_message_result.rb +214 -0
  135. data/lib/sendmux_mailbox_generated/models/success_envelope.rb +192 -0
  136. data/lib/sendmux_mailbox_generated/models/update_mailbox_identity_body.rb +216 -0
  137. data/lib/sendmux_mailbox_generated/version.rb +15 -0
  138. data/lib/sendmux_mailbox_generated.rb +166 -0
  139. metadata +255 -0
@@ -0,0 +1,529 @@
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::Mailbox::Generated
17
+ class MailboxRealtimeMessage < ApiModelBase
18
+ attr_accessor :bcc
19
+
20
+ attr_accessor :cc
21
+
22
+ attr_accessor :flags
23
+
24
+ attr_accessor :folder_ids
25
+
26
+ attr_accessor :from
27
+
28
+ attr_accessor :has_attachments
29
+
30
+ # Message ID
31
+ attr_accessor :id
32
+
33
+ # Active message keywords, including system flags and custom labels.
34
+ attr_accessor :keywords
35
+
36
+ attr_accessor :preview
37
+
38
+ attr_accessor :received_at
39
+
40
+ attr_accessor :sent_at
41
+
42
+ attr_accessor :size_bytes
43
+
44
+ attr_accessor :subject
45
+
46
+ attr_accessor :thread_id
47
+
48
+ attr_accessor :to
49
+
50
+ attr_accessor :attachments
51
+
52
+ attr_accessor :body
53
+
54
+ attr_accessor :rfc5322_message_id
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'bcc' => :'bcc',
60
+ :'cc' => :'cc',
61
+ :'flags' => :'flags',
62
+ :'folder_ids' => :'folder_ids',
63
+ :'from' => :'from',
64
+ :'has_attachments' => :'has_attachments',
65
+ :'id' => :'id',
66
+ :'keywords' => :'keywords',
67
+ :'preview' => :'preview',
68
+ :'received_at' => :'received_at',
69
+ :'sent_at' => :'sent_at',
70
+ :'size_bytes' => :'size_bytes',
71
+ :'subject' => :'subject',
72
+ :'thread_id' => :'thread_id',
73
+ :'to' => :'to',
74
+ :'attachments' => :'attachments',
75
+ :'body' => :'body',
76
+ :'rfc5322_message_id' => :'rfc5322_message_id'
77
+ }
78
+ end
79
+
80
+ # Returns attribute mapping this model knows about
81
+ def self.acceptable_attribute_map
82
+ attribute_map
83
+ end
84
+
85
+ # Returns all the JSON keys this model knows about
86
+ def self.acceptable_attributes
87
+ acceptable_attribute_map.values
88
+ end
89
+
90
+ # Attribute type mapping.
91
+ def self.openapi_types
92
+ {
93
+ :'bcc' => :'Array<MailboxAddress>',
94
+ :'cc' => :'Array<MailboxAddress>',
95
+ :'flags' => :'MailboxMessageFlags',
96
+ :'folder_ids' => :'Array<String>',
97
+ :'from' => :'MailboxMessageSummaryFrom',
98
+ :'has_attachments' => :'Boolean',
99
+ :'id' => :'String',
100
+ :'keywords' => :'Array<String>',
101
+ :'preview' => :'String',
102
+ :'received_at' => :'String',
103
+ :'sent_at' => :'String',
104
+ :'size_bytes' => :'Integer',
105
+ :'subject' => :'String',
106
+ :'thread_id' => :'String',
107
+ :'to' => :'Array<MailboxAddress>',
108
+ :'attachments' => :'Array<MailboxAttachment>',
109
+ :'body' => :'MailboxRealtimeMessageAllOfBody',
110
+ :'rfc5322_message_id' => :'String'
111
+ }
112
+ end
113
+
114
+ # List of attributes with nullable: true
115
+ def self.openapi_nullable
116
+ Set.new([
117
+ :'preview',
118
+ :'received_at',
119
+ :'sent_at',
120
+ :'size_bytes',
121
+ :'subject',
122
+ :'thread_id',
123
+ :'rfc5322_message_id'
124
+ ])
125
+ end
126
+
127
+ # List of class defined in allOf (OpenAPI v3)
128
+ def self.openapi_all_of
129
+ [
130
+ :'MailboxMessageSummary'
131
+ ]
132
+ end
133
+
134
+ # Initializes the object
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ def initialize(attributes = {})
137
+ if (!attributes.is_a?(Hash))
138
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::MailboxRealtimeMessage` initialize method"
139
+ end
140
+
141
+ # check to see if the attribute exists and convert string to symbol for hash key
142
+ acceptable_attribute_map = self.class.acceptable_attribute_map
143
+ attributes = attributes.each_with_object({}) { |(k, v), h|
144
+ if (!acceptable_attribute_map.key?(k.to_sym))
145
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::MailboxRealtimeMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
146
+ end
147
+ h[k.to_sym] = v
148
+ }
149
+
150
+ if attributes.key?(:'bcc')
151
+ if (value = attributes[:'bcc']).is_a?(Array)
152
+ self.bcc = value
153
+ end
154
+ else
155
+ self.bcc = nil
156
+ end
157
+
158
+ if attributes.key?(:'cc')
159
+ if (value = attributes[:'cc']).is_a?(Array)
160
+ self.cc = value
161
+ end
162
+ else
163
+ self.cc = nil
164
+ end
165
+
166
+ if attributes.key?(:'flags')
167
+ self.flags = attributes[:'flags']
168
+ else
169
+ self.flags = nil
170
+ end
171
+
172
+ if attributes.key?(:'folder_ids')
173
+ if (value = attributes[:'folder_ids']).is_a?(Array)
174
+ self.folder_ids = value
175
+ end
176
+ else
177
+ self.folder_ids = nil
178
+ end
179
+
180
+ if attributes.key?(:'from')
181
+ self.from = attributes[:'from']
182
+ else
183
+ self.from = nil
184
+ end
185
+
186
+ if attributes.key?(:'has_attachments')
187
+ self.has_attachments = attributes[:'has_attachments']
188
+ else
189
+ self.has_attachments = nil
190
+ end
191
+
192
+ if attributes.key?(:'id')
193
+ self.id = attributes[:'id']
194
+ else
195
+ self.id = nil
196
+ end
197
+
198
+ if attributes.key?(:'keywords')
199
+ if (value = attributes[:'keywords']).is_a?(Array)
200
+ self.keywords = value
201
+ end
202
+ else
203
+ self.keywords = nil
204
+ end
205
+
206
+ if attributes.key?(:'preview')
207
+ self.preview = attributes[:'preview']
208
+ else
209
+ self.preview = nil
210
+ end
211
+
212
+ if attributes.key?(:'received_at')
213
+ self.received_at = attributes[:'received_at']
214
+ else
215
+ self.received_at = nil
216
+ end
217
+
218
+ if attributes.key?(:'sent_at')
219
+ self.sent_at = attributes[:'sent_at']
220
+ else
221
+ self.sent_at = nil
222
+ end
223
+
224
+ if attributes.key?(:'size_bytes')
225
+ self.size_bytes = attributes[:'size_bytes']
226
+ else
227
+ self.size_bytes = nil
228
+ end
229
+
230
+ if attributes.key?(:'subject')
231
+ self.subject = attributes[:'subject']
232
+ else
233
+ self.subject = nil
234
+ end
235
+
236
+ if attributes.key?(:'thread_id')
237
+ self.thread_id = attributes[:'thread_id']
238
+ else
239
+ self.thread_id = nil
240
+ end
241
+
242
+ if attributes.key?(:'to')
243
+ if (value = attributes[:'to']).is_a?(Array)
244
+ self.to = value
245
+ end
246
+ else
247
+ self.to = nil
248
+ end
249
+
250
+ if attributes.key?(:'attachments')
251
+ if (value = attributes[:'attachments']).is_a?(Array)
252
+ self.attachments = value
253
+ end
254
+ else
255
+ self.attachments = nil
256
+ end
257
+
258
+ if attributes.key?(:'body')
259
+ self.body = attributes[:'body']
260
+ else
261
+ self.body = nil
262
+ end
263
+
264
+ if attributes.key?(:'rfc5322_message_id')
265
+ self.rfc5322_message_id = attributes[:'rfc5322_message_id']
266
+ else
267
+ self.rfc5322_message_id = nil
268
+ end
269
+ end
270
+
271
+ # Show invalid properties with the reasons. Usually used together with valid?
272
+ # @return Array for valid properties with the reasons
273
+ def list_invalid_properties
274
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
275
+ invalid_properties = Array.new
276
+ if @bcc.nil?
277
+ invalid_properties.push('invalid value for "bcc", bcc cannot be nil.')
278
+ end
279
+
280
+ if @cc.nil?
281
+ invalid_properties.push('invalid value for "cc", cc cannot be nil.')
282
+ end
283
+
284
+ if @flags.nil?
285
+ invalid_properties.push('invalid value for "flags", flags cannot be nil.')
286
+ end
287
+
288
+ if @folder_ids.nil?
289
+ invalid_properties.push('invalid value for "folder_ids", folder_ids cannot be nil.')
290
+ end
291
+
292
+ if @from.nil?
293
+ invalid_properties.push('invalid value for "from", from cannot be nil.')
294
+ end
295
+
296
+ if @has_attachments.nil?
297
+ invalid_properties.push('invalid value for "has_attachments", has_attachments cannot be nil.')
298
+ end
299
+
300
+ if @id.nil?
301
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
302
+ end
303
+
304
+ if @keywords.nil?
305
+ invalid_properties.push('invalid value for "keywords", keywords cannot be nil.')
306
+ end
307
+
308
+ if @to.nil?
309
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
310
+ end
311
+
312
+ if @attachments.nil?
313
+ invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
314
+ end
315
+
316
+ if @body.nil?
317
+ invalid_properties.push('invalid value for "body", body cannot be nil.')
318
+ end
319
+
320
+ invalid_properties
321
+ end
322
+
323
+ # Check to see if the all the properties in the model are valid
324
+ # @return true if the model is valid
325
+ def valid?
326
+ warn '[DEPRECATED] the `valid?` method is obsolete'
327
+ return false if @bcc.nil?
328
+ return false if @cc.nil?
329
+ return false if @flags.nil?
330
+ return false if @folder_ids.nil?
331
+ return false if @from.nil?
332
+ return false if @has_attachments.nil?
333
+ return false if @id.nil?
334
+ return false if @keywords.nil?
335
+ return false if @to.nil?
336
+ return false if @attachments.nil?
337
+ return false if @body.nil?
338
+ true
339
+ end
340
+
341
+ # Custom attribute writer method with validation
342
+ # @param [Object] bcc Value to be assigned
343
+ def bcc=(bcc)
344
+ if bcc.nil?
345
+ fail ArgumentError, 'bcc cannot be nil'
346
+ end
347
+
348
+ @bcc = bcc
349
+ end
350
+
351
+ # Custom attribute writer method with validation
352
+ # @param [Object] cc Value to be assigned
353
+ def cc=(cc)
354
+ if cc.nil?
355
+ fail ArgumentError, 'cc cannot be nil'
356
+ end
357
+
358
+ @cc = cc
359
+ end
360
+
361
+ # Custom attribute writer method with validation
362
+ # @param [Object] flags Value to be assigned
363
+ def flags=(flags)
364
+ if flags.nil?
365
+ fail ArgumentError, 'flags cannot be nil'
366
+ end
367
+
368
+ @flags = flags
369
+ end
370
+
371
+ # Custom attribute writer method with validation
372
+ # @param [Object] folder_ids Value to be assigned
373
+ def folder_ids=(folder_ids)
374
+ if folder_ids.nil?
375
+ fail ArgumentError, 'folder_ids cannot be nil'
376
+ end
377
+
378
+ @folder_ids = folder_ids
379
+ end
380
+
381
+ # Custom attribute writer method with validation
382
+ # @param [Object] from Value to be assigned
383
+ def from=(from)
384
+ if from.nil?
385
+ fail ArgumentError, 'from cannot be nil'
386
+ end
387
+
388
+ @from = from
389
+ end
390
+
391
+ # Custom attribute writer method with validation
392
+ # @param [Object] has_attachments Value to be assigned
393
+ def has_attachments=(has_attachments)
394
+ if has_attachments.nil?
395
+ fail ArgumentError, 'has_attachments cannot be nil'
396
+ end
397
+
398
+ @has_attachments = has_attachments
399
+ end
400
+
401
+ # Custom attribute writer method with validation
402
+ # @param [Object] id Value to be assigned
403
+ def id=(id)
404
+ if id.nil?
405
+ fail ArgumentError, 'id cannot be nil'
406
+ end
407
+
408
+ @id = id
409
+ end
410
+
411
+ # Custom attribute writer method with validation
412
+ # @param [Object] keywords Value to be assigned
413
+ def keywords=(keywords)
414
+ if keywords.nil?
415
+ fail ArgumentError, 'keywords cannot be nil'
416
+ end
417
+
418
+ @keywords = keywords
419
+ end
420
+
421
+ # Custom attribute writer method with validation
422
+ # @param [Object] to Value to be assigned
423
+ def to=(to)
424
+ if to.nil?
425
+ fail ArgumentError, 'to cannot be nil'
426
+ end
427
+
428
+ @to = to
429
+ end
430
+
431
+ # Custom attribute writer method with validation
432
+ # @param [Object] attachments Value to be assigned
433
+ def attachments=(attachments)
434
+ if attachments.nil?
435
+ fail ArgumentError, 'attachments cannot be nil'
436
+ end
437
+
438
+ @attachments = attachments
439
+ end
440
+
441
+ # Custom attribute writer method with validation
442
+ # @param [Object] body Value to be assigned
443
+ def body=(body)
444
+ if body.nil?
445
+ fail ArgumentError, 'body cannot be nil'
446
+ end
447
+
448
+ @body = body
449
+ end
450
+
451
+ # Checks equality by comparing each attribute.
452
+ # @param [Object] Object to be compared
453
+ def ==(o)
454
+ return true if self.equal?(o)
455
+ self.class == o.class &&
456
+ bcc == o.bcc &&
457
+ cc == o.cc &&
458
+ flags == o.flags &&
459
+ folder_ids == o.folder_ids &&
460
+ from == o.from &&
461
+ has_attachments == o.has_attachments &&
462
+ id == o.id &&
463
+ keywords == o.keywords &&
464
+ preview == o.preview &&
465
+ received_at == o.received_at &&
466
+ sent_at == o.sent_at &&
467
+ size_bytes == o.size_bytes &&
468
+ subject == o.subject &&
469
+ thread_id == o.thread_id &&
470
+ to == o.to &&
471
+ attachments == o.attachments &&
472
+ body == o.body &&
473
+ rfc5322_message_id == o.rfc5322_message_id
474
+ end
475
+
476
+ # @see the `==` method
477
+ # @param [Object] Object to be compared
478
+ def eql?(o)
479
+ self == o
480
+ end
481
+
482
+ # Calculates hash code according to all attributes.
483
+ # @return [Integer] Hash code
484
+ def hash
485
+ [bcc, cc, flags, folder_ids, from, has_attachments, id, keywords, preview, received_at, sent_at, size_bytes, subject, thread_id, to, attachments, body, rfc5322_message_id].hash
486
+ end
487
+
488
+ # Builds the object from hash
489
+ # @param [Hash] attributes Model attributes in the form of hash
490
+ # @return [Object] Returns the model itself
491
+ def self.build_from_hash(attributes)
492
+ return nil unless attributes.is_a?(Hash)
493
+ attributes = attributes.transform_keys(&:to_sym)
494
+ transformed_hash = {}
495
+ openapi_types.each_pair do |key, type|
496
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
497
+ transformed_hash["#{key}"] = nil
498
+ elsif type =~ /\AArray<(.*)>/i
499
+ # check to ensure the input is an array given that the attribute
500
+ # is documented as an array but the input is not
501
+ if attributes[attribute_map[key]].is_a?(Array)
502
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
503
+ end
504
+ elsif !attributes[attribute_map[key]].nil?
505
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
506
+ end
507
+ end
508
+ new(transformed_hash)
509
+ end
510
+
511
+ # Returns the object in the form of hash
512
+ # @return [Hash] Returns the object in the form of hash
513
+ def to_hash
514
+ hash = {}
515
+ self.class.attribute_map.each_pair do |attr, param|
516
+ value = self.send(attr)
517
+ if value.nil?
518
+ is_nullable = self.class.openapi_nullable.include?(attr)
519
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
520
+ end
521
+
522
+ hash[param] = _to_hash(value)
523
+ end
524
+ hash
525
+ end
526
+
527
+ end
528
+
529
+ end