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,294 @@
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 MailboxSessionCapabilitiesAttachments < ApiModelBase
18
+ attr_accessor :download
19
+
20
+ attr_accessor :metadata
21
+
22
+ attr_accessor :parsing
23
+
24
+ attr_accessor :range_download
25
+
26
+ attr_accessor :send_with_uploaded_blob
27
+
28
+ attr_accessor :upload
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'download' => :'download',
34
+ :'metadata' => :'metadata',
35
+ :'parsing' => :'parsing',
36
+ :'range_download' => :'range_download',
37
+ :'send_with_uploaded_blob' => :'send_with_uploaded_blob',
38
+ :'upload' => :'upload'
39
+ }
40
+ end
41
+
42
+ # Returns attribute mapping this model knows about
43
+ def self.acceptable_attribute_map
44
+ attribute_map
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ acceptable_attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'download' => :'Boolean',
56
+ :'metadata' => :'Boolean',
57
+ :'parsing' => :'Boolean',
58
+ :'range_download' => :'Boolean',
59
+ :'send_with_uploaded_blob' => :'Boolean',
60
+ :'upload' => :'Boolean'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::MailboxSessionCapabilitiesAttachments` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ acceptable_attribute_map = self.class.acceptable_attribute_map
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!acceptable_attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::MailboxSessionCapabilitiesAttachments`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'download')
87
+ self.download = attributes[:'download']
88
+ else
89
+ self.download = nil
90
+ end
91
+
92
+ if attributes.key?(:'metadata')
93
+ self.metadata = attributes[:'metadata']
94
+ else
95
+ self.metadata = nil
96
+ end
97
+
98
+ if attributes.key?(:'parsing')
99
+ self.parsing = attributes[:'parsing']
100
+ else
101
+ self.parsing = nil
102
+ end
103
+
104
+ if attributes.key?(:'range_download')
105
+ self.range_download = attributes[:'range_download']
106
+ else
107
+ self.range_download = nil
108
+ end
109
+
110
+ if attributes.key?(:'send_with_uploaded_blob')
111
+ self.send_with_uploaded_blob = attributes[:'send_with_uploaded_blob']
112
+ else
113
+ self.send_with_uploaded_blob = nil
114
+ end
115
+
116
+ if attributes.key?(:'upload')
117
+ self.upload = attributes[:'upload']
118
+ else
119
+ self.upload = nil
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
127
+ invalid_properties = Array.new
128
+ if @download.nil?
129
+ invalid_properties.push('invalid value for "download", download cannot be nil.')
130
+ end
131
+
132
+ if @metadata.nil?
133
+ invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
134
+ end
135
+
136
+ if @parsing.nil?
137
+ invalid_properties.push('invalid value for "parsing", parsing cannot be nil.')
138
+ end
139
+
140
+ if @range_download.nil?
141
+ invalid_properties.push('invalid value for "range_download", range_download cannot be nil.')
142
+ end
143
+
144
+ if @send_with_uploaded_blob.nil?
145
+ invalid_properties.push('invalid value for "send_with_uploaded_blob", send_with_uploaded_blob cannot be nil.')
146
+ end
147
+
148
+ if @upload.nil?
149
+ invalid_properties.push('invalid value for "upload", upload cannot be nil.')
150
+ end
151
+
152
+ invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ warn '[DEPRECATED] the `valid?` method is obsolete'
159
+ return false if @download.nil?
160
+ return false if @metadata.nil?
161
+ return false if @parsing.nil?
162
+ return false if @range_download.nil?
163
+ return false if @send_with_uploaded_blob.nil?
164
+ return false if @upload.nil?
165
+ true
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param [Object] download Value to be assigned
170
+ def download=(download)
171
+ if download.nil?
172
+ fail ArgumentError, 'download cannot be nil'
173
+ end
174
+
175
+ @download = download
176
+ end
177
+
178
+ # Custom attribute writer method with validation
179
+ # @param [Object] metadata Value to be assigned
180
+ def metadata=(metadata)
181
+ if metadata.nil?
182
+ fail ArgumentError, 'metadata cannot be nil'
183
+ end
184
+
185
+ @metadata = metadata
186
+ end
187
+
188
+ # Custom attribute writer method with validation
189
+ # @param [Object] parsing Value to be assigned
190
+ def parsing=(parsing)
191
+ if parsing.nil?
192
+ fail ArgumentError, 'parsing cannot be nil'
193
+ end
194
+
195
+ @parsing = parsing
196
+ end
197
+
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] range_download Value to be assigned
200
+ def range_download=(range_download)
201
+ if range_download.nil?
202
+ fail ArgumentError, 'range_download cannot be nil'
203
+ end
204
+
205
+ @range_download = range_download
206
+ end
207
+
208
+ # Custom attribute writer method with validation
209
+ # @param [Object] send_with_uploaded_blob Value to be assigned
210
+ def send_with_uploaded_blob=(send_with_uploaded_blob)
211
+ if send_with_uploaded_blob.nil?
212
+ fail ArgumentError, 'send_with_uploaded_blob cannot be nil'
213
+ end
214
+
215
+ @send_with_uploaded_blob = send_with_uploaded_blob
216
+ end
217
+
218
+ # Custom attribute writer method with validation
219
+ # @param [Object] upload Value to be assigned
220
+ def upload=(upload)
221
+ if upload.nil?
222
+ fail ArgumentError, 'upload cannot be nil'
223
+ end
224
+
225
+ @upload = upload
226
+ end
227
+
228
+ # Checks equality by comparing each attribute.
229
+ # @param [Object] Object to be compared
230
+ def ==(o)
231
+ return true if self.equal?(o)
232
+ self.class == o.class &&
233
+ download == o.download &&
234
+ metadata == o.metadata &&
235
+ parsing == o.parsing &&
236
+ range_download == o.range_download &&
237
+ send_with_uploaded_blob == o.send_with_uploaded_blob &&
238
+ upload == o.upload
239
+ end
240
+
241
+ # @see the `==` method
242
+ # @param [Object] Object to be compared
243
+ def eql?(o)
244
+ self == o
245
+ end
246
+
247
+ # Calculates hash code according to all attributes.
248
+ # @return [Integer] Hash code
249
+ def hash
250
+ [download, metadata, parsing, range_download, send_with_uploaded_blob, upload].hash
251
+ end
252
+
253
+ # Builds the object from hash
254
+ # @param [Hash] attributes Model attributes in the form of hash
255
+ # @return [Object] Returns the model itself
256
+ def self.build_from_hash(attributes)
257
+ return nil unless attributes.is_a?(Hash)
258
+ attributes = attributes.transform_keys(&:to_sym)
259
+ transformed_hash = {}
260
+ openapi_types.each_pair do |key, type|
261
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
262
+ transformed_hash["#{key}"] = nil
263
+ elsif type =~ /\AArray<(.*)>/i
264
+ # check to ensure the input is an array given that the attribute
265
+ # is documented as an array but the input is not
266
+ if attributes[attribute_map[key]].is_a?(Array)
267
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
268
+ end
269
+ elsif !attributes[attribute_map[key]].nil?
270
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
271
+ end
272
+ end
273
+ new(transformed_hash)
274
+ end
275
+
276
+ # Returns the object in the form of hash
277
+ # @return [Hash] Returns the object in the form of hash
278
+ def to_hash
279
+ hash = {}
280
+ self.class.attribute_map.each_pair do |attr, param|
281
+ value = self.send(attr)
282
+ if value.nil?
283
+ is_nullable = self.class.openapi_nullable.include?(attr)
284
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
285
+ end
286
+
287
+ hash[param] = _to_hash(value)
288
+ end
289
+ hash
290
+ end
291
+
292
+ end
293
+
294
+ end
@@ -0,0 +1,320 @@
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 MailboxSessionCapabilitiesFolders < ApiModelBase
18
+ attr_accessor :changes
19
+
20
+ attr_accessor :create
21
+
22
+ attr_accessor :delete
23
+
24
+ attr_accessor :detail
25
+
26
+ attr_accessor :list
27
+
28
+ attr_accessor :query_changes
29
+
30
+ attr_accessor :update
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'changes' => :'changes',
36
+ :'create' => :'create',
37
+ :'delete' => :'delete',
38
+ :'detail' => :'detail',
39
+ :'list' => :'list',
40
+ :'query_changes' => :'query_changes',
41
+ :'update' => :'update'
42
+ }
43
+ end
44
+
45
+ # Returns attribute mapping this model knows about
46
+ def self.acceptable_attribute_map
47
+ attribute_map
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ acceptable_attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'changes' => :'Boolean',
59
+ :'create' => :'Boolean',
60
+ :'delete' => :'Boolean',
61
+ :'detail' => :'Boolean',
62
+ :'list' => :'Boolean',
63
+ :'query_changes' => :'Boolean',
64
+ :'update' => :'Boolean'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ ])
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ if (!attributes.is_a?(Hash))
78
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::MailboxSessionCapabilitiesFolders` initialize method"
79
+ end
80
+
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ acceptable_attribute_map = self.class.acceptable_attribute_map
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!acceptable_attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::MailboxSessionCapabilitiesFolders`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'changes')
91
+ self.changes = attributes[:'changes']
92
+ else
93
+ self.changes = nil
94
+ end
95
+
96
+ if attributes.key?(:'create')
97
+ self.create = attributes[:'create']
98
+ else
99
+ self.create = nil
100
+ end
101
+
102
+ if attributes.key?(:'delete')
103
+ self.delete = attributes[:'delete']
104
+ else
105
+ self.delete = nil
106
+ end
107
+
108
+ if attributes.key?(:'detail')
109
+ self.detail = attributes[:'detail']
110
+ else
111
+ self.detail = nil
112
+ end
113
+
114
+ if attributes.key?(:'list')
115
+ self.list = attributes[:'list']
116
+ else
117
+ self.list = nil
118
+ end
119
+
120
+ if attributes.key?(:'query_changes')
121
+ self.query_changes = attributes[:'query_changes']
122
+ else
123
+ self.query_changes = nil
124
+ end
125
+
126
+ if attributes.key?(:'update')
127
+ self.update = attributes[:'update']
128
+ else
129
+ self.update = nil
130
+ end
131
+ end
132
+
133
+ # Show invalid properties with the reasons. Usually used together with valid?
134
+ # @return Array for valid properties with the reasons
135
+ def list_invalid_properties
136
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
137
+ invalid_properties = Array.new
138
+ if @changes.nil?
139
+ invalid_properties.push('invalid value for "changes", changes cannot be nil.')
140
+ end
141
+
142
+ if @create.nil?
143
+ invalid_properties.push('invalid value for "create", create cannot be nil.')
144
+ end
145
+
146
+ if @delete.nil?
147
+ invalid_properties.push('invalid value for "delete", delete cannot be nil.')
148
+ end
149
+
150
+ if @detail.nil?
151
+ invalid_properties.push('invalid value for "detail", detail cannot be nil.')
152
+ end
153
+
154
+ if @list.nil?
155
+ invalid_properties.push('invalid value for "list", list cannot be nil.')
156
+ end
157
+
158
+ if @query_changes.nil?
159
+ invalid_properties.push('invalid value for "query_changes", query_changes cannot be nil.')
160
+ end
161
+
162
+ if @update.nil?
163
+ invalid_properties.push('invalid value for "update", update cannot be nil.')
164
+ end
165
+
166
+ invalid_properties
167
+ end
168
+
169
+ # Check to see if the all the properties in the model are valid
170
+ # @return true if the model is valid
171
+ def valid?
172
+ warn '[DEPRECATED] the `valid?` method is obsolete'
173
+ return false if @changes.nil?
174
+ return false if @create.nil?
175
+ return false if @delete.nil?
176
+ return false if @detail.nil?
177
+ return false if @list.nil?
178
+ return false if @query_changes.nil?
179
+ return false if @update.nil?
180
+ true
181
+ end
182
+
183
+ # Custom attribute writer method with validation
184
+ # @param [Object] changes Value to be assigned
185
+ def changes=(changes)
186
+ if changes.nil?
187
+ fail ArgumentError, 'changes cannot be nil'
188
+ end
189
+
190
+ @changes = changes
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] create Value to be assigned
195
+ def create=(create)
196
+ if create.nil?
197
+ fail ArgumentError, 'create cannot be nil'
198
+ end
199
+
200
+ @create = create
201
+ end
202
+
203
+ # Custom attribute writer method with validation
204
+ # @param [Object] delete Value to be assigned
205
+ def delete=(delete)
206
+ if delete.nil?
207
+ fail ArgumentError, 'delete cannot be nil'
208
+ end
209
+
210
+ @delete = delete
211
+ end
212
+
213
+ # Custom attribute writer method with validation
214
+ # @param [Object] detail Value to be assigned
215
+ def detail=(detail)
216
+ if detail.nil?
217
+ fail ArgumentError, 'detail cannot be nil'
218
+ end
219
+
220
+ @detail = detail
221
+ end
222
+
223
+ # Custom attribute writer method with validation
224
+ # @param [Object] list Value to be assigned
225
+ def list=(list)
226
+ if list.nil?
227
+ fail ArgumentError, 'list cannot be nil'
228
+ end
229
+
230
+ @list = list
231
+ end
232
+
233
+ # Custom attribute writer method with validation
234
+ # @param [Object] query_changes Value to be assigned
235
+ def query_changes=(query_changes)
236
+ if query_changes.nil?
237
+ fail ArgumentError, 'query_changes cannot be nil'
238
+ end
239
+
240
+ @query_changes = query_changes
241
+ end
242
+
243
+ # Custom attribute writer method with validation
244
+ # @param [Object] update Value to be assigned
245
+ def update=(update)
246
+ if update.nil?
247
+ fail ArgumentError, 'update cannot be nil'
248
+ end
249
+
250
+ @update = update
251
+ end
252
+
253
+ # Checks equality by comparing each attribute.
254
+ # @param [Object] Object to be compared
255
+ def ==(o)
256
+ return true if self.equal?(o)
257
+ self.class == o.class &&
258
+ changes == o.changes &&
259
+ create == o.create &&
260
+ delete == o.delete &&
261
+ detail == o.detail &&
262
+ list == o.list &&
263
+ query_changes == o.query_changes &&
264
+ update == o.update
265
+ end
266
+
267
+ # @see the `==` method
268
+ # @param [Object] Object to be compared
269
+ def eql?(o)
270
+ self == o
271
+ end
272
+
273
+ # Calculates hash code according to all attributes.
274
+ # @return [Integer] Hash code
275
+ def hash
276
+ [changes, create, delete, detail, list, query_changes, update].hash
277
+ end
278
+
279
+ # Builds the object from hash
280
+ # @param [Hash] attributes Model attributes in the form of hash
281
+ # @return [Object] Returns the model itself
282
+ def self.build_from_hash(attributes)
283
+ return nil unless attributes.is_a?(Hash)
284
+ attributes = attributes.transform_keys(&:to_sym)
285
+ transformed_hash = {}
286
+ openapi_types.each_pair do |key, type|
287
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
288
+ transformed_hash["#{key}"] = nil
289
+ elsif type =~ /\AArray<(.*)>/i
290
+ # check to ensure the input is an array given that the attribute
291
+ # is documented as an array but the input is not
292
+ if attributes[attribute_map[key]].is_a?(Array)
293
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
294
+ end
295
+ elsif !attributes[attribute_map[key]].nil?
296
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
297
+ end
298
+ end
299
+ new(transformed_hash)
300
+ end
301
+
302
+ # Returns the object in the form of hash
303
+ # @return [Hash] Returns the object in the form of hash
304
+ def to_hash
305
+ hash = {}
306
+ self.class.attribute_map.each_pair do |attr, param|
307
+ value = self.send(attr)
308
+ if value.nil?
309
+ is_nullable = self.class.openapi_nullable.include?(attr)
310
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
311
+ end
312
+
313
+ hash[param] = _to_hash(value)
314
+ end
315
+ hash
316
+ end
317
+
318
+ end
319
+
320
+ end