mailslurp_client 15.8.1 → 15.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/attachment_controller_api.rb +4 -4
  3. data/lib/mailslurp_client/api/email_controller_api.rb +68 -3
  4. data/lib/mailslurp_client/api/form_controller_api.rb +2 -2
  5. data/lib/mailslurp_client/api/inbox_controller_api.rb +75 -0
  6. data/lib/mailslurp_client/api/missed_email_controller_api.rb +56 -0
  7. data/lib/mailslurp_client/api/phone_controller_api.rb +487 -0
  8. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +73 -0
  9. data/lib/mailslurp_client/api/sms_controller_api.rb +286 -0
  10. data/lib/mailslurp_client/api/wait_for_controller_api.rb +64 -0
  11. data/lib/mailslurp_client/api/webhook_controller_api.rb +2 -2
  12. data/lib/mailslurp_client/configuration.rb +2 -2
  13. data/lib/mailslurp_client/models/abstract_webhook_payload.rb +2 -2
  14. data/lib/mailslurp_client/models/alias_projection.rb +31 -31
  15. data/lib/mailslurp_client/models/attachment_entity.rb +10 -1
  16. data/lib/mailslurp_client/models/attachment_projection.rb +14 -14
  17. data/lib/mailslurp_client/models/contact_projection.rb +18 -13
  18. data/lib/mailslurp_client/models/create_emergency_address_options.rb +324 -0
  19. data/lib/mailslurp_client/models/create_webhook_options.rb +3 -3
  20. data/lib/mailslurp_client/models/email_html_dto.rb +215 -0
  21. data/lib/mailslurp_client/models/email_preview.rb +5 -0
  22. data/lib/mailslurp_client/models/email_projection.rb +20 -10
  23. data/lib/mailslurp_client/models/emergency_address.rb +408 -0
  24. data/lib/mailslurp_client/models/emergency_address_dto.rb +273 -0
  25. data/lib/mailslurp_client/models/empty_response_dto.rb +206 -0
  26. data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +15 -15
  27. data/lib/mailslurp_client/models/inbox_preview.rb +5 -0
  28. data/lib/mailslurp_client/models/missed_email.rb +37 -1
  29. data/lib/mailslurp_client/models/organization_inbox_projection.rb +5 -0
  30. data/lib/mailslurp_client/models/page_alias.rb +19 -19
  31. data/lib/mailslurp_client/models/page_attachment_entity.rb +19 -19
  32. data/lib/mailslurp_client/models/page_bounced_email.rb +19 -19
  33. data/lib/mailslurp_client/models/page_bounced_recipients.rb +19 -19
  34. data/lib/mailslurp_client/models/page_contact_projection.rb +19 -19
  35. data/lib/mailslurp_client/models/page_email_preview.rb +19 -19
  36. data/lib/mailslurp_client/models/page_email_projection.rb +19 -19
  37. data/lib/mailslurp_client/models/page_email_validation_request.rb +19 -19
  38. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +19 -19
  39. data/lib/mailslurp_client/models/page_group_projection.rb +19 -19
  40. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +19 -19
  41. data/lib/mailslurp_client/models/page_inbox_projection.rb +19 -19
  42. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +19 -19
  43. data/lib/mailslurp_client/models/page_missed_email_projection.rb +19 -19
  44. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +19 -19
  45. data/lib/mailslurp_client/models/page_phone_number_projection.rb +308 -0
  46. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +344 -0
  47. data/lib/mailslurp_client/models/page_sms_projection.rb +308 -0
  48. data/lib/mailslurp_client/models/page_template_projection.rb +19 -19
  49. data/lib/mailslurp_client/models/page_thread_projection.rb +19 -19
  50. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +19 -19
  51. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +19 -19
  52. data/lib/mailslurp_client/models/page_webhook_projection.rb +19 -19
  53. data/lib/mailslurp_client/models/page_webhook_result.rb +19 -19
  54. data/lib/mailslurp_client/models/phone_number_dto.rb +347 -0
  55. data/lib/mailslurp_client/models/phone_number_projection.rb +302 -0
  56. data/lib/mailslurp_client/models/phone_plan_dto.rb +287 -0
  57. data/lib/mailslurp_client/models/send_with_queue_result.rb +318 -0
  58. data/lib/mailslurp_client/models/sent_email_projection.rb +32 -27
  59. data/lib/mailslurp_client/models/sms_match_option.rb +289 -0
  60. data/lib/mailslurp_client/models/sms_message.rb +318 -0
  61. data/lib/mailslurp_client/models/sms_preview.rb +267 -0
  62. data/lib/mailslurp_client/models/sms_projection.rb +282 -0
  63. data/lib/mailslurp_client/models/template_projection.rb +18 -18
  64. data/lib/mailslurp_client/models/thread_projection.rb +36 -36
  65. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -10
  66. data/lib/mailslurp_client/models/wait_for_sms_conditions.rb +371 -0
  67. data/lib/mailslurp_client/models/webhook_bounce_payload.rb +2 -2
  68. data/lib/mailslurp_client/models/webhook_bounce_recipient_payload.rb +2 -2
  69. data/lib/mailslurp_client/models/webhook_dto.rb +3 -3
  70. data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +2 -2
  71. data/lib/mailslurp_client/models/webhook_email_read_payload.rb +2 -2
  72. data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +2 -2
  73. data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +7 -2
  74. data/lib/mailslurp_client/models/webhook_new_email_payload.rb +2 -2
  75. data/lib/mailslurp_client/models/webhook_projection.rb +2 -2
  76. data/lib/mailslurp_client/models/webhook_result_dto.rb +7 -2
  77. data/lib/mailslurp_client/version.rb +1 -1
  78. data/lib/mailslurp_client.rb +19 -0
  79. metadata +21 -2
@@ -20,6 +20,9 @@ module MailSlurpClient
20
20
  # Content length of attachment in bytes
21
21
  attr_accessor :content_length
22
22
 
23
+ # Content type of attachment.
24
+ attr_accessor :content_type
25
+
23
26
  attr_accessor :user_id
24
27
 
25
28
  # Attachment ID
@@ -29,19 +32,16 @@ module MailSlurpClient
29
32
 
30
33
  attr_accessor :updated_at
31
34
 
32
- # Content type of attachment.
33
- attr_accessor :content_type
34
-
35
35
  # Attribute mapping from ruby-style variable name to JSON key.
36
36
  def self.attribute_map
37
37
  {
38
38
  :'name' => :'name',
39
39
  :'content_length' => :'contentLength',
40
+ :'content_type' => :'contentType',
40
41
  :'user_id' => :'userId',
41
42
  :'attachment_id' => :'attachmentId',
42
43
  :'created_at' => :'createdAt',
43
- :'updated_at' => :'updatedAt',
44
- :'content_type' => :'contentType'
44
+ :'updated_at' => :'updatedAt'
45
45
  }
46
46
  end
47
47
 
@@ -50,11 +50,11 @@ module MailSlurpClient
50
50
  {
51
51
  :'name' => :'String',
52
52
  :'content_length' => :'Integer',
53
+ :'content_type' => :'String',
53
54
  :'user_id' => :'String',
54
55
  :'attachment_id' => :'String',
55
56
  :'created_at' => :'DateTime',
56
- :'updated_at' => :'DateTime',
57
- :'content_type' => :'String'
57
+ :'updated_at' => :'DateTime'
58
58
  }
59
59
  end
60
60
 
@@ -87,6 +87,10 @@ module MailSlurpClient
87
87
  self.content_length = attributes[:'content_length']
88
88
  end
89
89
 
90
+ if attributes.key?(:'content_type')
91
+ self.content_type = attributes[:'content_type']
92
+ end
93
+
90
94
  if attributes.key?(:'user_id')
91
95
  self.user_id = attributes[:'user_id']
92
96
  end
@@ -102,10 +106,6 @@ module MailSlurpClient
102
106
  if attributes.key?(:'updated_at')
103
107
  self.updated_at = attributes[:'updated_at']
104
108
  end
105
-
106
- if attributes.key?(:'content_type')
107
- self.content_type = attributes[:'content_type']
108
- end
109
109
  end
110
110
 
111
111
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -148,11 +148,11 @@ module MailSlurpClient
148
148
  self.class == o.class &&
149
149
  name == o.name &&
150
150
  content_length == o.content_length &&
151
+ content_type == o.content_type &&
151
152
  user_id == o.user_id &&
152
153
  attachment_id == o.attachment_id &&
153
154
  created_at == o.created_at &&
154
- updated_at == o.updated_at &&
155
- content_type == o.content_type
155
+ updated_at == o.updated_at
156
156
  end
157
157
 
158
158
  # @see the `==` method
@@ -164,7 +164,7 @@ module MailSlurpClient
164
164
  # Calculates hash code according to all attributes.
165
165
  # @return [Integer] Hash code
166
166
  def hash
167
- [name, content_length, user_id, attachment_id, created_at, updated_at, content_type].hash
167
+ [name, content_length, content_type, user_id, attachment_id, created_at, updated_at].hash
168
168
  end
169
169
 
170
170
  # Builds the object from hash
@@ -19,6 +19,8 @@ module MailSlurpClient
19
19
 
20
20
  attr_accessor :group_id
21
21
 
22
+ attr_accessor :created_at
23
+
22
24
  attr_accessor :first_name
23
25
 
24
26
  attr_accessor :last_name
@@ -29,19 +31,17 @@ module MailSlurpClient
29
31
 
30
32
  attr_accessor :opt_out
31
33
 
32
- attr_accessor :created_at
33
-
34
34
  # Attribute mapping from ruby-style variable name to JSON key.
35
35
  def self.attribute_map
36
36
  {
37
37
  :'id' => :'id',
38
38
  :'group_id' => :'groupId',
39
+ :'created_at' => :'createdAt',
39
40
  :'first_name' => :'firstName',
40
41
  :'last_name' => :'lastName',
41
42
  :'company' => :'company',
42
43
  :'email_addresses' => :'emailAddresses',
43
- :'opt_out' => :'optOut',
44
- :'created_at' => :'createdAt'
44
+ :'opt_out' => :'optOut'
45
45
  }
46
46
  end
47
47
 
@@ -50,12 +50,12 @@ module MailSlurpClient
50
50
  {
51
51
  :'id' => :'String',
52
52
  :'group_id' => :'String',
53
+ :'created_at' => :'DateTime',
53
54
  :'first_name' => :'String',
54
55
  :'last_name' => :'String',
55
56
  :'company' => :'String',
56
57
  :'email_addresses' => :'Array<String>',
57
- :'opt_out' => :'Boolean',
58
- :'created_at' => :'DateTime'
58
+ :'opt_out' => :'Boolean'
59
59
  }
60
60
  end
61
61
 
@@ -88,6 +88,10 @@ module MailSlurpClient
88
88
  self.group_id = attributes[:'group_id']
89
89
  end
90
90
 
91
+ if attributes.key?(:'created_at')
92
+ self.created_at = attributes[:'created_at']
93
+ end
94
+
91
95
  if attributes.key?(:'first_name')
92
96
  self.first_name = attributes[:'first_name']
93
97
  end
@@ -109,10 +113,6 @@ module MailSlurpClient
109
113
  if attributes.key?(:'opt_out')
110
114
  self.opt_out = attributes[:'opt_out']
111
115
  end
112
-
113
- if attributes.key?(:'created_at')
114
- self.created_at = attributes[:'created_at']
115
- end
116
116
  end
117
117
 
118
118
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -127,6 +127,10 @@ module MailSlurpClient
127
127
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
128
128
  end
129
129
 
130
+ if @opt_out.nil?
131
+ invalid_properties.push('invalid value for "opt_out", opt_out cannot be nil.')
132
+ end
133
+
130
134
  invalid_properties
131
135
  end
132
136
 
@@ -135,6 +139,7 @@ module MailSlurpClient
135
139
  def valid?
136
140
  return false if @id.nil?
137
141
  return false if @created_at.nil?
142
+ return false if @opt_out.nil?
138
143
  true
139
144
  end
140
145
 
@@ -145,12 +150,12 @@ module MailSlurpClient
145
150
  self.class == o.class &&
146
151
  id == o.id &&
147
152
  group_id == o.group_id &&
153
+ created_at == o.created_at &&
148
154
  first_name == o.first_name &&
149
155
  last_name == o.last_name &&
150
156
  company == o.company &&
151
157
  email_addresses == o.email_addresses &&
152
- opt_out == o.opt_out &&
153
- created_at == o.created_at
158
+ opt_out == o.opt_out
154
159
  end
155
160
 
156
161
  # @see the `==` method
@@ -162,7 +167,7 @@ module MailSlurpClient
162
167
  # Calculates hash code according to all attributes.
163
168
  # @return [Integer] Hash code
164
169
  def hash
165
- [id, group_id, first_name, last_name, company, email_addresses, opt_out, created_at].hash
170
+ [id, group_id, created_at, first_name, last_name, company, email_addresses, opt_out].hash
166
171
  end
167
172
 
168
173
  # Builds the object from hash
@@ -0,0 +1,324 @@
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 CreateEmergencyAddressOptions
17
+ attr_accessor :customer_name
18
+
19
+ attr_accessor :address1
20
+
21
+ attr_accessor :city
22
+
23
+ attr_accessor :region
24
+
25
+ attr_accessor :postal_code
26
+
27
+ attr_accessor :iso_country_code
28
+
29
+ attr_accessor :display_name
30
+
31
+ class EnumAttributeValidator
32
+ attr_reader :datatype
33
+ attr_reader :allowable_values
34
+
35
+ def initialize(datatype, allowable_values)
36
+ @allowable_values = allowable_values.map do |value|
37
+ case datatype.to_s
38
+ when /Integer/i
39
+ value.to_i
40
+ when /Float/i
41
+ value.to_f
42
+ else
43
+ value
44
+ end
45
+ end
46
+ end
47
+
48
+ def valid?(value)
49
+ !value || allowable_values.include?(value)
50
+ end
51
+ end
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'customer_name' => :'customerName',
57
+ :'address1' => :'address1',
58
+ :'city' => :'city',
59
+ :'region' => :'region',
60
+ :'postal_code' => :'postalCode',
61
+ :'iso_country_code' => :'isoCountryCode',
62
+ :'display_name' => :'displayName'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'customer_name' => :'String',
70
+ :'address1' => :'String',
71
+ :'city' => :'String',
72
+ :'region' => :'String',
73
+ :'postal_code' => :'String',
74
+ :'iso_country_code' => :'String',
75
+ :'display_name' => :'String'
76
+ }
77
+ end
78
+
79
+ # List of attributes with nullable: true
80
+ def self.openapi_nullable
81
+ Set.new([
82
+ ])
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ if (!attributes.is_a?(Hash))
89
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CreateEmergencyAddressOptions` initialize method"
90
+ end
91
+
92
+ # check to see if the attribute exists and convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!self.class.attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::CreateEmergencyAddressOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'customer_name')
101
+ self.customer_name = attributes[:'customer_name']
102
+ end
103
+
104
+ if attributes.key?(:'address1')
105
+ self.address1 = attributes[:'address1']
106
+ end
107
+
108
+ if attributes.key?(:'city')
109
+ self.city = attributes[:'city']
110
+ end
111
+
112
+ if attributes.key?(:'region')
113
+ self.region = attributes[:'region']
114
+ end
115
+
116
+ if attributes.key?(:'postal_code')
117
+ self.postal_code = attributes[:'postal_code']
118
+ end
119
+
120
+ if attributes.key?(:'iso_country_code')
121
+ self.iso_country_code = attributes[:'iso_country_code']
122
+ end
123
+
124
+ if attributes.key?(:'display_name')
125
+ self.display_name = attributes[:'display_name']
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ invalid_properties = Array.new
133
+ if @customer_name.nil?
134
+ invalid_properties.push('invalid value for "customer_name", customer_name cannot be nil.')
135
+ end
136
+
137
+ if @address1.nil?
138
+ invalid_properties.push('invalid value for "address1", address1 cannot be nil.')
139
+ end
140
+
141
+ if @city.nil?
142
+ invalid_properties.push('invalid value for "city", city cannot be nil.')
143
+ end
144
+
145
+ if @region.nil?
146
+ invalid_properties.push('invalid value for "region", region cannot be nil.')
147
+ end
148
+
149
+ if @postal_code.nil?
150
+ invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.')
151
+ end
152
+
153
+ if @iso_country_code.nil?
154
+ invalid_properties.push('invalid value for "iso_country_code", iso_country_code cannot be nil.')
155
+ end
156
+
157
+ invalid_properties
158
+ end
159
+
160
+ # Check to see if the all the properties in the model are valid
161
+ # @return true if the model is valid
162
+ def valid?
163
+ return false if @customer_name.nil?
164
+ return false if @address1.nil?
165
+ return false if @city.nil?
166
+ return false if @region.nil?
167
+ return false if @postal_code.nil?
168
+ return false if @iso_country_code.nil?
169
+ iso_country_code_validator = EnumAttributeValidator.new('String', ["US", "GB"])
170
+ return false unless iso_country_code_validator.valid?(@iso_country_code)
171
+ true
172
+ end
173
+
174
+ # Custom attribute writer method checking allowed values (enum).
175
+ # @param [Object] iso_country_code Object to be assigned
176
+ def iso_country_code=(iso_country_code)
177
+ validator = EnumAttributeValidator.new('String', ["US", "GB"])
178
+ unless validator.valid?(iso_country_code)
179
+ fail ArgumentError, "invalid value for \"iso_country_code\", must be one of #{validator.allowable_values}."
180
+ end
181
+ @iso_country_code = iso_country_code
182
+ end
183
+
184
+ # Checks equality by comparing each attribute.
185
+ # @param [Object] Object to be compared
186
+ def ==(o)
187
+ return true if self.equal?(o)
188
+ self.class == o.class &&
189
+ customer_name == o.customer_name &&
190
+ address1 == o.address1 &&
191
+ city == o.city &&
192
+ region == o.region &&
193
+ postal_code == o.postal_code &&
194
+ iso_country_code == o.iso_country_code &&
195
+ display_name == o.display_name
196
+ end
197
+
198
+ # @see the `==` method
199
+ # @param [Object] Object to be compared
200
+ def eql?(o)
201
+ self == o
202
+ end
203
+
204
+ # Calculates hash code according to all attributes.
205
+ # @return [Integer] Hash code
206
+ def hash
207
+ [customer_name, address1, city, region, postal_code, iso_country_code, display_name].hash
208
+ end
209
+
210
+ # Builds the object from hash
211
+ # @param [Hash] attributes Model attributes in the form of hash
212
+ # @return [Object] Returns the model itself
213
+ def self.build_from_hash(attributes)
214
+ new.build_from_hash(attributes)
215
+ end
216
+
217
+ # Builds the object from hash
218
+ # @param [Hash] attributes Model attributes in the form of hash
219
+ # @return [Object] Returns the model itself
220
+ def build_from_hash(attributes)
221
+ return nil unless attributes.is_a?(Hash)
222
+ self.class.openapi_types.each_pair do |key, type|
223
+ if type =~ /\AArray<(.*)>/i
224
+ # check to ensure the input is an array given that the attribute
225
+ # is documented as an array but the input is not
226
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
227
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
228
+ end
229
+ elsif !attributes[self.class.attribute_map[key]].nil?
230
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
231
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
232
+ end
233
+
234
+ self
235
+ end
236
+
237
+ # Deserializes the data based on type
238
+ # @param string type Data type
239
+ # @param string value Value to be deserialized
240
+ # @return [Object] Deserialized data
241
+ def _deserialize(type, value)
242
+ case type.to_sym
243
+ when :DateTime
244
+ DateTime.parse(value)
245
+ when :Date
246
+ Date.parse(value)
247
+ when :String
248
+ value.to_s
249
+ when :Integer
250
+ value.to_i
251
+ when :Float
252
+ value.to_f
253
+ when :Boolean
254
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
255
+ true
256
+ else
257
+ false
258
+ end
259
+ when :Object
260
+ # generic object (usually a Hash), return directly
261
+ value
262
+ when /\AArray<(?<inner_type>.+)>\z/
263
+ inner_type = Regexp.last_match[:inner_type]
264
+ value.map { |v| _deserialize(inner_type, v) }
265
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
266
+ k_type = Regexp.last_match[:k_type]
267
+ v_type = Regexp.last_match[:v_type]
268
+ {}.tap do |hash|
269
+ value.each do |k, v|
270
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
271
+ end
272
+ end
273
+ else # model
274
+ MailSlurpClient.const_get(type).build_from_hash(value)
275
+ end
276
+ end
277
+
278
+ # Returns the string representation of the object
279
+ # @return [String] String presentation of the object
280
+ def to_s
281
+ to_hash.to_s
282
+ end
283
+
284
+ # to_body is an alias to to_hash (backward compatibility)
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_body
287
+ to_hash
288
+ end
289
+
290
+ # Returns the object in the form of hash
291
+ # @return [Hash] Returns the object in the form of hash
292
+ def to_hash
293
+ hash = {}
294
+ self.class.attribute_map.each_pair do |attr, param|
295
+ value = self.send(attr)
296
+ if value.nil?
297
+ is_nullable = self.class.openapi_nullable.include?(attr)
298
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
299
+ end
300
+
301
+ hash[param] = _to_hash(value)
302
+ end
303
+ hash
304
+ end
305
+
306
+ # Outputs non-array value in the form of hash
307
+ # For object, use to_hash. Otherwise, just return the value
308
+ # @param [Object] value Any valid value
309
+ # @return [Hash] Returns the value in the form of hash
310
+ def _to_hash(value)
311
+ if value.is_a?(Array)
312
+ value.compact.map { |v| _to_hash(v) }
313
+ elsif value.is_a?(Hash)
314
+ {}.tap do |hash|
315
+ value.each { |k, v| hash[k] = _to_hash(v) }
316
+ end
317
+ elsif value.respond_to? :to_hash
318
+ value.to_hash
319
+ else
320
+ value
321
+ end
322
+ end
323
+ end
324
+ end
@@ -15,7 +15,7 @@ require 'date'
15
15
  module MailSlurpClient
16
16
  # Options for creating a webhook. Webhooks can be attached to inboxes and MailSlurp will POST a webhook payload to the URL specified whenever the inbox receives an email. Webhooks are great for processing many inbound emails.
17
17
  class CreateWebhookOptions
18
- # Public URL on your server that MailSlurp can post WebhookNotification payload to when an email is received or an event is trigger. The payload of the submitted JSON is dependent on the webhook event type. The default `EMAIL_RECEIVED` payload is described by `https://api.mailslurp.com/schemas/webhook-payload`. The other events, `NEW_EMAIL`, `NEW_CONTACT`, and `NEW_ATTACHMENT` are described by `https://api.mailslurp.com/schemas/webhook-new-email-payload`, `https://api.mailslurp.com/schemas/webhook-new-contact-payload`,`https://api.mailslurp.com/schemas/webhook-new-attachment-payload` respectively.
18
+ # Public URL on your server that MailSlurp can post WebhookNotification payload to when an email is received or an event is trigger. The payload of the submitted JSON is dependent on the webhook event type. The default `EMAIL_RECEIVED` payload is described by `https://ruby.api.mailslurp.com/schemas/webhook-payload`. The other events, `NEW_EMAIL`, `NEW_CONTACT`, and `NEW_ATTACHMENT` are described by `https://ruby.api.mailslurp.com/schemas/webhook-new-email-payload`, `https://ruby.api.mailslurp.com/schemas/webhook-new-contact-payload`,`https://ruby.api.mailslurp.com/schemas/webhook-new-attachment-payload` respectively.
19
19
  attr_accessor :url
20
20
 
21
21
  attr_accessor :basic_auth
@@ -121,7 +121,7 @@ module MailSlurpClient
121
121
  # @return true if the model is valid
122
122
  def valid?
123
123
  return false if @url.nil?
124
- event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
124
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
125
125
  return false unless event_name_validator.valid?(@event_name)
126
126
  true
127
127
  end
@@ -129,7 +129,7 @@ module MailSlurpClient
129
129
  # Custom attribute writer method checking allowed values (enum).
130
130
  # @param [Object] event_name Object to be assigned
131
131
  def event_name=(event_name)
132
- validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
132
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
133
133
  unless validator.valid?(event_name)
134
134
  fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
135
135
  end