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,223 @@
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 MailboxMessageQueryChangesResponse < ApiModelBase
18
+ attr_accessor :meta
19
+
20
+ attr_accessor :ok
21
+
22
+ attr_accessor :data
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'meta' => :'meta',
28
+ :'ok' => :'ok',
29
+ :'data' => :'data'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'meta' => :'ResponseMeta',
47
+ :'ok' => :'Boolean',
48
+ :'data' => :'MailboxMessageQueryChanges'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # List of class defined in allOf (OpenAPI v3)
59
+ def self.openapi_all_of
60
+ [
61
+ :'SuccessEnvelope'
62
+ ]
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::MailboxMessageQueryChangesResponse` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ acceptable_attribute_map = self.class.acceptable_attribute_map
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!acceptable_attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::MailboxMessageQueryChangesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'meta')
82
+ self.meta = attributes[:'meta']
83
+ else
84
+ self.meta = nil
85
+ end
86
+
87
+ if attributes.key?(:'ok')
88
+ self.ok = attributes[:'ok']
89
+ else
90
+ self.ok = nil
91
+ end
92
+
93
+ if attributes.key?(:'data')
94
+ self.data = attributes[:'data']
95
+ else
96
+ self.data = nil
97
+ end
98
+ end
99
+
100
+ # Show invalid properties with the reasons. Usually used together with valid?
101
+ # @return Array for valid properties with the reasons
102
+ def list_invalid_properties
103
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
104
+ invalid_properties = Array.new
105
+ if @meta.nil?
106
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
107
+ end
108
+
109
+ if @ok.nil?
110
+ invalid_properties.push('invalid value for "ok", ok cannot be nil.')
111
+ end
112
+
113
+ if @data.nil?
114
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
115
+ end
116
+
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ warn '[DEPRECATED] the `valid?` method is obsolete'
124
+ return false if @meta.nil?
125
+ return false if @ok.nil?
126
+ return false if @data.nil?
127
+ true
128
+ end
129
+
130
+ # Custom attribute writer method with validation
131
+ # @param [Object] meta Value to be assigned
132
+ def meta=(meta)
133
+ if meta.nil?
134
+ fail ArgumentError, 'meta cannot be nil'
135
+ end
136
+
137
+ @meta = meta
138
+ end
139
+
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] ok Value to be assigned
142
+ def ok=(ok)
143
+ if ok.nil?
144
+ fail ArgumentError, 'ok cannot be nil'
145
+ end
146
+
147
+ @ok = ok
148
+ end
149
+
150
+ # Custom attribute writer method with validation
151
+ # @param [Object] data Value to be assigned
152
+ def data=(data)
153
+ if data.nil?
154
+ fail ArgumentError, 'data cannot be nil'
155
+ end
156
+
157
+ @data = data
158
+ end
159
+
160
+ # Checks equality by comparing each attribute.
161
+ # @param [Object] Object to be compared
162
+ def ==(o)
163
+ return true if self.equal?(o)
164
+ self.class == o.class &&
165
+ meta == o.meta &&
166
+ ok == o.ok &&
167
+ data == o.data
168
+ end
169
+
170
+ # @see the `==` method
171
+ # @param [Object] Object to be compared
172
+ def eql?(o)
173
+ self == o
174
+ end
175
+
176
+ # Calculates hash code according to all attributes.
177
+ # @return [Integer] Hash code
178
+ def hash
179
+ [meta, ok, data].hash
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def self.build_from_hash(attributes)
186
+ return nil unless attributes.is_a?(Hash)
187
+ attributes = attributes.transform_keys(&:to_sym)
188
+ transformed_hash = {}
189
+ openapi_types.each_pair do |key, type|
190
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
191
+ transformed_hash["#{key}"] = nil
192
+ elsif type =~ /\AArray<(.*)>/i
193
+ # check to ensure the input is an array given that the attribute
194
+ # is documented as an array but the input is not
195
+ if attributes[attribute_map[key]].is_a?(Array)
196
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
197
+ end
198
+ elsif !attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
200
+ end
201
+ end
202
+ new(transformed_hash)
203
+ end
204
+
205
+ # Returns the object in the form of hash
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = self.send(attr)
211
+ if value.nil?
212
+ is_nullable = self.class.openapi_nullable.include?(attr)
213
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
214
+ end
215
+
216
+ hash[param] = _to_hash(value)
217
+ end
218
+ hash
219
+ end
220
+
221
+ end
222
+
223
+ end
@@ -0,0 +1,456 @@
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 MailboxMessageSummary < 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
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'bcc' => :'bcc',
54
+ :'cc' => :'cc',
55
+ :'flags' => :'flags',
56
+ :'folder_ids' => :'folder_ids',
57
+ :'from' => :'from',
58
+ :'has_attachments' => :'has_attachments',
59
+ :'id' => :'id',
60
+ :'keywords' => :'keywords',
61
+ :'preview' => :'preview',
62
+ :'received_at' => :'received_at',
63
+ :'sent_at' => :'sent_at',
64
+ :'size_bytes' => :'size_bytes',
65
+ :'subject' => :'subject',
66
+ :'thread_id' => :'thread_id',
67
+ :'to' => :'to'
68
+ }
69
+ end
70
+
71
+ # Returns attribute mapping this model knows about
72
+ def self.acceptable_attribute_map
73
+ attribute_map
74
+ end
75
+
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ acceptable_attribute_map.values
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+ :'bcc' => :'Array<MailboxAddress>',
85
+ :'cc' => :'Array<MailboxAddress>',
86
+ :'flags' => :'MailboxMessageFlags',
87
+ :'folder_ids' => :'Array<String>',
88
+ :'from' => :'MailboxMessageSummaryFrom',
89
+ :'has_attachments' => :'Boolean',
90
+ :'id' => :'String',
91
+ :'keywords' => :'Array<String>',
92
+ :'preview' => :'String',
93
+ :'received_at' => :'String',
94
+ :'sent_at' => :'String',
95
+ :'size_bytes' => :'Integer',
96
+ :'subject' => :'String',
97
+ :'thread_id' => :'String',
98
+ :'to' => :'Array<MailboxAddress>'
99
+ }
100
+ end
101
+
102
+ # List of attributes with nullable: true
103
+ def self.openapi_nullable
104
+ Set.new([
105
+ :'preview',
106
+ :'received_at',
107
+ :'sent_at',
108
+ :'size_bytes',
109
+ :'subject',
110
+ :'thread_id',
111
+ ])
112
+ end
113
+
114
+ # Initializes the object
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ def initialize(attributes = {})
117
+ if (!attributes.is_a?(Hash))
118
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::MailboxMessageSummary` initialize method"
119
+ end
120
+
121
+ # check to see if the attribute exists and convert string to symbol for hash key
122
+ acceptable_attribute_map = self.class.acceptable_attribute_map
123
+ attributes = attributes.each_with_object({}) { |(k, v), h|
124
+ if (!acceptable_attribute_map.key?(k.to_sym))
125
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::MailboxMessageSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
126
+ end
127
+ h[k.to_sym] = v
128
+ }
129
+
130
+ if attributes.key?(:'bcc')
131
+ if (value = attributes[:'bcc']).is_a?(Array)
132
+ self.bcc = value
133
+ end
134
+ else
135
+ self.bcc = nil
136
+ end
137
+
138
+ if attributes.key?(:'cc')
139
+ if (value = attributes[:'cc']).is_a?(Array)
140
+ self.cc = value
141
+ end
142
+ else
143
+ self.cc = nil
144
+ end
145
+
146
+ if attributes.key?(:'flags')
147
+ self.flags = attributes[:'flags']
148
+ else
149
+ self.flags = nil
150
+ end
151
+
152
+ if attributes.key?(:'folder_ids')
153
+ if (value = attributes[:'folder_ids']).is_a?(Array)
154
+ self.folder_ids = value
155
+ end
156
+ else
157
+ self.folder_ids = nil
158
+ end
159
+
160
+ if attributes.key?(:'from')
161
+ self.from = attributes[:'from']
162
+ else
163
+ self.from = nil
164
+ end
165
+
166
+ if attributes.key?(:'has_attachments')
167
+ self.has_attachments = attributes[:'has_attachments']
168
+ else
169
+ self.has_attachments = nil
170
+ end
171
+
172
+ if attributes.key?(:'id')
173
+ self.id = attributes[:'id']
174
+ else
175
+ self.id = nil
176
+ end
177
+
178
+ if attributes.key?(:'keywords')
179
+ if (value = attributes[:'keywords']).is_a?(Array)
180
+ self.keywords = value
181
+ end
182
+ else
183
+ self.keywords = nil
184
+ end
185
+
186
+ if attributes.key?(:'preview')
187
+ self.preview = attributes[:'preview']
188
+ else
189
+ self.preview = nil
190
+ end
191
+
192
+ if attributes.key?(:'received_at')
193
+ self.received_at = attributes[:'received_at']
194
+ else
195
+ self.received_at = nil
196
+ end
197
+
198
+ if attributes.key?(:'sent_at')
199
+ self.sent_at = attributes[:'sent_at']
200
+ else
201
+ self.sent_at = nil
202
+ end
203
+
204
+ if attributes.key?(:'size_bytes')
205
+ self.size_bytes = attributes[:'size_bytes']
206
+ else
207
+ self.size_bytes = nil
208
+ end
209
+
210
+ if attributes.key?(:'subject')
211
+ self.subject = attributes[:'subject']
212
+ else
213
+ self.subject = nil
214
+ end
215
+
216
+ if attributes.key?(:'thread_id')
217
+ self.thread_id = attributes[:'thread_id']
218
+ else
219
+ self.thread_id = nil
220
+ end
221
+
222
+ if attributes.key?(:'to')
223
+ if (value = attributes[:'to']).is_a?(Array)
224
+ self.to = value
225
+ end
226
+ else
227
+ self.to = nil
228
+ end
229
+ end
230
+
231
+ # Show invalid properties with the reasons. Usually used together with valid?
232
+ # @return Array for valid properties with the reasons
233
+ def list_invalid_properties
234
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
235
+ invalid_properties = Array.new
236
+ if @bcc.nil?
237
+ invalid_properties.push('invalid value for "bcc", bcc cannot be nil.')
238
+ end
239
+
240
+ if @cc.nil?
241
+ invalid_properties.push('invalid value for "cc", cc cannot be nil.')
242
+ end
243
+
244
+ if @flags.nil?
245
+ invalid_properties.push('invalid value for "flags", flags cannot be nil.')
246
+ end
247
+
248
+ if @folder_ids.nil?
249
+ invalid_properties.push('invalid value for "folder_ids", folder_ids cannot be nil.')
250
+ end
251
+
252
+ if @from.nil?
253
+ invalid_properties.push('invalid value for "from", from cannot be nil.')
254
+ end
255
+
256
+ if @has_attachments.nil?
257
+ invalid_properties.push('invalid value for "has_attachments", has_attachments cannot be nil.')
258
+ end
259
+
260
+ if @id.nil?
261
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
262
+ end
263
+
264
+ if @keywords.nil?
265
+ invalid_properties.push('invalid value for "keywords", keywords cannot be nil.')
266
+ end
267
+
268
+ if @to.nil?
269
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
270
+ end
271
+
272
+ invalid_properties
273
+ end
274
+
275
+ # Check to see if the all the properties in the model are valid
276
+ # @return true if the model is valid
277
+ def valid?
278
+ warn '[DEPRECATED] the `valid?` method is obsolete'
279
+ return false if @bcc.nil?
280
+ return false if @cc.nil?
281
+ return false if @flags.nil?
282
+ return false if @folder_ids.nil?
283
+ return false if @from.nil?
284
+ return false if @has_attachments.nil?
285
+ return false if @id.nil?
286
+ return false if @keywords.nil?
287
+ return false if @to.nil?
288
+ true
289
+ end
290
+
291
+ # Custom attribute writer method with validation
292
+ # @param [Object] bcc Value to be assigned
293
+ def bcc=(bcc)
294
+ if bcc.nil?
295
+ fail ArgumentError, 'bcc cannot be nil'
296
+ end
297
+
298
+ @bcc = bcc
299
+ end
300
+
301
+ # Custom attribute writer method with validation
302
+ # @param [Object] cc Value to be assigned
303
+ def cc=(cc)
304
+ if cc.nil?
305
+ fail ArgumentError, 'cc cannot be nil'
306
+ end
307
+
308
+ @cc = cc
309
+ end
310
+
311
+ # Custom attribute writer method with validation
312
+ # @param [Object] flags Value to be assigned
313
+ def flags=(flags)
314
+ if flags.nil?
315
+ fail ArgumentError, 'flags cannot be nil'
316
+ end
317
+
318
+ @flags = flags
319
+ end
320
+
321
+ # Custom attribute writer method with validation
322
+ # @param [Object] folder_ids Value to be assigned
323
+ def folder_ids=(folder_ids)
324
+ if folder_ids.nil?
325
+ fail ArgumentError, 'folder_ids cannot be nil'
326
+ end
327
+
328
+ @folder_ids = folder_ids
329
+ end
330
+
331
+ # Custom attribute writer method with validation
332
+ # @param [Object] from Value to be assigned
333
+ def from=(from)
334
+ if from.nil?
335
+ fail ArgumentError, 'from cannot be nil'
336
+ end
337
+
338
+ @from = from
339
+ end
340
+
341
+ # Custom attribute writer method with validation
342
+ # @param [Object] has_attachments Value to be assigned
343
+ def has_attachments=(has_attachments)
344
+ if has_attachments.nil?
345
+ fail ArgumentError, 'has_attachments cannot be nil'
346
+ end
347
+
348
+ @has_attachments = has_attachments
349
+ end
350
+
351
+ # Custom attribute writer method with validation
352
+ # @param [Object] id Value to be assigned
353
+ def id=(id)
354
+ if id.nil?
355
+ fail ArgumentError, 'id cannot be nil'
356
+ end
357
+
358
+ @id = id
359
+ end
360
+
361
+ # Custom attribute writer method with validation
362
+ # @param [Object] keywords Value to be assigned
363
+ def keywords=(keywords)
364
+ if keywords.nil?
365
+ fail ArgumentError, 'keywords cannot be nil'
366
+ end
367
+
368
+ @keywords = keywords
369
+ end
370
+
371
+ # Custom attribute writer method with validation
372
+ # @param [Object] to Value to be assigned
373
+ def to=(to)
374
+ if to.nil?
375
+ fail ArgumentError, 'to cannot be nil'
376
+ end
377
+
378
+ @to = to
379
+ end
380
+
381
+ # Checks equality by comparing each attribute.
382
+ # @param [Object] Object to be compared
383
+ def ==(o)
384
+ return true if self.equal?(o)
385
+ self.class == o.class &&
386
+ bcc == o.bcc &&
387
+ cc == o.cc &&
388
+ flags == o.flags &&
389
+ folder_ids == o.folder_ids &&
390
+ from == o.from &&
391
+ has_attachments == o.has_attachments &&
392
+ id == o.id &&
393
+ keywords == o.keywords &&
394
+ preview == o.preview &&
395
+ received_at == o.received_at &&
396
+ sent_at == o.sent_at &&
397
+ size_bytes == o.size_bytes &&
398
+ subject == o.subject &&
399
+ thread_id == o.thread_id &&
400
+ to == o.to
401
+ end
402
+
403
+ # @see the `==` method
404
+ # @param [Object] Object to be compared
405
+ def eql?(o)
406
+ self == o
407
+ end
408
+
409
+ # Calculates hash code according to all attributes.
410
+ # @return [Integer] Hash code
411
+ def hash
412
+ [bcc, cc, flags, folder_ids, from, has_attachments, id, keywords, preview, received_at, sent_at, size_bytes, subject, thread_id, to].hash
413
+ end
414
+
415
+ # Builds the object from hash
416
+ # @param [Hash] attributes Model attributes in the form of hash
417
+ # @return [Object] Returns the model itself
418
+ def self.build_from_hash(attributes)
419
+ return nil unless attributes.is_a?(Hash)
420
+ attributes = attributes.transform_keys(&:to_sym)
421
+ transformed_hash = {}
422
+ openapi_types.each_pair do |key, type|
423
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
424
+ transformed_hash["#{key}"] = nil
425
+ elsif type =~ /\AArray<(.*)>/i
426
+ # check to ensure the input is an array given that the attribute
427
+ # is documented as an array but the input is not
428
+ if attributes[attribute_map[key]].is_a?(Array)
429
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
430
+ end
431
+ elsif !attributes[attribute_map[key]].nil?
432
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
433
+ end
434
+ end
435
+ new(transformed_hash)
436
+ end
437
+
438
+ # Returns the object in the form of hash
439
+ # @return [Hash] Returns the object in the form of hash
440
+ def to_hash
441
+ hash = {}
442
+ self.class.attribute_map.each_pair do |attr, param|
443
+ value = self.send(attr)
444
+ if value.nil?
445
+ is_nullable = self.class.openapi_nullable.include?(attr)
446
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
447
+ end
448
+
449
+ hash[param] = _to_hash(value)
450
+ end
451
+ hash
452
+ end
453
+
454
+ end
455
+
456
+ end