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,293 +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 SendMailboxMessageBody < ApiModelBase
18
- # Attachments to send with the message.
19
- attr_accessor :attachments
20
-
21
- # BCC recipients.
22
- attr_accessor :bcc
23
-
24
- # CC recipients.
25
- attr_accessor :cc
26
-
27
- # Custom headers to include.
28
- attr_accessor :custom_headers
29
-
30
- # Sender address. Defaults to mailbox identity.
31
- attr_accessor :from
32
-
33
- # HTML body.
34
- attr_accessor :html_body
35
-
36
- # Reply-To recipients.
37
- attr_accessor :reply_to
38
-
39
- # Subject line for the outgoing email.
40
- attr_accessor :subject
41
-
42
- # Plain text body.
43
- attr_accessor :text_body
44
-
45
- # Primary recipients.
46
- attr_accessor :to
47
-
48
- # Attribute mapping from ruby-style variable name to JSON key.
49
- def self.attribute_map
50
- {
51
- :'attachments' => :'attachments',
52
- :'bcc' => :'bcc',
53
- :'cc' => :'cc',
54
- :'custom_headers' => :'custom_headers',
55
- :'from' => :'from',
56
- :'html_body' => :'html_body',
57
- :'reply_to' => :'reply_to',
58
- :'subject' => :'subject',
59
- :'text_body' => :'text_body',
60
- :'to' => :'to'
61
- }
62
- end
63
-
64
- # Returns attribute mapping this model knows about
65
- def self.acceptable_attribute_map
66
- attribute_map
67
- end
68
-
69
- # Returns all the JSON keys this model knows about
70
- def self.acceptable_attributes
71
- acceptable_attribute_map.values
72
- end
73
-
74
- # Attribute type mapping.
75
- def self.openapi_types
76
- {
77
- :'attachments' => :'Array<SendMailboxMessageBodyAttachmentsInner>',
78
- :'bcc' => :'Array<MailboxAddress>',
79
- :'cc' => :'Array<MailboxAddress>',
80
- :'custom_headers' => :'Hash<String, String>',
81
- :'from' => :'MailboxAddress',
82
- :'html_body' => :'String',
83
- :'reply_to' => :'Array<MailboxAddress>',
84
- :'subject' => :'String',
85
- :'text_body' => :'String',
86
- :'to' => :'Array<MailboxAddress>'
87
- }
88
- end
89
-
90
- # List of attributes with nullable: true
91
- def self.openapi_nullable
92
- Set.new([
93
- ])
94
- end
95
-
96
- # Initializes the object
97
- # @param [Hash] attributes Model attributes in the form of hash
98
- def initialize(attributes = {})
99
- if (!attributes.is_a?(Hash))
100
- fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::SendMailboxMessageBody` initialize method"
101
- end
102
-
103
- # check to see if the attribute exists and convert string to symbol for hash key
104
- acceptable_attribute_map = self.class.acceptable_attribute_map
105
- attributes = attributes.each_with_object({}) { |(k, v), h|
106
- if (!acceptable_attribute_map.key?(k.to_sym))
107
- fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::SendMailboxMessageBody`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
108
- end
109
- h[k.to_sym] = v
110
- }
111
-
112
- if attributes.key?(:'attachments')
113
- if (value = attributes[:'attachments']).is_a?(Array)
114
- self.attachments = value
115
- end
116
- end
117
-
118
- if attributes.key?(:'bcc')
119
- if (value = attributes[:'bcc']).is_a?(Array)
120
- self.bcc = value
121
- end
122
- end
123
-
124
- if attributes.key?(:'cc')
125
- if (value = attributes[:'cc']).is_a?(Array)
126
- self.cc = value
127
- end
128
- end
129
-
130
- if attributes.key?(:'custom_headers')
131
- if (value = attributes[:'custom_headers']).is_a?(Hash)
132
- self.custom_headers = value
133
- end
134
- end
135
-
136
- if attributes.key?(:'from')
137
- self.from = attributes[:'from']
138
- end
139
-
140
- if attributes.key?(:'html_body')
141
- self.html_body = attributes[:'html_body']
142
- end
143
-
144
- if attributes.key?(:'reply_to')
145
- if (value = attributes[:'reply_to']).is_a?(Array)
146
- self.reply_to = value
147
- end
148
- end
149
-
150
- if attributes.key?(:'subject')
151
- self.subject = attributes[:'subject']
152
- else
153
- self.subject = nil
154
- end
155
-
156
- if attributes.key?(:'text_body')
157
- self.text_body = attributes[:'text_body']
158
- end
159
-
160
- if attributes.key?(:'to')
161
- if (value = attributes[:'to']).is_a?(Array)
162
- self.to = value
163
- end
164
- else
165
- self.to = nil
166
- end
167
- end
168
-
169
- # Show invalid properties with the reasons. Usually used together with valid?
170
- # @return Array for valid properties with the reasons
171
- def list_invalid_properties
172
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
173
- invalid_properties = Array.new
174
- if @subject.nil?
175
- invalid_properties.push('invalid value for "subject", subject cannot be nil.')
176
- end
177
-
178
- if @to.nil?
179
- invalid_properties.push('invalid value for "to", to cannot be nil.')
180
- end
181
-
182
- if @to.length < 1
183
- invalid_properties.push('invalid value for "to", number of items must be greater than or equal to 1.')
184
- end
185
-
186
- invalid_properties
187
- end
188
-
189
- # Check to see if the all the properties in the model are valid
190
- # @return true if the model is valid
191
- def valid?
192
- warn '[DEPRECATED] the `valid?` method is obsolete'
193
- return false if @subject.nil?
194
- return false if @to.nil?
195
- return false if @to.length < 1
196
- true
197
- end
198
-
199
- # Custom attribute writer method with validation
200
- # @param [Object] subject Value to be assigned
201
- def subject=(subject)
202
- if subject.nil?
203
- fail ArgumentError, 'subject cannot be nil'
204
- end
205
-
206
- @subject = subject
207
- end
208
-
209
- # Custom attribute writer method with validation
210
- # @param [Object] to Value to be assigned
211
- def to=(to)
212
- if to.nil?
213
- fail ArgumentError, 'to cannot be nil'
214
- end
215
-
216
- if to.length < 1
217
- fail ArgumentError, 'invalid value for "to", number of items must be greater than or equal to 1.'
218
- end
219
-
220
- @to = to
221
- end
222
-
223
- # Checks equality by comparing each attribute.
224
- # @param [Object] Object to be compared
225
- def ==(o)
226
- return true if self.equal?(o)
227
- self.class == o.class &&
228
- attachments == o.attachments &&
229
- bcc == o.bcc &&
230
- cc == o.cc &&
231
- custom_headers == o.custom_headers &&
232
- from == o.from &&
233
- html_body == o.html_body &&
234
- reply_to == o.reply_to &&
235
- subject == o.subject &&
236
- text_body == o.text_body &&
237
- to == o.to
238
- end
239
-
240
- # @see the `==` method
241
- # @param [Object] Object to be compared
242
- def eql?(o)
243
- self == o
244
- end
245
-
246
- # Calculates hash code according to all attributes.
247
- # @return [Integer] Hash code
248
- def hash
249
- [attachments, bcc, cc, custom_headers, from, html_body, reply_to, subject, text_body, to].hash
250
- end
251
-
252
- # Builds the object from hash
253
- # @param [Hash] attributes Model attributes in the form of hash
254
- # @return [Object] Returns the model itself
255
- def self.build_from_hash(attributes)
256
- return nil unless attributes.is_a?(Hash)
257
- attributes = attributes.transform_keys(&:to_sym)
258
- transformed_hash = {}
259
- openapi_types.each_pair do |key, type|
260
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
261
- transformed_hash["#{key}"] = nil
262
- elsif type =~ /\AArray<(.*)>/i
263
- # check to ensure the input is an array given that the attribute
264
- # is documented as an array but the input is not
265
- if attributes[attribute_map[key]].is_a?(Array)
266
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
267
- end
268
- elsif !attributes[attribute_map[key]].nil?
269
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
270
- end
271
- end
272
- new(transformed_hash)
273
- end
274
-
275
- # Returns the object in the form of hash
276
- # @return [Hash] Returns the object in the form of hash
277
- def to_hash
278
- hash = {}
279
- self.class.attribute_map.each_pair do |attr, param|
280
- value = self.send(attr)
281
- if value.nil?
282
- is_nullable = self.class.openapi_nullable.include?(attr)
283
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
284
- end
285
-
286
- hash[param] = _to_hash(value)
287
- end
288
- hash
289
- end
290
-
291
- end
292
-
293
- end
@@ -1,103 +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
- module SendMailboxMessageBodyAttachmentsInner
18
- class << self
19
- # List of class defined in anyOf (OpenAPI v3)
20
- def openapi_any_of
21
- [
22
- :'SendMailboxMessageBodyAttachmentsInnerAnyOf',
23
- :'SendMailboxMessageBodyAttachmentsInnerAnyOf1'
24
- ]
25
- end
26
-
27
- # Builds the object
28
- # @param [Mixed] Data to be matched against the list of anyOf items
29
- # @return [Object] Returns the model or the data itself
30
- def build(data)
31
- # Go through the list of anyOf items and attempt to identify the appropriate one.
32
- # Note:
33
- # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
34
- # due to the way the deserialization is made in the base_object template (it just casts without verifying).
35
- # - TODO: scalar values are de facto behaving as if they were nullable.
36
- # - TODO: logging when debugging is set.
37
- openapi_any_of.each do |klass|
38
- begin
39
- next if klass == :AnyType # "nullable: true"
40
- return find_and_cast_into_type(klass, data)
41
- rescue # rescue all errors so we keep iterating even if the current item lookup raises
42
- end
43
- end
44
-
45
- openapi_any_of.include?(:AnyType) ? data : nil
46
- end
47
-
48
- private
49
-
50
- SchemaMismatchError = Class.new(StandardError)
51
-
52
- # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
53
- def find_and_cast_into_type(klass, data)
54
- return if data.nil?
55
-
56
- case klass.to_s
57
- when 'Boolean'
58
- return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
59
- when 'Float'
60
- return data if data.instance_of?(Float)
61
- when 'Integer'
62
- return data if data.instance_of?(Integer)
63
- when 'Time'
64
- return Time.parse(data)
65
- when 'Date'
66
- return Date.iso8601(data)
67
- when 'String'
68
- return data if data.instance_of?(String)
69
- when 'Object' # "type: object"
70
- return data if data.instance_of?(Hash)
71
- when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
72
- if data.instance_of?(Array)
73
- sub_type = Regexp.last_match[:sub_type]
74
- return data.map { |item| find_and_cast_into_type(sub_type, item) }
75
- end
76
- when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
77
- if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
78
- sub_type = Regexp.last_match[:sub_type]
79
- return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
80
- end
81
- else # model
82
- const = Sendmux::Mailbox::Generated.const_get(klass)
83
- if const
84
- if const.respond_to?(:openapi_any_of) # nested anyOf model
85
- model = const.build(data)
86
- return model if model
87
- else
88
- # raise if data contains keys that are not known to the model
89
- raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
90
- model = const.build_from_hash(data)
91
- return model if model
92
- end
93
- end
94
- end
95
-
96
- raise # if no match by now, raise
97
- rescue
98
- raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
99
- end
100
- end
101
- end
102
-
103
- end
@@ -1,217 +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 SendMailboxMessageBodyAttachmentsInnerAnyOf < ApiModelBase
18
- # Base64-encoded content for small inline attachments. Use /mailbox/attachments:upload for larger files.
19
- attr_accessor :content
20
-
21
- attr_accessor :content_type
22
-
23
- attr_accessor :filename
24
-
25
- # Attribute mapping from ruby-style variable name to JSON key.
26
- def self.attribute_map
27
- {
28
- :'content' => :'content',
29
- :'content_type' => :'content_type',
30
- :'filename' => :'filename'
31
- }
32
- end
33
-
34
- # Returns attribute mapping this model knows about
35
- def self.acceptable_attribute_map
36
- attribute_map
37
- end
38
-
39
- # Returns all the JSON keys this model knows about
40
- def self.acceptable_attributes
41
- acceptable_attribute_map.values
42
- end
43
-
44
- # Attribute type mapping.
45
- def self.openapi_types
46
- {
47
- :'content' => :'String',
48
- :'content_type' => :'String',
49
- :'filename' => :'String'
50
- }
51
- end
52
-
53
- # List of attributes with nullable: true
54
- def self.openapi_nullable
55
- Set.new([
56
- ])
57
- end
58
-
59
- # Initializes the object
60
- # @param [Hash] attributes Model attributes in the form of hash
61
- def initialize(attributes = {})
62
- if (!attributes.is_a?(Hash))
63
- fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::SendMailboxMessageBodyAttachmentsInnerAnyOf` initialize method"
64
- end
65
-
66
- # check to see if the attribute exists and convert string to symbol for hash key
67
- acceptable_attribute_map = self.class.acceptable_attribute_map
68
- attributes = attributes.each_with_object({}) { |(k, v), h|
69
- if (!acceptable_attribute_map.key?(k.to_sym))
70
- fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::SendMailboxMessageBodyAttachmentsInnerAnyOf`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
- end
72
- h[k.to_sym] = v
73
- }
74
-
75
- if attributes.key?(:'content')
76
- self.content = attributes[:'content']
77
- else
78
- self.content = nil
79
- end
80
-
81
- if attributes.key?(:'content_type')
82
- self.content_type = attributes[:'content_type']
83
- else
84
- self.content_type = nil
85
- end
86
-
87
- if attributes.key?(:'filename')
88
- self.filename = attributes[:'filename']
89
- else
90
- self.filename = nil
91
- end
92
- end
93
-
94
- # Show invalid properties with the reasons. Usually used together with valid?
95
- # @return Array for valid properties with the reasons
96
- def list_invalid_properties
97
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
98
- invalid_properties = Array.new
99
- if @content.nil?
100
- invalid_properties.push('invalid value for "content", content cannot be nil.')
101
- end
102
-
103
- if @content_type.nil?
104
- invalid_properties.push('invalid value for "content_type", content_type cannot be nil.')
105
- end
106
-
107
- if @filename.nil?
108
- invalid_properties.push('invalid value for "filename", filename cannot be nil.')
109
- end
110
-
111
- invalid_properties
112
- end
113
-
114
- # Check to see if the all the properties in the model are valid
115
- # @return true if the model is valid
116
- def valid?
117
- warn '[DEPRECATED] the `valid?` method is obsolete'
118
- return false if @content.nil?
119
- return false if @content_type.nil?
120
- return false if @filename.nil?
121
- true
122
- end
123
-
124
- # Custom attribute writer method with validation
125
- # @param [Object] content Value to be assigned
126
- def content=(content)
127
- if content.nil?
128
- fail ArgumentError, 'content cannot be nil'
129
- end
130
-
131
- @content = content
132
- end
133
-
134
- # Custom attribute writer method with validation
135
- # @param [Object] content_type Value to be assigned
136
- def content_type=(content_type)
137
- if content_type.nil?
138
- fail ArgumentError, 'content_type cannot be nil'
139
- end
140
-
141
- @content_type = content_type
142
- end
143
-
144
- # Custom attribute writer method with validation
145
- # @param [Object] filename Value to be assigned
146
- def filename=(filename)
147
- if filename.nil?
148
- fail ArgumentError, 'filename cannot be nil'
149
- end
150
-
151
- @filename = filename
152
- end
153
-
154
- # Checks equality by comparing each attribute.
155
- # @param [Object] Object to be compared
156
- def ==(o)
157
- return true if self.equal?(o)
158
- self.class == o.class &&
159
- content == o.content &&
160
- content_type == o.content_type &&
161
- filename == o.filename
162
- end
163
-
164
- # @see the `==` method
165
- # @param [Object] Object to be compared
166
- def eql?(o)
167
- self == o
168
- end
169
-
170
- # Calculates hash code according to all attributes.
171
- # @return [Integer] Hash code
172
- def hash
173
- [content, content_type, filename].hash
174
- end
175
-
176
- # Builds the object from hash
177
- # @param [Hash] attributes Model attributes in the form of hash
178
- # @return [Object] Returns the model itself
179
- def self.build_from_hash(attributes)
180
- return nil unless attributes.is_a?(Hash)
181
- attributes = attributes.transform_keys(&:to_sym)
182
- transformed_hash = {}
183
- openapi_types.each_pair do |key, type|
184
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
185
- transformed_hash["#{key}"] = nil
186
- elsif type =~ /\AArray<(.*)>/i
187
- # check to ensure the input is an array given that the attribute
188
- # is documented as an array but the input is not
189
- if attributes[attribute_map[key]].is_a?(Array)
190
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
191
- end
192
- elsif !attributes[attribute_map[key]].nil?
193
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
194
- end
195
- end
196
- new(transformed_hash)
197
- end
198
-
199
- # Returns the object in the form of hash
200
- # @return [Hash] Returns the object in the form of hash
201
- def to_hash
202
- hash = {}
203
- self.class.attribute_map.each_pair do |attr, param|
204
- value = self.send(attr)
205
- if value.nil?
206
- is_nullable = self.class.openapi_nullable.include?(attr)
207
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
- end
209
-
210
- hash[param] = _to_hash(value)
211
- end
212
- hash
213
- end
214
-
215
- end
216
-
217
- end