mailslurp_client 15.7.5 → 15.7.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mailslurp_client/api/inbox_controller_api.rb +60 -0
- data/lib/mailslurp_client/api/webhook_controller_api.rb +233 -3
- data/lib/mailslurp_client/models/abstract_webhook_payload.rb +2 -2
- data/lib/mailslurp_client/models/alias_projection.rb +15 -15
- data/lib/mailslurp_client/models/attachment_projection.rb +14 -14
- data/lib/mailslurp_client/models/bounce_recipient.rb +5 -0
- data/lib/mailslurp_client/models/create_webhook_options.rb +2 -2
- data/lib/mailslurp_client/models/email_projection.rb +10 -10
- data/lib/mailslurp_client/models/inbox_dto.rb +1 -1
- data/lib/mailslurp_client/models/page_alias.rb +19 -19
- data/lib/mailslurp_client/models/page_attachment_entity.rb +19 -19
- data/lib/mailslurp_client/models/page_bounced_email.rb +19 -19
- data/lib/mailslurp_client/models/page_bounced_recipients.rb +19 -19
- data/lib/mailslurp_client/models/page_contact_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_email_preview.rb +19 -19
- data/lib/mailslurp_client/models/page_email_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_email_validation_request.rb +19 -19
- data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_group_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +19 -19
- data/lib/mailslurp_client/models/page_inbox_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +19 -19
- data/lib/mailslurp_client/models/page_missed_email_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_template_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_thread_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_webhook_projection.rb +19 -19
- data/lib/mailslurp_client/models/page_webhook_result.rb +19 -19
- data/lib/mailslurp_client/models/sent_email_projection.rb +45 -45
- data/lib/mailslurp_client/models/template_projection.rb +15 -15
- data/lib/mailslurp_client/models/thread_projection.rb +15 -15
- data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -10
- data/lib/mailslurp_client/models/webhook_bounce_payload.rb +339 -0
- data/lib/mailslurp_client/models/webhook_bounce_recipient_payload.rb +302 -0
- data/lib/mailslurp_client/models/webhook_dto.rb +3 -8
- data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +2 -2
- data/lib/mailslurp_client/models/webhook_email_read_payload.rb +2 -2
- data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +2 -2
- data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +2 -2
- data/lib/mailslurp_client/models/webhook_new_email_payload.rb +2 -2
- data/lib/mailslurp_client/models/webhook_projection.rb +2 -7
- data/lib/mailslurp_client/models/webhook_result_dto.rb +2 -7
- data/lib/mailslurp_client/version.rb +1 -1
- data/lib/mailslurp_client.rb +2 -0
- metadata +4 -2
@@ -0,0 +1,339 @@
|
|
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://www.mailslurp.com/docs/) - [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
|
+
# EMAIL_READ webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is read. This happens when an email is requested in full from the API or a user views the email in the dashboard.
|
17
|
+
class WebhookBouncePayload
|
18
|
+
# Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
|
19
|
+
attr_accessor :message_id
|
20
|
+
|
21
|
+
# ID of webhook entity being triggered
|
22
|
+
attr_accessor :webhook_id
|
23
|
+
|
24
|
+
# Name of the event type webhook is being triggered for.
|
25
|
+
attr_accessor :event_name
|
26
|
+
|
27
|
+
# Name of the webhook being triggered
|
28
|
+
attr_accessor :webhook_name
|
29
|
+
|
30
|
+
# ID of the bounce email record. Use the ID with the bounce controller to view more information
|
31
|
+
attr_accessor :bounce_id
|
32
|
+
|
33
|
+
attr_accessor :sent_to_recipients
|
34
|
+
|
35
|
+
attr_accessor :sender
|
36
|
+
|
37
|
+
# Email addresses that resulted in a bounce or email being rejected. Please save these recipients and avoid emailing them in the future to maintain your reputation.
|
38
|
+
attr_accessor :bounce_recipients
|
39
|
+
|
40
|
+
class EnumAttributeValidator
|
41
|
+
attr_reader :datatype
|
42
|
+
attr_reader :allowable_values
|
43
|
+
|
44
|
+
def initialize(datatype, allowable_values)
|
45
|
+
@allowable_values = allowable_values.map do |value|
|
46
|
+
case datatype.to_s
|
47
|
+
when /Integer/i
|
48
|
+
value.to_i
|
49
|
+
when /Float/i
|
50
|
+
value.to_f
|
51
|
+
else
|
52
|
+
value
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def valid?(value)
|
58
|
+
!value || allowable_values.include?(value)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
63
|
+
def self.attribute_map
|
64
|
+
{
|
65
|
+
:'message_id' => :'messageId',
|
66
|
+
:'webhook_id' => :'webhookId',
|
67
|
+
:'event_name' => :'eventName',
|
68
|
+
:'webhook_name' => :'webhookName',
|
69
|
+
:'bounce_id' => :'bounceId',
|
70
|
+
:'sent_to_recipients' => :'sentToRecipients',
|
71
|
+
:'sender' => :'sender',
|
72
|
+
:'bounce_recipients' => :'bounceRecipients'
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
# Attribute type mapping.
|
77
|
+
def self.openapi_types
|
78
|
+
{
|
79
|
+
:'message_id' => :'String',
|
80
|
+
:'webhook_id' => :'String',
|
81
|
+
:'event_name' => :'String',
|
82
|
+
:'webhook_name' => :'String',
|
83
|
+
:'bounce_id' => :'String',
|
84
|
+
:'sent_to_recipients' => :'Array<String>',
|
85
|
+
:'sender' => :'String',
|
86
|
+
:'bounce_recipients' => :'Array<String>'
|
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 `MailSlurpClient::WebhookBouncePayload` initialize method"
|
101
|
+
end
|
102
|
+
|
103
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
104
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
105
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
106
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::WebhookBouncePayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
107
|
+
end
|
108
|
+
h[k.to_sym] = v
|
109
|
+
}
|
110
|
+
|
111
|
+
if attributes.key?(:'message_id')
|
112
|
+
self.message_id = attributes[:'message_id']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.key?(:'webhook_id')
|
116
|
+
self.webhook_id = attributes[:'webhook_id']
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.key?(:'event_name')
|
120
|
+
self.event_name = attributes[:'event_name']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.key?(:'webhook_name')
|
124
|
+
self.webhook_name = attributes[:'webhook_name']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.key?(:'bounce_id')
|
128
|
+
self.bounce_id = attributes[:'bounce_id']
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.key?(:'sent_to_recipients')
|
132
|
+
if (value = attributes[:'sent_to_recipients']).is_a?(Array)
|
133
|
+
self.sent_to_recipients = value
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.key?(:'sender')
|
138
|
+
self.sender = attributes[:'sender']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.key?(:'bounce_recipients')
|
142
|
+
if (value = attributes[:'bounce_recipients']).is_a?(Array)
|
143
|
+
self.bounce_recipients = value
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
149
|
+
# @return Array for valid properties with the reasons
|
150
|
+
def list_invalid_properties
|
151
|
+
invalid_properties = Array.new
|
152
|
+
if @message_id.nil?
|
153
|
+
invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
|
154
|
+
end
|
155
|
+
|
156
|
+
if @webhook_id.nil?
|
157
|
+
invalid_properties.push('invalid value for "webhook_id", webhook_id cannot be nil.')
|
158
|
+
end
|
159
|
+
|
160
|
+
if @event_name.nil?
|
161
|
+
invalid_properties.push('invalid value for "event_name", event_name cannot be nil.')
|
162
|
+
end
|
163
|
+
|
164
|
+
if @bounce_id.nil?
|
165
|
+
invalid_properties.push('invalid value for "bounce_id", bounce_id cannot be nil.')
|
166
|
+
end
|
167
|
+
|
168
|
+
if @sender.nil?
|
169
|
+
invalid_properties.push('invalid value for "sender", sender cannot be nil.')
|
170
|
+
end
|
171
|
+
|
172
|
+
invalid_properties
|
173
|
+
end
|
174
|
+
|
175
|
+
# Check to see if the all the properties in the model are valid
|
176
|
+
# @return true if the model is valid
|
177
|
+
def valid?
|
178
|
+
return false if @message_id.nil?
|
179
|
+
return false if @webhook_id.nil?
|
180
|
+
return false if @event_name.nil?
|
181
|
+
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
|
182
|
+
return false unless event_name_validator.valid?(@event_name)
|
183
|
+
return false if @bounce_id.nil?
|
184
|
+
return false if @sender.nil?
|
185
|
+
true
|
186
|
+
end
|
187
|
+
|
188
|
+
# Custom attribute writer method checking allowed values (enum).
|
189
|
+
# @param [Object] event_name Object to be assigned
|
190
|
+
def event_name=(event_name)
|
191
|
+
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
|
192
|
+
unless validator.valid?(event_name)
|
193
|
+
fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
|
194
|
+
end
|
195
|
+
@event_name = event_name
|
196
|
+
end
|
197
|
+
|
198
|
+
# Checks equality by comparing each attribute.
|
199
|
+
# @param [Object] Object to be compared
|
200
|
+
def ==(o)
|
201
|
+
return true if self.equal?(o)
|
202
|
+
self.class == o.class &&
|
203
|
+
message_id == o.message_id &&
|
204
|
+
webhook_id == o.webhook_id &&
|
205
|
+
event_name == o.event_name &&
|
206
|
+
webhook_name == o.webhook_name &&
|
207
|
+
bounce_id == o.bounce_id &&
|
208
|
+
sent_to_recipients == o.sent_to_recipients &&
|
209
|
+
sender == o.sender &&
|
210
|
+
bounce_recipients == o.bounce_recipients
|
211
|
+
end
|
212
|
+
|
213
|
+
# @see the `==` method
|
214
|
+
# @param [Object] Object to be compared
|
215
|
+
def eql?(o)
|
216
|
+
self == o
|
217
|
+
end
|
218
|
+
|
219
|
+
# Calculates hash code according to all attributes.
|
220
|
+
# @return [Integer] Hash code
|
221
|
+
def hash
|
222
|
+
[message_id, webhook_id, event_name, webhook_name, bounce_id, sent_to_recipients, sender, bounce_recipients].hash
|
223
|
+
end
|
224
|
+
|
225
|
+
# Builds the object from hash
|
226
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
227
|
+
# @return [Object] Returns the model itself
|
228
|
+
def self.build_from_hash(attributes)
|
229
|
+
new.build_from_hash(attributes)
|
230
|
+
end
|
231
|
+
|
232
|
+
# Builds the object from hash
|
233
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
234
|
+
# @return [Object] Returns the model itself
|
235
|
+
def build_from_hash(attributes)
|
236
|
+
return nil unless attributes.is_a?(Hash)
|
237
|
+
self.class.openapi_types.each_pair do |key, type|
|
238
|
+
if type =~ /\AArray<(.*)>/i
|
239
|
+
# check to ensure the input is an array given that the attribute
|
240
|
+
# is documented as an array but the input is not
|
241
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
242
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
243
|
+
end
|
244
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
245
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
246
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
247
|
+
end
|
248
|
+
|
249
|
+
self
|
250
|
+
end
|
251
|
+
|
252
|
+
# Deserializes the data based on type
|
253
|
+
# @param string type Data type
|
254
|
+
# @param string value Value to be deserialized
|
255
|
+
# @return [Object] Deserialized data
|
256
|
+
def _deserialize(type, value)
|
257
|
+
case type.to_sym
|
258
|
+
when :DateTime
|
259
|
+
DateTime.parse(value)
|
260
|
+
when :Date
|
261
|
+
Date.parse(value)
|
262
|
+
when :String
|
263
|
+
value.to_s
|
264
|
+
when :Integer
|
265
|
+
value.to_i
|
266
|
+
when :Float
|
267
|
+
value.to_f
|
268
|
+
when :Boolean
|
269
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
270
|
+
true
|
271
|
+
else
|
272
|
+
false
|
273
|
+
end
|
274
|
+
when :Object
|
275
|
+
# generic object (usually a Hash), return directly
|
276
|
+
value
|
277
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
278
|
+
inner_type = Regexp.last_match[:inner_type]
|
279
|
+
value.map { |v| _deserialize(inner_type, v) }
|
280
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
281
|
+
k_type = Regexp.last_match[:k_type]
|
282
|
+
v_type = Regexp.last_match[:v_type]
|
283
|
+
{}.tap do |hash|
|
284
|
+
value.each do |k, v|
|
285
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
286
|
+
end
|
287
|
+
end
|
288
|
+
else # model
|
289
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
# Returns the string representation of the object
|
294
|
+
# @return [String] String presentation of the object
|
295
|
+
def to_s
|
296
|
+
to_hash.to_s
|
297
|
+
end
|
298
|
+
|
299
|
+
# to_body is an alias to to_hash (backward compatibility)
|
300
|
+
# @return [Hash] Returns the object in the form of hash
|
301
|
+
def to_body
|
302
|
+
to_hash
|
303
|
+
end
|
304
|
+
|
305
|
+
# Returns the object in the form of hash
|
306
|
+
# @return [Hash] Returns the object in the form of hash
|
307
|
+
def to_hash
|
308
|
+
hash = {}
|
309
|
+
self.class.attribute_map.each_pair do |attr, param|
|
310
|
+
value = self.send(attr)
|
311
|
+
if value.nil?
|
312
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
313
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
314
|
+
end
|
315
|
+
|
316
|
+
hash[param] = _to_hash(value)
|
317
|
+
end
|
318
|
+
hash
|
319
|
+
end
|
320
|
+
|
321
|
+
# Outputs non-array value in the form of hash
|
322
|
+
# For object, use to_hash. Otherwise, just return the value
|
323
|
+
# @param [Object] value Any valid value
|
324
|
+
# @return [Hash] Returns the value in the form of hash
|
325
|
+
def _to_hash(value)
|
326
|
+
if value.is_a?(Array)
|
327
|
+
value.compact.map { |v| _to_hash(v) }
|
328
|
+
elsif value.is_a?(Hash)
|
329
|
+
{}.tap do |hash|
|
330
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
331
|
+
end
|
332
|
+
elsif value.respond_to? :to_hash
|
333
|
+
value.to_hash
|
334
|
+
else
|
335
|
+
value
|
336
|
+
end
|
337
|
+
end
|
338
|
+
end
|
339
|
+
end
|
@@ -0,0 +1,302 @@
|
|
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://www.mailslurp.com/docs/) - [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
|
+
# EMAIL_READ webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is read. This happens when an email is requested in full from the API or a user views the email in the dashboard.
|
17
|
+
class WebhookBounceRecipientPayload
|
18
|
+
# Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
|
19
|
+
attr_accessor :message_id
|
20
|
+
|
21
|
+
# ID of webhook entity being triggered
|
22
|
+
attr_accessor :webhook_id
|
23
|
+
|
24
|
+
# Name of the event type webhook is being triggered for.
|
25
|
+
attr_accessor :event_name
|
26
|
+
|
27
|
+
# Name of the webhook being triggered
|
28
|
+
attr_accessor :webhook_name
|
29
|
+
|
30
|
+
# Email address that caused a bounce. Make note of the address and try not to message it again to preserve your reputation.
|
31
|
+
attr_accessor :recipient
|
32
|
+
|
33
|
+
class EnumAttributeValidator
|
34
|
+
attr_reader :datatype
|
35
|
+
attr_reader :allowable_values
|
36
|
+
|
37
|
+
def initialize(datatype, allowable_values)
|
38
|
+
@allowable_values = allowable_values.map do |value|
|
39
|
+
case datatype.to_s
|
40
|
+
when /Integer/i
|
41
|
+
value.to_i
|
42
|
+
when /Float/i
|
43
|
+
value.to_f
|
44
|
+
else
|
45
|
+
value
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def valid?(value)
|
51
|
+
!value || allowable_values.include?(value)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
56
|
+
def self.attribute_map
|
57
|
+
{
|
58
|
+
:'message_id' => :'messageId',
|
59
|
+
:'webhook_id' => :'webhookId',
|
60
|
+
:'event_name' => :'eventName',
|
61
|
+
:'webhook_name' => :'webhookName',
|
62
|
+
:'recipient' => :'recipient'
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
# Attribute type mapping.
|
67
|
+
def self.openapi_types
|
68
|
+
{
|
69
|
+
:'message_id' => :'String',
|
70
|
+
:'webhook_id' => :'String',
|
71
|
+
:'event_name' => :'String',
|
72
|
+
:'webhook_name' => :'String',
|
73
|
+
:'recipient' => :'String'
|
74
|
+
}
|
75
|
+
end
|
76
|
+
|
77
|
+
# List of attributes with nullable: true
|
78
|
+
def self.openapi_nullable
|
79
|
+
Set.new([
|
80
|
+
])
|
81
|
+
end
|
82
|
+
|
83
|
+
# Initializes the object
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
85
|
+
def initialize(attributes = {})
|
86
|
+
if (!attributes.is_a?(Hash))
|
87
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::WebhookBounceRecipientPayload` initialize method"
|
88
|
+
end
|
89
|
+
|
90
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
91
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
92
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
93
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::WebhookBounceRecipientPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
94
|
+
end
|
95
|
+
h[k.to_sym] = v
|
96
|
+
}
|
97
|
+
|
98
|
+
if attributes.key?(:'message_id')
|
99
|
+
self.message_id = attributes[:'message_id']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'webhook_id')
|
103
|
+
self.webhook_id = attributes[:'webhook_id']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'event_name')
|
107
|
+
self.event_name = attributes[:'event_name']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'webhook_name')
|
111
|
+
self.webhook_name = attributes[:'webhook_name']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'recipient')
|
115
|
+
self.recipient = attributes[:'recipient']
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
120
|
+
# @return Array for valid properties with the reasons
|
121
|
+
def list_invalid_properties
|
122
|
+
invalid_properties = Array.new
|
123
|
+
if @message_id.nil?
|
124
|
+
invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
|
125
|
+
end
|
126
|
+
|
127
|
+
if @webhook_id.nil?
|
128
|
+
invalid_properties.push('invalid value for "webhook_id", webhook_id cannot be nil.')
|
129
|
+
end
|
130
|
+
|
131
|
+
if @event_name.nil?
|
132
|
+
invalid_properties.push('invalid value for "event_name", event_name cannot be nil.')
|
133
|
+
end
|
134
|
+
|
135
|
+
if @recipient.nil?
|
136
|
+
invalid_properties.push('invalid value for "recipient", recipient cannot be nil.')
|
137
|
+
end
|
138
|
+
|
139
|
+
invalid_properties
|
140
|
+
end
|
141
|
+
|
142
|
+
# Check to see if the all the properties in the model are valid
|
143
|
+
# @return true if the model is valid
|
144
|
+
def valid?
|
145
|
+
return false if @message_id.nil?
|
146
|
+
return false if @webhook_id.nil?
|
147
|
+
return false if @event_name.nil?
|
148
|
+
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
|
149
|
+
return false unless event_name_validator.valid?(@event_name)
|
150
|
+
return false if @recipient.nil?
|
151
|
+
true
|
152
|
+
end
|
153
|
+
|
154
|
+
# Custom attribute writer method checking allowed values (enum).
|
155
|
+
# @param [Object] event_name Object to be assigned
|
156
|
+
def event_name=(event_name)
|
157
|
+
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
|
158
|
+
unless validator.valid?(event_name)
|
159
|
+
fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
|
160
|
+
end
|
161
|
+
@event_name = event_name
|
162
|
+
end
|
163
|
+
|
164
|
+
# Checks equality by comparing each attribute.
|
165
|
+
# @param [Object] Object to be compared
|
166
|
+
def ==(o)
|
167
|
+
return true if self.equal?(o)
|
168
|
+
self.class == o.class &&
|
169
|
+
message_id == o.message_id &&
|
170
|
+
webhook_id == o.webhook_id &&
|
171
|
+
event_name == o.event_name &&
|
172
|
+
webhook_name == o.webhook_name &&
|
173
|
+
recipient == o.recipient
|
174
|
+
end
|
175
|
+
|
176
|
+
# @see the `==` method
|
177
|
+
# @param [Object] Object to be compared
|
178
|
+
def eql?(o)
|
179
|
+
self == o
|
180
|
+
end
|
181
|
+
|
182
|
+
# Calculates hash code according to all attributes.
|
183
|
+
# @return [Integer] Hash code
|
184
|
+
def hash
|
185
|
+
[message_id, webhook_id, event_name, webhook_name, recipient].hash
|
186
|
+
end
|
187
|
+
|
188
|
+
# Builds the object from hash
|
189
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
190
|
+
# @return [Object] Returns the model itself
|
191
|
+
def self.build_from_hash(attributes)
|
192
|
+
new.build_from_hash(attributes)
|
193
|
+
end
|
194
|
+
|
195
|
+
# Builds the object from hash
|
196
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
197
|
+
# @return [Object] Returns the model itself
|
198
|
+
def build_from_hash(attributes)
|
199
|
+
return nil unless attributes.is_a?(Hash)
|
200
|
+
self.class.openapi_types.each_pair do |key, type|
|
201
|
+
if type =~ /\AArray<(.*)>/i
|
202
|
+
# check to ensure the input is an array given that the attribute
|
203
|
+
# is documented as an array but the input is not
|
204
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
205
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
206
|
+
end
|
207
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
208
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
209
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
210
|
+
end
|
211
|
+
|
212
|
+
self
|
213
|
+
end
|
214
|
+
|
215
|
+
# Deserializes the data based on type
|
216
|
+
# @param string type Data type
|
217
|
+
# @param string value Value to be deserialized
|
218
|
+
# @return [Object] Deserialized data
|
219
|
+
def _deserialize(type, value)
|
220
|
+
case type.to_sym
|
221
|
+
when :DateTime
|
222
|
+
DateTime.parse(value)
|
223
|
+
when :Date
|
224
|
+
Date.parse(value)
|
225
|
+
when :String
|
226
|
+
value.to_s
|
227
|
+
when :Integer
|
228
|
+
value.to_i
|
229
|
+
when :Float
|
230
|
+
value.to_f
|
231
|
+
when :Boolean
|
232
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
233
|
+
true
|
234
|
+
else
|
235
|
+
false
|
236
|
+
end
|
237
|
+
when :Object
|
238
|
+
# generic object (usually a Hash), return directly
|
239
|
+
value
|
240
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
241
|
+
inner_type = Regexp.last_match[:inner_type]
|
242
|
+
value.map { |v| _deserialize(inner_type, v) }
|
243
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
244
|
+
k_type = Regexp.last_match[:k_type]
|
245
|
+
v_type = Regexp.last_match[:v_type]
|
246
|
+
{}.tap do |hash|
|
247
|
+
value.each do |k, v|
|
248
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
249
|
+
end
|
250
|
+
end
|
251
|
+
else # model
|
252
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
# Returns the string representation of the object
|
257
|
+
# @return [String] String presentation of the object
|
258
|
+
def to_s
|
259
|
+
to_hash.to_s
|
260
|
+
end
|
261
|
+
|
262
|
+
# to_body is an alias to to_hash (backward compatibility)
|
263
|
+
# @return [Hash] Returns the object in the form of hash
|
264
|
+
def to_body
|
265
|
+
to_hash
|
266
|
+
end
|
267
|
+
|
268
|
+
# Returns the object in the form of hash
|
269
|
+
# @return [Hash] Returns the object in the form of hash
|
270
|
+
def to_hash
|
271
|
+
hash = {}
|
272
|
+
self.class.attribute_map.each_pair do |attr, param|
|
273
|
+
value = self.send(attr)
|
274
|
+
if value.nil?
|
275
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
276
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
277
|
+
end
|
278
|
+
|
279
|
+
hash[param] = _to_hash(value)
|
280
|
+
end
|
281
|
+
hash
|
282
|
+
end
|
283
|
+
|
284
|
+
# Outputs non-array value in the form of hash
|
285
|
+
# For object, use to_hash. Otherwise, just return the value
|
286
|
+
# @param [Object] value Any valid value
|
287
|
+
# @return [Hash] Returns the value in the form of hash
|
288
|
+
def _to_hash(value)
|
289
|
+
if value.is_a?(Array)
|
290
|
+
value.compact.map { |v| _to_hash(v) }
|
291
|
+
elsif value.is_a?(Hash)
|
292
|
+
{}.tap do |hash|
|
293
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
294
|
+
end
|
295
|
+
elsif value.respond_to? :to_hash
|
296
|
+
value.to_hash
|
297
|
+
else
|
298
|
+
value
|
299
|
+
end
|
300
|
+
end
|
301
|
+
end
|
302
|
+
end
|
@@ -27,7 +27,7 @@ module MailSlurpClient
|
|
27
27
|
# Name of the webhook
|
28
28
|
attr_accessor :name
|
29
29
|
|
30
|
-
# The inbox that the Webhook will be triggered by
|
30
|
+
# The inbox that the Webhook will be triggered by. If null then webhook triggered at account level
|
31
31
|
attr_accessor :inbox_id
|
32
32
|
|
33
33
|
# URL of your server that the webhook will be sent to. The schema of the JSON that is sent is described by the payloadJsonSchema.
|
@@ -184,10 +184,6 @@ module MailSlurpClient
|
|
184
184
|
invalid_properties.push('invalid value for "basic_auth", basic_auth cannot be nil.')
|
185
185
|
end
|
186
186
|
|
187
|
-
if @inbox_id.nil?
|
188
|
-
invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
|
189
|
-
end
|
190
|
-
|
191
187
|
if @url.nil?
|
192
188
|
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
193
189
|
end
|
@@ -217,7 +213,6 @@ module MailSlurpClient
|
|
217
213
|
return false if @id.nil?
|
218
214
|
return false if @user_id.nil?
|
219
215
|
return false if @basic_auth.nil?
|
220
|
-
return false if @inbox_id.nil?
|
221
216
|
return false if @url.nil?
|
222
217
|
return false if @method.nil?
|
223
218
|
method_validator = EnumAttributeValidator.new('String', ["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "TRACE"])
|
@@ -225,7 +220,7 @@ module MailSlurpClient
|
|
225
220
|
return false if @payload_json_schema.nil?
|
226
221
|
return false if @created_at.nil?
|
227
222
|
return false if @updated_at.nil?
|
228
|
-
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ"])
|
223
|
+
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
|
229
224
|
return false unless event_name_validator.valid?(@event_name)
|
230
225
|
true
|
231
226
|
end
|
@@ -243,7 +238,7 @@ module MailSlurpClient
|
|
243
238
|
# Custom attribute writer method checking allowed values (enum).
|
244
239
|
# @param [Object] event_name Object to be assigned
|
245
240
|
def event_name=(event_name)
|
246
|
-
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ"])
|
241
|
+
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
|
247
242
|
unless validator.valid?(event_name)
|
248
243
|
fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
|
249
244
|
end
|