mailslurp_client 15.13.32 → 15.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/api_user_controller_api.rb +0 -4
  3. data/lib/mailslurp_client/api/bounce_controller_api.rb +76 -0
  4. data/lib/mailslurp_client/api/inbox_controller_api.rb +131 -5
  5. data/lib/mailslurp_client/api/inbox_forwarder_controller_api.rb +145 -0
  6. data/lib/mailslurp_client/api/missed_email_controller_api.rb +6 -6
  7. data/lib/mailslurp_client/models/alias_dto.rb +5 -0
  8. data/lib/mailslurp_client/models/alias_projection.rb +13 -13
  9. data/lib/mailslurp_client/models/attachment_entity.rb +0 -1
  10. data/lib/mailslurp_client/models/attachment_projection.rb +3 -0
  11. data/lib/mailslurp_client/models/bounce_projection.rb +3 -0
  12. data/lib/mailslurp_client/models/bounce_recipient_projection.rb +3 -0
  13. data/lib/mailslurp_client/models/bounced_email_dto.rb +12 -0
  14. data/lib/mailslurp_client/models/bounced_recipient_dto.rb +10 -0
  15. data/lib/mailslurp_client/models/contact_dto.rb +7 -0
  16. data/lib/mailslurp_client/models/contact_projection.rb +5 -0
  17. data/lib/mailslurp_client/models/create_alias_options.rb +2 -0
  18. data/lib/mailslurp_client/models/create_contact_options.rb +1 -0
  19. data/lib/mailslurp_client/models/create_group_options.rb +1 -0
  20. data/lib/mailslurp_client/models/create_inbox_dto.rb +1 -0
  21. data/lib/mailslurp_client/models/create_tracking_pixel_options.rb +2 -0
  22. data/lib/mailslurp_client/models/create_webhook_options.rb +2 -0
  23. data/lib/mailslurp_client/models/describe_mail_server_domain_result.rb +1 -0
  24. data/lib/mailslurp_client/models/domain_dto.rb +1 -0
  25. data/lib/mailslurp_client/models/domain_preview.rb +1 -0
  26. data/lib/mailslurp_client/models/email.rb +1 -0
  27. data/lib/mailslurp_client/models/email_preview.rb +1 -0
  28. data/lib/mailslurp_client/models/email_projection.rb +35 -27
  29. data/lib/mailslurp_client/models/{email_validation_request.rb → email_validation_request_dto.rb} +8 -3
  30. data/lib/mailslurp_client/models/email_verification_result.rb +1 -0
  31. data/lib/mailslurp_client/models/expiration_defaults.rb +3 -0
  32. data/lib/mailslurp_client/models/export_options.rb +5 -0
  33. data/lib/mailslurp_client/models/forward_email_options.rb +20 -4
  34. data/lib/mailslurp_client/models/group_dto.rb +1 -0
  35. data/lib/mailslurp_client/models/group_projection.rb +1 -0
  36. data/lib/mailslurp_client/models/inbox_by_email_address_result.rb +1 -0
  37. data/lib/mailslurp_client/models/inbox_by_name_result.rb +1 -0
  38. data/lib/mailslurp_client/models/inbox_forwarder_event_projection.rb +316 -0
  39. data/lib/mailslurp_client/models/list_unsubscribe_recipient_projection.rb +250 -0
  40. data/lib/mailslurp_client/models/match_options.rb +2 -0
  41. data/lib/mailslurp_client/models/{missed_email.rb → missed_email_dto.rb} +16 -3
  42. data/lib/mailslurp_client/models/missed_email_projection.rb +3 -0
  43. data/lib/mailslurp_client/models/organization_inbox_projection.rb +1 -0
  44. data/lib/mailslurp_client/models/page_email_validation_request.rb +1 -1
  45. data/lib/mailslurp_client/models/page_inbox_forwarder_events.rb +308 -0
  46. data/lib/mailslurp_client/models/page_list_unsubscribe_recipients.rb +308 -0
  47. data/lib/mailslurp_client/models/phone_number_projection.rb +19 -19
  48. data/lib/mailslurp_client/models/recipient.rb +1 -0
  49. data/lib/mailslurp_client/models/reply_to_alias_email_options.rb +6 -0
  50. data/lib/mailslurp_client/models/reply_to_email_options.rb +8 -0
  51. data/lib/mailslurp_client/models/scheduled_job.rb +2 -2
  52. data/lib/mailslurp_client/models/scheduled_job_dto.rb +371 -0
  53. data/lib/mailslurp_client/models/send_email_options.rb +20 -0
  54. data/lib/mailslurp_client/models/sent_email_dto.rb +22 -0
  55. data/lib/mailslurp_client/models/sent_email_projection.rb +48 -48
  56. data/lib/mailslurp_client/models/simple_send_email_options.rb +3 -0
  57. data/lib/mailslurp_client/models/sms_projection.rb +15 -15
  58. data/lib/mailslurp_client/models/template_projection.rb +20 -20
  59. data/lib/mailslurp_client/models/thread_projection.rb +26 -26
  60. data/lib/mailslurp_client/models/tracking_pixel_dto.rb +4 -0
  61. data/lib/mailslurp_client/models/unknown_missed_email_projection.rb +13 -13
  62. data/lib/mailslurp_client/models/update_alias_options.rb +1 -0
  63. data/lib/mailslurp_client/models/update_domain_options.rb +1 -0
  64. data/lib/mailslurp_client/models/verify_email_address_options.rb +3 -0
  65. data/lib/mailslurp_client/models/wait_for_conditions.rb +8 -0
  66. data/lib/mailslurp_client/models/wait_for_sms_conditions.rb +8 -0
  67. data/lib/mailslurp_client/models/webhook_bounce_payload.rb +3 -0
  68. data/lib/mailslurp_client/models/webhook_bounce_recipient_payload.rb +1 -0
  69. data/lib/mailslurp_client/models/webhook_delivery_status_payload.rb +1 -0
  70. data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +1 -0
  71. data/lib/mailslurp_client/models/webhook_email_read_payload.rb +1 -0
  72. data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +1 -0
  73. data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +2 -0
  74. data/lib/mailslurp_client/models/webhook_new_email_payload.rb +3 -0
  75. data/lib/mailslurp_client/models/webhook_projection.rb +13 -13
  76. data/lib/mailslurp_client/models/webhook_redrive_result.rb +1 -0
  77. data/lib/mailslurp_client/models/webhook_result_dto.rb +6 -0
  78. data/lib/mailslurp_client/models/webhook_test_request.rb +1 -0
  79. data/lib/mailslurp_client/models/webhook_test_response.rb +2 -0
  80. data/lib/mailslurp_client/models/webhook_test_result.rb +1 -0
  81. data/lib/mailslurp_client/version.rb +1 -1
  82. data/lib/mailslurp_client.rb +7 -2
  83. metadata +9 -4
@@ -19,11 +19,11 @@ module MailSlurpClient
19
19
 
20
20
  attr_accessor :user_id
21
21
 
22
- attr_accessor :phone_country
22
+ attr_accessor :created_at
23
23
 
24
24
  attr_accessor :phone_number
25
25
 
26
- attr_accessor :created_at
26
+ attr_accessor :phone_country
27
27
 
28
28
  class EnumAttributeValidator
29
29
  attr_reader :datatype
@@ -52,9 +52,9 @@ module MailSlurpClient
52
52
  {
53
53
  :'id' => :'id',
54
54
  :'user_id' => :'userId',
55
- :'phone_country' => :'phoneCountry',
55
+ :'created_at' => :'createdAt',
56
56
  :'phone_number' => :'phoneNumber',
57
- :'created_at' => :'createdAt'
57
+ :'phone_country' => :'phoneCountry'
58
58
  }
59
59
  end
60
60
 
@@ -63,9 +63,9 @@ module MailSlurpClient
63
63
  {
64
64
  :'id' => :'String',
65
65
  :'user_id' => :'String',
66
- :'phone_country' => :'String',
66
+ :'created_at' => :'DateTime',
67
67
  :'phone_number' => :'String',
68
- :'created_at' => :'DateTime'
68
+ :'phone_country' => :'String'
69
69
  }
70
70
  end
71
71
 
@@ -98,16 +98,16 @@ module MailSlurpClient
98
98
  self.user_id = attributes[:'user_id']
99
99
  end
100
100
 
101
- if attributes.key?(:'phone_country')
102
- self.phone_country = attributes[:'phone_country']
101
+ if attributes.key?(:'created_at')
102
+ self.created_at = attributes[:'created_at']
103
103
  end
104
104
 
105
105
  if attributes.key?(:'phone_number')
106
106
  self.phone_number = attributes[:'phone_number']
107
107
  end
108
108
 
109
- if attributes.key?(:'created_at')
110
- self.created_at = attributes[:'created_at']
109
+ if attributes.key?(:'phone_country')
110
+ self.phone_country = attributes[:'phone_country']
111
111
  end
112
112
  end
113
113
 
@@ -123,16 +123,16 @@ module MailSlurpClient
123
123
  invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
124
124
  end
125
125
 
126
- if @phone_country.nil?
127
- invalid_properties.push('invalid value for "phone_country", phone_country cannot be nil.')
126
+ if @created_at.nil?
127
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
128
128
  end
129
129
 
130
130
  if @phone_number.nil?
131
131
  invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
132
132
  end
133
133
 
134
- if @created_at.nil?
135
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
134
+ if @phone_country.nil?
135
+ invalid_properties.push('invalid value for "phone_country", phone_country cannot be nil.')
136
136
  end
137
137
 
138
138
  invalid_properties
@@ -143,11 +143,11 @@ module MailSlurpClient
143
143
  def valid?
144
144
  return false if @id.nil?
145
145
  return false if @user_id.nil?
146
+ return false if @created_at.nil?
147
+ return false if @phone_number.nil?
146
148
  return false if @phone_country.nil?
147
149
  phone_country_validator = EnumAttributeValidator.new('String', ["US", "GB"])
148
150
  return false unless phone_country_validator.valid?(@phone_country)
149
- return false if @phone_number.nil?
150
- return false if @created_at.nil?
151
151
  true
152
152
  end
153
153
 
@@ -168,9 +168,9 @@ module MailSlurpClient
168
168
  self.class == o.class &&
169
169
  id == o.id &&
170
170
  user_id == o.user_id &&
171
- phone_country == o.phone_country &&
171
+ created_at == o.created_at &&
172
172
  phone_number == o.phone_number &&
173
- created_at == o.created_at
173
+ phone_country == o.phone_country
174
174
  end
175
175
 
176
176
  # @see the `==` method
@@ -182,7 +182,7 @@ module MailSlurpClient
182
182
  # Calculates hash code according to all attributes.
183
183
  # @return [Integer] Hash code
184
184
  def hash
185
- [id, user_id, phone_country, phone_number, created_at].hash
185
+ [id, user_id, created_at, phone_number, phone_country].hash
186
186
  end
187
187
 
188
188
  # Builds the object from hash
@@ -42,6 +42,7 @@ module MailSlurpClient
42
42
  # List of attributes with nullable: true
43
43
  def self.openapi_nullable
44
44
  Set.new([
45
+ :'name'
45
46
  ])
46
47
  end
47
48
 
@@ -96,6 +96,12 @@ module MailSlurpClient
96
96
  # List of attributes with nullable: true
97
97
  def self.openapi_nullable
98
98
  Set.new([
99
+ :'charset',
100
+ :'attachments',
101
+ :'template_variables',
102
+ :'template',
103
+ :'send_strategy',
104
+ :'use_inbox_name',
99
105
  ])
100
106
  end
101
107
 
@@ -106,6 +106,14 @@ module MailSlurpClient
106
106
  # List of attributes with nullable: true
107
107
  def self.openapi_nullable
108
108
  Set.new([
109
+ :'from',
110
+ :'reply_to',
111
+ :'charset',
112
+ :'attachments',
113
+ :'template_variables',
114
+ :'template',
115
+ :'send_strategy',
116
+ :'use_inbox_name',
109
117
  ])
110
118
  end
111
119
 
@@ -207,7 +207,7 @@ module MailSlurpClient
207
207
  return false if @group_id.nil?
208
208
  return false if @trigger_id.nil?
209
209
  return false if @status.nil?
210
- status_validator = EnumAttributeValidator.new('String', ["SUBMITTED", "COMPLETED", "FAILED"])
210
+ status_validator = EnumAttributeValidator.new('String', ["SUBMITTED", "COMPLETED", "FAILED", "CANCELLED"])
211
211
  return false unless status_validator.valid?(@status)
212
212
  return false if @send_at_timestamp.nil?
213
213
  return false if @created_at.nil?
@@ -218,7 +218,7 @@ module MailSlurpClient
218
218
  # Custom attribute writer method checking allowed values (enum).
219
219
  # @param [Object] status Object to be assigned
220
220
  def status=(status)
221
- validator = EnumAttributeValidator.new('String', ["SUBMITTED", "COMPLETED", "FAILED"])
221
+ validator = EnumAttributeValidator.new('String', ["SUBMITTED", "COMPLETED", "FAILED", "CANCELLED"])
222
222
  unless validator.valid?(status)
223
223
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
224
224
  end
@@ -0,0 +1,371 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
5
+
6
+ The version of the OpenAPI document: 6.5.2
7
+ Contact: contact@mailslurp.dev
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module MailSlurpClient
16
+ class ScheduledJobDto
17
+ attr_accessor :id
18
+
19
+ attr_accessor :user_id
20
+
21
+ attr_accessor :inbox_id
22
+
23
+ attr_accessor :job_id
24
+
25
+ attr_accessor :group_id
26
+
27
+ attr_accessor :trigger_id
28
+
29
+ attr_accessor :status
30
+
31
+ attr_accessor :send_at_timestamp
32
+
33
+ attr_accessor :created_at
34
+
35
+ attr_accessor :updated_at
36
+
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'id' => :'id',
63
+ :'user_id' => :'userId',
64
+ :'inbox_id' => :'inboxId',
65
+ :'job_id' => :'jobId',
66
+ :'group_id' => :'groupId',
67
+ :'trigger_id' => :'triggerId',
68
+ :'status' => :'status',
69
+ :'send_at_timestamp' => :'sendAtTimestamp',
70
+ :'created_at' => :'createdAt',
71
+ :'updated_at' => :'updatedAt'
72
+ }
73
+ end
74
+
75
+ # Attribute type mapping.
76
+ def self.openapi_types
77
+ {
78
+ :'id' => :'String',
79
+ :'user_id' => :'String',
80
+ :'inbox_id' => :'String',
81
+ :'job_id' => :'String',
82
+ :'group_id' => :'String',
83
+ :'trigger_id' => :'String',
84
+ :'status' => :'String',
85
+ :'send_at_timestamp' => :'DateTime',
86
+ :'created_at' => :'DateTime',
87
+ :'updated_at' => :'DateTime'
88
+ }
89
+ end
90
+
91
+ # List of attributes with nullable: true
92
+ def self.openapi_nullable
93
+ Set.new([
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 `MailSlurpClient::ScheduledJobDto` initialize method"
102
+ end
103
+
104
+ # check to see if the attribute exists and convert string to symbol for hash key
105
+ attributes = attributes.each_with_object({}) { |(k, v), h|
106
+ if (!self.class.attribute_map.key?(k.to_sym))
107
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::ScheduledJobDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
108
+ end
109
+ h[k.to_sym] = v
110
+ }
111
+
112
+ if attributes.key?(:'id')
113
+ self.id = attributes[:'id']
114
+ end
115
+
116
+ if attributes.key?(:'user_id')
117
+ self.user_id = attributes[:'user_id']
118
+ end
119
+
120
+ if attributes.key?(:'inbox_id')
121
+ self.inbox_id = attributes[:'inbox_id']
122
+ end
123
+
124
+ if attributes.key?(:'job_id')
125
+ self.job_id = attributes[:'job_id']
126
+ end
127
+
128
+ if attributes.key?(:'group_id')
129
+ self.group_id = attributes[:'group_id']
130
+ end
131
+
132
+ if attributes.key?(:'trigger_id')
133
+ self.trigger_id = attributes[:'trigger_id']
134
+ end
135
+
136
+ if attributes.key?(:'status')
137
+ self.status = attributes[:'status']
138
+ end
139
+
140
+ if attributes.key?(:'send_at_timestamp')
141
+ self.send_at_timestamp = attributes[:'send_at_timestamp']
142
+ end
143
+
144
+ if attributes.key?(:'created_at')
145
+ self.created_at = attributes[:'created_at']
146
+ end
147
+
148
+ if attributes.key?(:'updated_at')
149
+ self.updated_at = attributes[:'updated_at']
150
+ end
151
+ end
152
+
153
+ # Show invalid properties with the reasons. Usually used together with valid?
154
+ # @return Array for valid properties with the reasons
155
+ def list_invalid_properties
156
+ invalid_properties = Array.new
157
+ if @id.nil?
158
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
159
+ end
160
+
161
+ if @user_id.nil?
162
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
163
+ end
164
+
165
+ if @inbox_id.nil?
166
+ invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
167
+ end
168
+
169
+ if @job_id.nil?
170
+ invalid_properties.push('invalid value for "job_id", job_id cannot be nil.')
171
+ end
172
+
173
+ if @group_id.nil?
174
+ invalid_properties.push('invalid value for "group_id", group_id cannot be nil.')
175
+ end
176
+
177
+ if @trigger_id.nil?
178
+ invalid_properties.push('invalid value for "trigger_id", trigger_id cannot be nil.')
179
+ end
180
+
181
+ if @status.nil?
182
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
183
+ end
184
+
185
+ if @send_at_timestamp.nil?
186
+ invalid_properties.push('invalid value for "send_at_timestamp", send_at_timestamp cannot be nil.')
187
+ end
188
+
189
+ if @created_at.nil?
190
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
191
+ end
192
+
193
+ if @updated_at.nil?
194
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
195
+ end
196
+
197
+ invalid_properties
198
+ end
199
+
200
+ # Check to see if the all the properties in the model are valid
201
+ # @return true if the model is valid
202
+ def valid?
203
+ return false if @id.nil?
204
+ return false if @user_id.nil?
205
+ return false if @inbox_id.nil?
206
+ return false if @job_id.nil?
207
+ return false if @group_id.nil?
208
+ return false if @trigger_id.nil?
209
+ return false if @status.nil?
210
+ status_validator = EnumAttributeValidator.new('String', ["SUBMITTED", "COMPLETED", "FAILED", "CANCELLED"])
211
+ return false unless status_validator.valid?(@status)
212
+ return false if @send_at_timestamp.nil?
213
+ return false if @created_at.nil?
214
+ return false if @updated_at.nil?
215
+ true
216
+ end
217
+
218
+ # Custom attribute writer method checking allowed values (enum).
219
+ # @param [Object] status Object to be assigned
220
+ def status=(status)
221
+ validator = EnumAttributeValidator.new('String', ["SUBMITTED", "COMPLETED", "FAILED", "CANCELLED"])
222
+ unless validator.valid?(status)
223
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
224
+ end
225
+ @status = status
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
+ id == o.id &&
234
+ user_id == o.user_id &&
235
+ inbox_id == o.inbox_id &&
236
+ job_id == o.job_id &&
237
+ group_id == o.group_id &&
238
+ trigger_id == o.trigger_id &&
239
+ status == o.status &&
240
+ send_at_timestamp == o.send_at_timestamp &&
241
+ created_at == o.created_at &&
242
+ updated_at == o.updated_at
243
+ end
244
+
245
+ # @see the `==` method
246
+ # @param [Object] Object to be compared
247
+ def eql?(o)
248
+ self == o
249
+ end
250
+
251
+ # Calculates hash code according to all attributes.
252
+ # @return [Integer] Hash code
253
+ def hash
254
+ [id, user_id, inbox_id, job_id, group_id, trigger_id, status, send_at_timestamp, created_at, updated_at].hash
255
+ end
256
+
257
+ # Builds the object from hash
258
+ # @param [Hash] attributes Model attributes in the form of hash
259
+ # @return [Object] Returns the model itself
260
+ def self.build_from_hash(attributes)
261
+ new.build_from_hash(attributes)
262
+ end
263
+
264
+ # Builds the object from hash
265
+ # @param [Hash] attributes Model attributes in the form of hash
266
+ # @return [Object] Returns the model itself
267
+ def build_from_hash(attributes)
268
+ return nil unless attributes.is_a?(Hash)
269
+ self.class.openapi_types.each_pair do |key, type|
270
+ if type =~ /\AArray<(.*)>/i
271
+ # check to ensure the input is an array given that the attribute
272
+ # is documented as an array but the input is not
273
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
274
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
275
+ end
276
+ elsif !attributes[self.class.attribute_map[key]].nil?
277
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
278
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
279
+ end
280
+
281
+ self
282
+ end
283
+
284
+ # Deserializes the data based on type
285
+ # @param string type Data type
286
+ # @param string value Value to be deserialized
287
+ # @return [Object] Deserialized data
288
+ def _deserialize(type, value)
289
+ case type.to_sym
290
+ when :DateTime
291
+ DateTime.parse(value)
292
+ when :Date
293
+ Date.parse(value)
294
+ when :String
295
+ value.to_s
296
+ when :Integer
297
+ value.to_i
298
+ when :Float
299
+ value.to_f
300
+ when :Boolean
301
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
302
+ true
303
+ else
304
+ false
305
+ end
306
+ when :Object
307
+ # generic object (usually a Hash), return directly
308
+ value
309
+ when /\AArray<(?<inner_type>.+)>\z/
310
+ inner_type = Regexp.last_match[:inner_type]
311
+ value.map { |v| _deserialize(inner_type, v) }
312
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
313
+ k_type = Regexp.last_match[:k_type]
314
+ v_type = Regexp.last_match[:v_type]
315
+ {}.tap do |hash|
316
+ value.each do |k, v|
317
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
318
+ end
319
+ end
320
+ else # model
321
+ MailSlurpClient.const_get(type).build_from_hash(value)
322
+ end
323
+ end
324
+
325
+ # Returns the string representation of the object
326
+ # @return [String] String presentation of the object
327
+ def to_s
328
+ to_hash.to_s
329
+ end
330
+
331
+ # to_body is an alias to to_hash (backward compatibility)
332
+ # @return [Hash] Returns the object in the form of hash
333
+ def to_body
334
+ to_hash
335
+ end
336
+
337
+ # Returns the object in the form of hash
338
+ # @return [Hash] Returns the object in the form of hash
339
+ def to_hash
340
+ hash = {}
341
+ self.class.attribute_map.each_pair do |attr, param|
342
+ value = self.send(attr)
343
+ if value.nil?
344
+ is_nullable = self.class.openapi_nullable.include?(attr)
345
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
346
+ end
347
+
348
+ hash[param] = _to_hash(value)
349
+ end
350
+ hash
351
+ end
352
+
353
+ # Outputs non-array value in the form of hash
354
+ # For object, use to_hash. Otherwise, just return the value
355
+ # @param [Object] value Any valid value
356
+ # @return [Hash] Returns the value in the form of hash
357
+ def _to_hash(value)
358
+ if value.is_a?(Array)
359
+ value.compact.map { |v| _to_hash(v) }
360
+ elsif value.is_a?(Hash)
361
+ {}.tap do |hash|
362
+ value.each { |k, v| hash[k] = _to_hash(v) }
363
+ end
364
+ elsif value.respond_to? :to_hash
365
+ value.to_hash
366
+ else
367
+ value
368
+ end
369
+ end
370
+ end
371
+ end
@@ -152,6 +152,26 @@ module MailSlurpClient
152
152
  # List of attributes with nullable: true
153
153
  def self.openapi_nullable
154
154
  Set.new([
155
+ :'to_contacts',
156
+ :'to_group',
157
+ :'to',
158
+ :'from',
159
+ :'cc',
160
+ :'bcc',
161
+ :'subject',
162
+ :'reply_to',
163
+ :'body',
164
+ :'html',
165
+ :'is_html',
166
+ :'charset',
167
+ :'attachments',
168
+ :'template_variables',
169
+ :'template',
170
+ :'send_strategy',
171
+ :'use_inbox_name',
172
+ :'add_tracking_pixel',
173
+ :'filter_bounced_recipients',
174
+ :'validate_email_addresses'
155
175
  ])
156
176
  end
157
177
 
@@ -30,6 +30,7 @@ module MailSlurpClient
30
30
  # Recipients email was sent to
31
31
  attr_accessor :to
32
32
 
33
+ # Sent from address
33
34
  attr_accessor :from
34
35
 
35
36
  attr_accessor :reply_to
@@ -46,6 +47,7 @@ module MailSlurpClient
46
47
  # MD5 Hash
47
48
  attr_accessor :body_md5_hash
48
49
 
50
+ # Sent email body
49
51
  attr_accessor :body
50
52
 
51
53
  attr_accessor :to_contacts
@@ -137,6 +139,26 @@ module MailSlurpClient
137
139
  # List of attributes with nullable: true
138
140
  def self.openapi_nullable
139
141
  Set.new([
142
+ :'domain_id',
143
+ :'to',
144
+ :'from',
145
+ :'reply_to',
146
+ :'cc',
147
+ :'bcc',
148
+ :'attachments',
149
+ :'subject',
150
+ :'body_md5_hash',
151
+ :'body',
152
+ :'to_contacts',
153
+ :'to_group',
154
+ :'charset',
155
+ :'is_html',
156
+ :'pixel_ids',
157
+ :'message_id',
158
+ :'message_ids',
159
+ :'virtual_send',
160
+ :'template_id',
161
+ :'template_variables',
140
162
  ])
141
163
  end
142
164