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