qubrics-mailbox 3.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 (168) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +108 -0
  3. data/LICENSE +21 -0
  4. data/README.md +183 -0
  5. data/lib/qubrics/mailbox/client.rb +63 -0
  6. data/lib/qubrics/mailbox/version.rb +7 -0
  7. data/lib/qubrics/mailbox.rb +12 -0
  8. data/lib/qubrics_mailbox_generated/api/mailbox_api_api.rb +4371 -0
  9. data/lib/qubrics_mailbox_generated/api_client.rb +447 -0
  10. data/lib/qubrics_mailbox_generated/api_error.rb +58 -0
  11. data/lib/qubrics_mailbox_generated/api_model_base.rb +95 -0
  12. data/lib/qubrics_mailbox_generated/configuration.rb +400 -0
  13. data/lib/qubrics_mailbox_generated/models/api_error_detail.rb +219 -0
  14. data/lib/qubrics_mailbox_generated/models/api_error_error.rb +275 -0
  15. data/lib/qubrics_mailbox_generated/models/api_error_meta.rb +164 -0
  16. data/lib/qubrics_mailbox_generated/models/api_error_response.rb +216 -0
  17. data/lib/qubrics_mailbox_generated/models/batch_delete_mailbox_messages_body.rb +205 -0
  18. data/lib/qubrics_mailbox_generated/models/batch_update_mailbox_messages_body.rb +227 -0
  19. data/lib/qubrics_mailbox_generated/models/connection.rb +273 -0
  20. data/lib/qubrics_mailbox_generated/models/connection_credential.rb +226 -0
  21. data/lib/qubrics_mailbox_generated/models/connection_mailboxes_inner.rb +190 -0
  22. data/lib/qubrics_mailbox_generated/models/connection_response.rb +223 -0
  23. data/lib/qubrics_mailbox_generated/models/connection_team.rb +190 -0
  24. data/lib/qubrics_mailbox_generated/models/control_mailbox_draft_schedule.rb +232 -0
  25. data/lib/qubrics_mailbox_generated/models/create_mailbox_draft.rb +448 -0
  26. data/lib/qubrics_mailbox_generated/models/create_mailbox_draft_attachments_inner.rb +400 -0
  27. data/lib/qubrics_mailbox_generated/models/create_mailbox_draft_bcc_inner.rb +200 -0
  28. data/lib/qubrics_mailbox_generated/models/create_mailbox_draft_from.rb +201 -0
  29. data/lib/qubrics_mailbox_generated/models/create_mailbox_draft_source.rb +235 -0
  30. data/lib/qubrics_mailbox_generated/models/create_mailbox_folder_body.rb +183 -0
  31. data/lib/qubrics_mailbox_generated/models/cursor_pagination.rb +173 -0
  32. data/lib/qubrics_mailbox_generated/models/granted_mailbox.rb +192 -0
  33. data/lib/qubrics_mailbox_generated/models/granted_mailbox_list_response.rb +251 -0
  34. data/lib/qubrics_mailbox_generated/models/mailbox_address.rb +176 -0
  35. data/lib/qubrics_mailbox_generated/models/mailbox_attachment.rb +250 -0
  36. data/lib/qubrics_mailbox_generated/models/mailbox_attachment_text.rb +337 -0
  37. data/lib/qubrics_mailbox_generated/models/mailbox_attachment_text_response.rb +223 -0
  38. data/lib/qubrics_mailbox_generated/models/mailbox_attachment_upload_intent_body.rb +228 -0
  39. data/lib/qubrics_mailbox_generated/models/mailbox_attachment_upload_intent_result.rb +323 -0
  40. data/lib/qubrics_mailbox_generated/models/mailbox_attachment_upload_intent_result_headers.rb +191 -0
  41. data/lib/qubrics_mailbox_generated/models/mailbox_attachment_upload_intent_result_response.rb +223 -0
  42. data/lib/qubrics_mailbox_generated/models/mailbox_attachment_upload_result.rb +243 -0
  43. data/lib/qubrics_mailbox_generated/models/mailbox_attachment_upload_result_response.rb +223 -0
  44. data/lib/qubrics_mailbox_generated/models/mailbox_batch_delete_messages_result.rb +248 -0
  45. data/lib/qubrics_mailbox_generated/models/mailbox_batch_delete_messages_result_response.rb +223 -0
  46. data/lib/qubrics_mailbox_generated/models/mailbox_batch_get_body.rb +373 -0
  47. data/lib/qubrics_mailbox_generated/models/mailbox_batch_get_item.rb +188 -0
  48. data/lib/qubrics_mailbox_generated/models/mailbox_batch_get_result.rb +220 -0
  49. data/lib/qubrics_mailbox_generated/models/mailbox_batch_get_result_response.rb +223 -0
  50. data/lib/qubrics_mailbox_generated/models/mailbox_batch_get_result_states.rb +150 -0
  51. data/lib/qubrics_mailbox_generated/models/mailbox_batch_message_failure.rb +216 -0
  52. data/lib/qubrics_mailbox_generated/models/mailbox_batch_message_states.rb +162 -0
  53. data/lib/qubrics_mailbox_generated/models/mailbox_batch_update_messages_result.rb +248 -0
  54. data/lib/qubrics_mailbox_generated/models/mailbox_batch_update_messages_result_response.rb +223 -0
  55. data/lib/qubrics_mailbox_generated/models/mailbox_changes.rb +307 -0
  56. data/lib/qubrics_mailbox_generated/models/mailbox_changes_response.rb +223 -0
  57. data/lib/qubrics_mailbox_generated/models/mailbox_content_headers.rb +214 -0
  58. data/lib/qubrics_mailbox_generated/models/mailbox_content_headers_full_inner.rb +190 -0
  59. data/lib/qubrics_mailbox_generated/models/mailbox_content_headers_selected.rb +234 -0
  60. data/lib/qubrics_mailbox_generated/models/mailbox_draft.rb +670 -0
  61. data/lib/qubrics_mailbox_generated/models/mailbox_draft_delete_response.rb +223 -0
  62. data/lib/qubrics_mailbox_generated/models/mailbox_draft_delete_response_all_of_data.rb +190 -0
  63. data/lib/qubrics_mailbox_generated/models/mailbox_draft_list_response.rb +251 -0
  64. data/lib/qubrics_mailbox_generated/models/mailbox_draft_response.rb +223 -0
  65. data/lib/qubrics_mailbox_generated/models/mailbox_folder.rb +307 -0
  66. data/lib/qubrics_mailbox_generated/models/mailbox_folder_cursor_list_response.rb +251 -0
  67. data/lib/qubrics_mailbox_generated/models/mailbox_folder_deleted_response.rb +223 -0
  68. data/lib/qubrics_mailbox_generated/models/mailbox_folder_query_changes.rb +270 -0
  69. data/lib/qubrics_mailbox_generated/models/mailbox_folder_query_changes_added_inner.rb +190 -0
  70. data/lib/qubrics_mailbox_generated/models/mailbox_folder_query_changes_response.rb +223 -0
  71. data/lib/qubrics_mailbox_generated/models/mailbox_folder_response.rb +223 -0
  72. data/lib/qubrics_mailbox_generated/models/mailbox_get_changes200_response.rb +103 -0
  73. data/lib/qubrics_mailbox_generated/models/mailbox_identity.rb +352 -0
  74. data/lib/qubrics_mailbox_generated/models/mailbox_identity_cursor_list_response.rb +251 -0
  75. data/lib/qubrics_mailbox_generated/models/mailbox_identity_list_meta.rb +173 -0
  76. data/lib/qubrics_mailbox_generated/models/mailbox_identity_response.rb +223 -0
  77. data/lib/qubrics_mailbox_generated/models/mailbox_me.rb +294 -0
  78. data/lib/qubrics_mailbox_generated/models/mailbox_me_item_response.rb +223 -0
  79. data/lib/qubrics_mailbox_generated/models/mailbox_message.rb +594 -0
  80. data/lib/qubrics_mailbox_generated/models/mailbox_message_content.rb +348 -0
  81. data/lib/qubrics_mailbox_generated/models/mailbox_message_content_body.rb +352 -0
  82. data/lib/qubrics_mailbox_generated/models/mailbox_message_content_body_html_cleaning.rb +241 -0
  83. data/lib/qubrics_mailbox_generated/models/mailbox_message_content_dates.rb +162 -0
  84. data/lib/qubrics_mailbox_generated/models/mailbox_message_content_participants.rb +262 -0
  85. data/lib/qubrics_mailbox_generated/models/mailbox_message_content_response.rb +223 -0
  86. data/lib/qubrics_mailbox_generated/models/mailbox_message_content_states.rb +176 -0
  87. data/lib/qubrics_mailbox_generated/models/mailbox_message_count.rb +176 -0
  88. data/lib/qubrics_mailbox_generated/models/mailbox_message_count_response.rb +223 -0
  89. data/lib/qubrics_mailbox_generated/models/mailbox_message_deleted_response.rb +223 -0
  90. data/lib/qubrics_mailbox_generated/models/mailbox_message_detail_response.rb +223 -0
  91. data/lib/qubrics_mailbox_generated/models/mailbox_message_flags.rb +242 -0
  92. data/lib/qubrics_mailbox_generated/models/mailbox_message_query_changes.rb +270 -0
  93. data/lib/qubrics_mailbox_generated/models/mailbox_message_query_changes_response.rb +223 -0
  94. data/lib/qubrics_mailbox_generated/models/mailbox_message_summary.rb +454 -0
  95. data/lib/qubrics_mailbox_generated/models/mailbox_message_summary_cursor_list_response.rb +251 -0
  96. data/lib/qubrics_mailbox_generated/models/mailbox_query_meta.rb +173 -0
  97. data/lib/qubrics_mailbox_generated/models/mailbox_quota.rb +359 -0
  98. data/lib/qubrics_mailbox_generated/models/mailbox_quota_cursor_list_response.rb +251 -0
  99. data/lib/qubrics_mailbox_generated/models/mailbox_raw_body.rb +279 -0
  100. data/lib/qubrics_mailbox_generated/models/mailbox_raw_body_body.rb +200 -0
  101. data/lib/qubrics_mailbox_generated/models/mailbox_raw_body_response.rb +223 -0
  102. data/lib/qubrics_mailbox_generated/models/mailbox_realtime_event.rb +366 -0
  103. data/lib/qubrics_mailbox_generated/models/mailbox_realtime_message.rb +492 -0
  104. data/lib/qubrics_mailbox_generated/models/mailbox_realtime_message_body.rb +214 -0
  105. data/lib/qubrics_mailbox_generated/models/mailbox_search_snippet.rb +190 -0
  106. data/lib/qubrics_mailbox_generated/models/mailbox_search_snippets_result.rb +206 -0
  107. data/lib/qubrics_mailbox_generated/models/mailbox_search_snippets_result_response.rb +223 -0
  108. data/lib/qubrics_mailbox_generated/models/mailbox_send_result_response.rb +223 -0
  109. data/lib/qubrics_mailbox_generated/models/mailbox_send_scope.rb +213 -0
  110. data/lib/qubrics_mailbox_generated/models/mailbox_sender_choices.rb +217 -0
  111. data/lib/qubrics_mailbox_generated/models/mailbox_sender_choices_from.rb +213 -0
  112. data/lib/qubrics_mailbox_generated/models/mailbox_sender_choices_reply_to.rb +213 -0
  113. data/lib/qubrics_mailbox_generated/models/mailbox_sender_choices_response.rb +223 -0
  114. data/lib/qubrics_mailbox_generated/models/mailbox_session.rb +294 -0
  115. data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities.rb +346 -0
  116. data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_attachments.rb +294 -0
  117. data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_folders.rb +320 -0
  118. data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_identities.rb +268 -0
  119. data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_messages.rb +516 -0
  120. data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_quotas.rb +242 -0
  121. data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_submissions.rb +242 -0
  122. data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_sync.rb +222 -0
  123. data/lib/qubrics_mailbox_generated/models/mailbox_session_capabilities_threads.rb +268 -0
  124. data/lib/qubrics_mailbox_generated/models/mailbox_session_endpoints.rb +334 -0
  125. data/lib/qubrics_mailbox_generated/models/mailbox_session_gated.rb +451 -0
  126. data/lib/qubrics_mailbox_generated/models/mailbox_session_limits.rb +448 -0
  127. data/lib/qubrics_mailbox_generated/models/mailbox_session_mailbox.rb +203 -0
  128. data/lib/qubrics_mailbox_generated/models/mailbox_session_response.rb +223 -0
  129. data/lib/qubrics_mailbox_generated/models/mailbox_session_states.rb +294 -0
  130. data/lib/qubrics_mailbox_generated/models/mailbox_submission.rb +321 -0
  131. data/lib/qubrics_mailbox_generated/models/mailbox_submission_cursor_list_response.rb +251 -0
  132. data/lib/qubrics_mailbox_generated/models/mailbox_submission_delivery_status.rb +200 -0
  133. data/lib/qubrics_mailbox_generated/models/mailbox_submission_envelope.rb +178 -0
  134. data/lib/qubrics_mailbox_generated/models/mailbox_submission_envelope_address.rb +178 -0
  135. data/lib/qubrics_mailbox_generated/models/mailbox_submission_response.rb +223 -0
  136. data/lib/qubrics_mailbox_generated/models/mailbox_sync_meta.rb +173 -0
  137. data/lib/qubrics_mailbox_generated/models/mailbox_thread.rb +377 -0
  138. data/lib/qubrics_mailbox_generated/models/mailbox_thread_content_meta.rb +244 -0
  139. data/lib/qubrics_mailbox_generated/models/mailbox_thread_content_meta_states.rb +188 -0
  140. data/lib/qubrics_mailbox_generated/models/mailbox_thread_content_response.rb +251 -0
  141. data/lib/qubrics_mailbox_generated/models/mailbox_thread_detail_response.rb +223 -0
  142. data/lib/qubrics_mailbox_generated/models/mailbox_thread_message_summary_cursor_list_response.rb +251 -0
  143. data/lib/qubrics_mailbox_generated/models/mailbox_thread_messages_meta.rb +199 -0
  144. data/lib/qubrics_mailbox_generated/models/mailbox_thread_summary.rb +349 -0
  145. data/lib/qubrics_mailbox_generated/models/mailbox_thread_summary_cursor_list_response.rb +251 -0
  146. data/lib/qubrics_mailbox_generated/models/mailbox_thread_summary_states.rb +162 -0
  147. data/lib/qubrics_mailbox_generated/models/mailbox_typed_changes.rb +164 -0
  148. data/lib/qubrics_mailbox_generated/models/mailbox_typed_changes_response.rb +223 -0
  149. data/lib/qubrics_mailbox_generated/models/mailbox_typed_changes_types.rb +192 -0
  150. data/lib/qubrics_mailbox_generated/models/mailbox_usage.rb +192 -0
  151. data/lib/qubrics_mailbox_generated/models/mailbox_usage_resource.rb +408 -0
  152. data/lib/qubrics_mailbox_generated/models/mailbox_usage_response.rb +223 -0
  153. data/lib/qubrics_mailbox_generated/models/mailbox_usage_states.rb +150 -0
  154. data/lib/qubrics_mailbox_generated/models/patch_mailbox_folder_body.rb +166 -0
  155. data/lib/qubrics_mailbox_generated/models/patch_mailbox_message_body.rb +168 -0
  156. data/lib/qubrics_mailbox_generated/models/response_meta.rb +164 -0
  157. data/lib/qubrics_mailbox_generated/models/send_mailbox_draft.rb +222 -0
  158. data/lib/qubrics_mailbox_generated/models/send_mailbox_message_body.rb +326 -0
  159. data/lib/qubrics_mailbox_generated/models/send_mailbox_message_body_attachments_inner.rb +103 -0
  160. data/lib/qubrics_mailbox_generated/models/send_mailbox_message_body_attachments_inner_any_of.rb +217 -0
  161. data/lib/qubrics_mailbox_generated/models/send_mailbox_message_body_attachments_inner_any_of1.rb +217 -0
  162. data/lib/qubrics_mailbox_generated/models/send_mailbox_message_result.rb +214 -0
  163. data/lib/qubrics_mailbox_generated/models/success_envelope.rb +192 -0
  164. data/lib/qubrics_mailbox_generated/models/update_mailbox_draft.rb +437 -0
  165. data/lib/qubrics_mailbox_generated/models/update_mailbox_identity_body.rb +216 -0
  166. data/lib/qubrics_mailbox_generated/version.rb +15 -0
  167. data/lib/qubrics_mailbox_generated.rb +210 -0
  168. metadata +290 -0
@@ -0,0 +1,348 @@
1
+ =begin
2
+ #Qubrics API
3
+
4
+ #Programmatic access to your Qubrics 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 Qubrics::Mailbox::Generated
17
+ class MailboxMessageContent < ApiModelBase
18
+ # Attachment metadata only. Attachment contents are not parsed by this endpoint.
19
+ attr_accessor :attachments
20
+
21
+ attr_accessor :body
22
+
23
+ attr_accessor :dates
24
+
25
+ attr_accessor :headers
26
+
27
+ # Message ID
28
+ attr_accessor :id
29
+
30
+ attr_accessor :participants
31
+
32
+ attr_accessor :states
33
+
34
+ attr_accessor :subject
35
+
36
+ attr_accessor :thread_id
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'attachments' => :'attachments',
42
+ :'body' => :'body',
43
+ :'dates' => :'dates',
44
+ :'headers' => :'headers',
45
+ :'id' => :'id',
46
+ :'participants' => :'participants',
47
+ :'states' => :'states',
48
+ :'subject' => :'subject',
49
+ :'thread_id' => :'thread_id'
50
+ }
51
+ end
52
+
53
+ # Returns attribute mapping this model knows about
54
+ def self.acceptable_attribute_map
55
+ attribute_map
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ acceptable_attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'attachments' => :'Array<MailboxAttachment>',
67
+ :'body' => :'MailboxMessageContentBody',
68
+ :'dates' => :'MailboxMessageContentDates',
69
+ :'headers' => :'MailboxContentHeaders',
70
+ :'id' => :'String',
71
+ :'participants' => :'MailboxMessageContentParticipants',
72
+ :'states' => :'MailboxMessageContentStates',
73
+ :'subject' => :'String',
74
+ :'thread_id' => :'String'
75
+ }
76
+ end
77
+
78
+ # List of attributes with nullable: true
79
+ def self.openapi_nullable
80
+ Set.new([
81
+ :'subject',
82
+ :'thread_id'
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Qubrics::Mailbox::Generated::MailboxMessageContent` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Qubrics::Mailbox::Generated::MailboxMessageContent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'attachments')
103
+ if (value = attributes[:'attachments']).is_a?(Array)
104
+ self.attachments = value
105
+ end
106
+ else
107
+ self.attachments = nil
108
+ end
109
+
110
+ if attributes.key?(:'body')
111
+ self.body = attributes[:'body']
112
+ else
113
+ self.body = nil
114
+ end
115
+
116
+ if attributes.key?(:'dates')
117
+ self.dates = attributes[:'dates']
118
+ else
119
+ self.dates = nil
120
+ end
121
+
122
+ if attributes.key?(:'headers')
123
+ self.headers = attributes[:'headers']
124
+ else
125
+ self.headers = nil
126
+ end
127
+
128
+ if attributes.key?(:'id')
129
+ self.id = attributes[:'id']
130
+ else
131
+ self.id = nil
132
+ end
133
+
134
+ if attributes.key?(:'participants')
135
+ self.participants = attributes[:'participants']
136
+ else
137
+ self.participants = nil
138
+ end
139
+
140
+ if attributes.key?(:'states')
141
+ self.states = attributes[:'states']
142
+ else
143
+ self.states = nil
144
+ end
145
+
146
+ if attributes.key?(:'subject')
147
+ self.subject = attributes[:'subject']
148
+ else
149
+ self.subject = nil
150
+ end
151
+
152
+ if attributes.key?(:'thread_id')
153
+ self.thread_id = attributes[:'thread_id']
154
+ else
155
+ self.thread_id = nil
156
+ end
157
+ end
158
+
159
+ # Show invalid properties with the reasons. Usually used together with valid?
160
+ # @return Array for valid properties with the reasons
161
+ def list_invalid_properties
162
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
163
+ invalid_properties = Array.new
164
+ if @attachments.nil?
165
+ invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
166
+ end
167
+
168
+ if @body.nil?
169
+ invalid_properties.push('invalid value for "body", body cannot be nil.')
170
+ end
171
+
172
+ if @dates.nil?
173
+ invalid_properties.push('invalid value for "dates", dates cannot be nil.')
174
+ end
175
+
176
+ if @headers.nil?
177
+ invalid_properties.push('invalid value for "headers", headers cannot be nil.')
178
+ end
179
+
180
+ if @id.nil?
181
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
182
+ end
183
+
184
+ if @participants.nil?
185
+ invalid_properties.push('invalid value for "participants", participants cannot be nil.')
186
+ end
187
+
188
+ if @states.nil?
189
+ invalid_properties.push('invalid value for "states", states cannot be nil.')
190
+ end
191
+
192
+ invalid_properties
193
+ end
194
+
195
+ # Check to see if the all the properties in the model are valid
196
+ # @return true if the model is valid
197
+ def valid?
198
+ warn '[DEPRECATED] the `valid?` method is obsolete'
199
+ return false if @attachments.nil?
200
+ return false if @body.nil?
201
+ return false if @dates.nil?
202
+ return false if @headers.nil?
203
+ return false if @id.nil?
204
+ return false if @participants.nil?
205
+ return false if @states.nil?
206
+ true
207
+ end
208
+
209
+ # Custom attribute writer method with validation
210
+ # @param [Object] attachments Value to be assigned
211
+ def attachments=(attachments)
212
+ if attachments.nil?
213
+ fail ArgumentError, 'attachments cannot be nil'
214
+ end
215
+
216
+ @attachments = attachments
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] body Value to be assigned
221
+ def body=(body)
222
+ if body.nil?
223
+ fail ArgumentError, 'body cannot be nil'
224
+ end
225
+
226
+ @body = body
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] dates Value to be assigned
231
+ def dates=(dates)
232
+ if dates.nil?
233
+ fail ArgumentError, 'dates cannot be nil'
234
+ end
235
+
236
+ @dates = dates
237
+ end
238
+
239
+ # Custom attribute writer method with validation
240
+ # @param [Object] headers Value to be assigned
241
+ def headers=(headers)
242
+ if headers.nil?
243
+ fail ArgumentError, 'headers cannot be nil'
244
+ end
245
+
246
+ @headers = headers
247
+ end
248
+
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] id Value to be assigned
251
+ def id=(id)
252
+ if id.nil?
253
+ fail ArgumentError, 'id cannot be nil'
254
+ end
255
+
256
+ @id = id
257
+ end
258
+
259
+ # Custom attribute writer method with validation
260
+ # @param [Object] participants Value to be assigned
261
+ def participants=(participants)
262
+ if participants.nil?
263
+ fail ArgumentError, 'participants cannot be nil'
264
+ end
265
+
266
+ @participants = participants
267
+ end
268
+
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] states Value to be assigned
271
+ def states=(states)
272
+ if states.nil?
273
+ fail ArgumentError, 'states cannot be nil'
274
+ end
275
+
276
+ @states = states
277
+ end
278
+
279
+ # Checks equality by comparing each attribute.
280
+ # @param [Object] Object to be compared
281
+ def ==(o)
282
+ return true if self.equal?(o)
283
+ self.class == o.class &&
284
+ attachments == o.attachments &&
285
+ body == o.body &&
286
+ dates == o.dates &&
287
+ headers == o.headers &&
288
+ id == o.id &&
289
+ participants == o.participants &&
290
+ states == o.states &&
291
+ subject == o.subject &&
292
+ thread_id == o.thread_id
293
+ end
294
+
295
+ # @see the `==` method
296
+ # @param [Object] Object to be compared
297
+ def eql?(o)
298
+ self == o
299
+ end
300
+
301
+ # Calculates hash code according to all attributes.
302
+ # @return [Integer] Hash code
303
+ def hash
304
+ [attachments, body, dates, headers, id, participants, states, subject, thread_id].hash
305
+ end
306
+
307
+ # Builds the object from hash
308
+ # @param [Hash] attributes Model attributes in the form of hash
309
+ # @return [Object] Returns the model itself
310
+ def self.build_from_hash(attributes)
311
+ return nil unless attributes.is_a?(Hash)
312
+ attributes = attributes.transform_keys(&:to_sym)
313
+ transformed_hash = {}
314
+ openapi_types.each_pair do |key, type|
315
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
316
+ transformed_hash["#{key}"] = nil
317
+ elsif type =~ /\AArray<(.*)>/i
318
+ # check to ensure the input is an array given that the attribute
319
+ # is documented as an array but the input is not
320
+ if attributes[attribute_map[key]].is_a?(Array)
321
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
322
+ end
323
+ elsif !attributes[attribute_map[key]].nil?
324
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
325
+ end
326
+ end
327
+ new(transformed_hash)
328
+ end
329
+
330
+ # Returns the object in the form of hash
331
+ # @return [Hash] Returns the object in the form of hash
332
+ def to_hash
333
+ hash = {}
334
+ self.class.attribute_map.each_pair do |attr, param|
335
+ value = self.send(attr)
336
+ if value.nil?
337
+ is_nullable = self.class.openapi_nullable.include?(attr)
338
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
339
+ end
340
+
341
+ hash[param] = _to_hash(value)
342
+ end
343
+ hash
344
+ end
345
+
346
+ end
347
+
348
+ end
@@ -0,0 +1,352 @@
1
+ =begin
2
+ #Qubrics API
3
+
4
+ #Programmatic access to your Qubrics 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 Qubrics::Mailbox::Generated
17
+ class MailboxMessageContentBody < ApiModelBase
18
+ # HTML with recognised quotes and signatures removed according to the stripping options. Original HTML remains in html. This is not sanitised content. Null when HTML is absent, not requested, truncated, or exceeds cleaning limits.
19
+ attr_accessor :cleaned_html
20
+
21
+ attr_accessor :extracted_links
22
+
23
+ attr_accessor :format
24
+
25
+ # HTML body when requested. Returned as a JSON string and not as rendered content.
26
+ attr_accessor :html
27
+
28
+ attr_accessor :html_cleaning
29
+
30
+ attr_accessor :is_truncated
31
+
32
+ attr_accessor :quotes_stripped
33
+
34
+ attr_accessor :signature_stripped
35
+
36
+ attr_accessor :text
37
+
38
+ attr_accessor :truncated_at_chars
39
+
40
+ class EnumAttributeValidator
41
+ attr_reader :datatype
42
+ attr_reader :allowable_values
43
+
44
+ def initialize(datatype, allowable_values)
45
+ @allowable_values = allowable_values.map do |value|
46
+ case datatype.to_s
47
+ when /Integer/i
48
+ value.to_i
49
+ when /Float/i
50
+ value.to_f
51
+ else
52
+ value
53
+ end
54
+ end
55
+ end
56
+
57
+ def valid?(value)
58
+ !value || allowable_values.include?(value)
59
+ end
60
+ end
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'cleaned_html' => :'cleaned_html',
66
+ :'extracted_links' => :'extracted_links',
67
+ :'format' => :'format',
68
+ :'html' => :'html',
69
+ :'html_cleaning' => :'html_cleaning',
70
+ :'is_truncated' => :'is_truncated',
71
+ :'quotes_stripped' => :'quotes_stripped',
72
+ :'signature_stripped' => :'signature_stripped',
73
+ :'text' => :'text',
74
+ :'truncated_at_chars' => :'truncated_at_chars'
75
+ }
76
+ end
77
+
78
+ # Returns attribute mapping this model knows about
79
+ def self.acceptable_attribute_map
80
+ attribute_map
81
+ end
82
+
83
+ # Returns all the JSON keys this model knows about
84
+ def self.acceptable_attributes
85
+ acceptable_attribute_map.values
86
+ end
87
+
88
+ # Attribute type mapping.
89
+ def self.openapi_types
90
+ {
91
+ :'cleaned_html' => :'String',
92
+ :'extracted_links' => :'Array<String>',
93
+ :'format' => :'String',
94
+ :'html' => :'String',
95
+ :'html_cleaning' => :'MailboxMessageContentBodyHtmlCleaning',
96
+ :'is_truncated' => :'Boolean',
97
+ :'quotes_stripped' => :'Boolean',
98
+ :'signature_stripped' => :'Boolean',
99
+ :'text' => :'String',
100
+ :'truncated_at_chars' => :'Integer'
101
+ }
102
+ end
103
+
104
+ # List of attributes with nullable: true
105
+ def self.openapi_nullable
106
+ Set.new([
107
+ :'cleaned_html',
108
+ :'format',
109
+ :'html',
110
+ :'html_cleaning',
111
+ :'text',
112
+ :'truncated_at_chars'
113
+ ])
114
+ end
115
+
116
+ # Initializes the object
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ def initialize(attributes = {})
119
+ if (!attributes.is_a?(Hash))
120
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Qubrics::Mailbox::Generated::MailboxMessageContentBody` initialize method"
121
+ end
122
+
123
+ # check to see if the attribute exists and convert string to symbol for hash key
124
+ acceptable_attribute_map = self.class.acceptable_attribute_map
125
+ attributes = attributes.each_with_object({}) { |(k, v), h|
126
+ if (!acceptable_attribute_map.key?(k.to_sym))
127
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Qubrics::Mailbox::Generated::MailboxMessageContentBody`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
128
+ end
129
+ h[k.to_sym] = v
130
+ }
131
+
132
+ if attributes.key?(:'cleaned_html')
133
+ self.cleaned_html = attributes[:'cleaned_html']
134
+ else
135
+ self.cleaned_html = nil
136
+ end
137
+
138
+ if attributes.key?(:'extracted_links')
139
+ if (value = attributes[:'extracted_links']).is_a?(Array)
140
+ self.extracted_links = value
141
+ end
142
+ else
143
+ self.extracted_links = nil
144
+ end
145
+
146
+ if attributes.key?(:'format')
147
+ self.format = attributes[:'format']
148
+ else
149
+ self.format = nil
150
+ end
151
+
152
+ if attributes.key?(:'html')
153
+ self.html = attributes[:'html']
154
+ else
155
+ self.html = nil
156
+ end
157
+
158
+ if attributes.key?(:'html_cleaning')
159
+ self.html_cleaning = attributes[:'html_cleaning']
160
+ else
161
+ self.html_cleaning = nil
162
+ end
163
+
164
+ if attributes.key?(:'is_truncated')
165
+ self.is_truncated = attributes[:'is_truncated']
166
+ else
167
+ self.is_truncated = nil
168
+ end
169
+
170
+ if attributes.key?(:'quotes_stripped')
171
+ self.quotes_stripped = attributes[:'quotes_stripped']
172
+ else
173
+ self.quotes_stripped = nil
174
+ end
175
+
176
+ if attributes.key?(:'signature_stripped')
177
+ self.signature_stripped = attributes[:'signature_stripped']
178
+ else
179
+ self.signature_stripped = nil
180
+ end
181
+
182
+ if attributes.key?(:'text')
183
+ self.text = attributes[:'text']
184
+ else
185
+ self.text = nil
186
+ end
187
+
188
+ if attributes.key?(:'truncated_at_chars')
189
+ self.truncated_at_chars = attributes[:'truncated_at_chars']
190
+ else
191
+ self.truncated_at_chars = nil
192
+ end
193
+ end
194
+
195
+ # Show invalid properties with the reasons. Usually used together with valid?
196
+ # @return Array for valid properties with the reasons
197
+ def list_invalid_properties
198
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
199
+ invalid_properties = Array.new
200
+ if @extracted_links.nil?
201
+ invalid_properties.push('invalid value for "extracted_links", extracted_links cannot be nil.')
202
+ end
203
+
204
+ if @is_truncated.nil?
205
+ invalid_properties.push('invalid value for "is_truncated", is_truncated cannot be nil.')
206
+ end
207
+
208
+ if @quotes_stripped.nil?
209
+ invalid_properties.push('invalid value for "quotes_stripped", quotes_stripped cannot be nil.')
210
+ end
211
+
212
+ if @signature_stripped.nil?
213
+ invalid_properties.push('invalid value for "signature_stripped", signature_stripped cannot be nil.')
214
+ end
215
+
216
+ invalid_properties
217
+ end
218
+
219
+ # Check to see if the all the properties in the model are valid
220
+ # @return true if the model is valid
221
+ def valid?
222
+ warn '[DEPRECATED] the `valid?` method is obsolete'
223
+ return false if @extracted_links.nil?
224
+ format_validator = EnumAttributeValidator.new('String', ["text", "html", "unknown_default_open_api"])
225
+ return false unless format_validator.valid?(@format)
226
+ return false if @is_truncated.nil?
227
+ return false if @quotes_stripped.nil?
228
+ return false if @signature_stripped.nil?
229
+ true
230
+ end
231
+
232
+ # Custom attribute writer method with validation
233
+ # @param [Object] extracted_links Value to be assigned
234
+ def extracted_links=(extracted_links)
235
+ if extracted_links.nil?
236
+ fail ArgumentError, 'extracted_links cannot be nil'
237
+ end
238
+
239
+ @extracted_links = extracted_links
240
+ end
241
+
242
+ # Custom attribute writer method checking allowed values (enum).
243
+ # @param [Object] format Object to be assigned
244
+ def format=(format)
245
+ validator = EnumAttributeValidator.new('String', ["text", "html", "unknown_default_open_api"])
246
+ unless validator.valid?(format)
247
+ fail ArgumentError, "invalid value for \"format\", must be one of #{validator.allowable_values}."
248
+ end
249
+ @format = format
250
+ end
251
+
252
+ # Custom attribute writer method with validation
253
+ # @param [Object] is_truncated Value to be assigned
254
+ def is_truncated=(is_truncated)
255
+ if is_truncated.nil?
256
+ fail ArgumentError, 'is_truncated cannot be nil'
257
+ end
258
+
259
+ @is_truncated = is_truncated
260
+ end
261
+
262
+ # Custom attribute writer method with validation
263
+ # @param [Object] quotes_stripped Value to be assigned
264
+ def quotes_stripped=(quotes_stripped)
265
+ if quotes_stripped.nil?
266
+ fail ArgumentError, 'quotes_stripped cannot be nil'
267
+ end
268
+
269
+ @quotes_stripped = quotes_stripped
270
+ end
271
+
272
+ # Custom attribute writer method with validation
273
+ # @param [Object] signature_stripped Value to be assigned
274
+ def signature_stripped=(signature_stripped)
275
+ if signature_stripped.nil?
276
+ fail ArgumentError, 'signature_stripped cannot be nil'
277
+ end
278
+
279
+ @signature_stripped = signature_stripped
280
+ end
281
+
282
+ # Checks equality by comparing each attribute.
283
+ # @param [Object] Object to be compared
284
+ def ==(o)
285
+ return true if self.equal?(o)
286
+ self.class == o.class &&
287
+ cleaned_html == o.cleaned_html &&
288
+ extracted_links == o.extracted_links &&
289
+ format == o.format &&
290
+ html == o.html &&
291
+ html_cleaning == o.html_cleaning &&
292
+ is_truncated == o.is_truncated &&
293
+ quotes_stripped == o.quotes_stripped &&
294
+ signature_stripped == o.signature_stripped &&
295
+ text == o.text &&
296
+ truncated_at_chars == o.truncated_at_chars
297
+ end
298
+
299
+ # @see the `==` method
300
+ # @param [Object] Object to be compared
301
+ def eql?(o)
302
+ self == o
303
+ end
304
+
305
+ # Calculates hash code according to all attributes.
306
+ # @return [Integer] Hash code
307
+ def hash
308
+ [cleaned_html, extracted_links, format, html, html_cleaning, is_truncated, quotes_stripped, signature_stripped, text, truncated_at_chars].hash
309
+ end
310
+
311
+ # Builds the object from hash
312
+ # @param [Hash] attributes Model attributes in the form of hash
313
+ # @return [Object] Returns the model itself
314
+ def self.build_from_hash(attributes)
315
+ return nil unless attributes.is_a?(Hash)
316
+ attributes = attributes.transform_keys(&:to_sym)
317
+ transformed_hash = {}
318
+ openapi_types.each_pair do |key, type|
319
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
320
+ transformed_hash["#{key}"] = nil
321
+ elsif type =~ /\AArray<(.*)>/i
322
+ # check to ensure the input is an array given that the attribute
323
+ # is documented as an array but the input is not
324
+ if attributes[attribute_map[key]].is_a?(Array)
325
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
326
+ end
327
+ elsif !attributes[attribute_map[key]].nil?
328
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
329
+ end
330
+ end
331
+ new(transformed_hash)
332
+ end
333
+
334
+ # Returns the object in the form of hash
335
+ # @return [Hash] Returns the object in the form of hash
336
+ def to_hash
337
+ hash = {}
338
+ self.class.attribute_map.each_pair do |attr, param|
339
+ value = self.send(attr)
340
+ if value.nil?
341
+ is_nullable = self.class.openapi_nullable.include?(attr)
342
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
343
+ end
344
+
345
+ hash[param] = _to_hash(value)
346
+ end
347
+ hash
348
+ end
349
+
350
+ end
351
+
352
+ end