mailslurp_client 15.13.9 → 15.13.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/api_user_controller_api.rb +23 -58
  3. data/lib/mailslurp_client/api/email_controller_api.rb +7 -10
  4. data/lib/mailslurp_client/api/inbox_controller_api.rb +2 -2
  5. data/lib/mailslurp_client/api/webhook_controller_api.rb +108 -0
  6. data/lib/mailslurp_client/models/alias_projection.rb +27 -27
  7. data/lib/mailslurp_client/models/attachment_projection.rb +14 -14
  8. data/lib/mailslurp_client/models/bounce_projection.rb +13 -13
  9. data/lib/mailslurp_client/models/bounce_recipient_projection.rb +13 -13
  10. data/lib/mailslurp_client/models/email_projection.rb +10 -10
  11. data/lib/mailslurp_client/models/page_alias.rb +22 -22
  12. data/lib/mailslurp_client/models/page_attachment_entity.rb +22 -22
  13. data/lib/mailslurp_client/models/page_bounced_email.rb +22 -22
  14. data/lib/mailslurp_client/models/page_bounced_recipients.rb +22 -22
  15. data/lib/mailslurp_client/models/page_complaint.rb +22 -22
  16. data/lib/mailslurp_client/models/page_contact_projection.rb +22 -22
  17. data/lib/mailslurp_client/models/page_delivery_status.rb +22 -22
  18. data/lib/mailslurp_client/models/page_email_preview.rb +22 -22
  19. data/lib/mailslurp_client/models/page_email_projection.rb +22 -22
  20. data/lib/mailslurp_client/models/page_email_validation_request.rb +22 -22
  21. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +22 -22
  22. data/lib/mailslurp_client/models/page_group_projection.rb +22 -22
  23. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +22 -22
  24. data/lib/mailslurp_client/models/page_inbox_projection.rb +22 -22
  25. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +22 -22
  26. data/lib/mailslurp_client/models/page_missed_email_projection.rb +22 -22
  27. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +22 -22
  28. data/lib/mailslurp_client/models/page_phone_number_projection.rb +22 -22
  29. data/lib/mailslurp_client/models/page_sent_email_projection.rb +16 -16
  30. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +16 -16
  31. data/lib/mailslurp_client/models/page_sms_projection.rb +22 -22
  32. data/lib/mailslurp_client/models/page_template_projection.rb +22 -22
  33. data/lib/mailslurp_client/models/page_thread_projection.rb +22 -22
  34. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +22 -22
  35. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +22 -22
  36. data/lib/mailslurp_client/models/page_webhook_projection.rb +22 -22
  37. data/lib/mailslurp_client/models/page_webhook_result.rb +22 -22
  38. data/lib/mailslurp_client/models/phone_number_projection.rb +19 -19
  39. data/lib/mailslurp_client/models/sent_email_projection.rb +15 -15
  40. data/lib/mailslurp_client/models/sort.rb +13 -13
  41. data/lib/mailslurp_client/models/template_projection.rb +15 -15
  42. data/lib/mailslurp_client/models/thread_projection.rb +16 -16
  43. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -10
  44. data/lib/mailslurp_client/models/webhook_delivery_status_payload.rb +429 -0
  45. data/lib/mailslurp_client/models/webhook_new_sms_payload.rb +393 -0
  46. data/lib/mailslurp_client/version.rb +1 -1
  47. data/lib/mailslurp_client.rb +2 -0
  48. metadata +4 -2
@@ -0,0 +1,393 @@
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
+ # NEW_SMS webhook payload. Sent to your webhook url endpoint via HTTP POST when an sms is received by the phone number that your webhook is attached to. Use the SMS ID to fetch the full SMS details.
17
+ class WebhookNewSmsPayload
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 SMS message
31
+ attr_accessor :sms_id
32
+
33
+ # User ID of event
34
+ attr_accessor :user_id
35
+
36
+ # ID of phone number receiving SMS
37
+ attr_accessor :phone_number
38
+
39
+ # Recipient phone number
40
+ attr_accessor :to_number
41
+
42
+ # Sender phone number
43
+ attr_accessor :from_number
44
+
45
+ # SMS message body
46
+ attr_accessor :body
47
+
48
+ # SMS has been read
49
+ attr_accessor :read
50
+
51
+ class EnumAttributeValidator
52
+ attr_reader :datatype
53
+ attr_reader :allowable_values
54
+
55
+ def initialize(datatype, allowable_values)
56
+ @allowable_values = allowable_values.map do |value|
57
+ case datatype.to_s
58
+ when /Integer/i
59
+ value.to_i
60
+ when /Float/i
61
+ value.to_f
62
+ else
63
+ value
64
+ end
65
+ end
66
+ end
67
+
68
+ def valid?(value)
69
+ !value || allowable_values.include?(value)
70
+ end
71
+ end
72
+
73
+ # Attribute mapping from ruby-style variable name to JSON key.
74
+ def self.attribute_map
75
+ {
76
+ :'message_id' => :'messageId',
77
+ :'webhook_id' => :'webhookId',
78
+ :'event_name' => :'eventName',
79
+ :'webhook_name' => :'webhookName',
80
+ :'sms_id' => :'smsId',
81
+ :'user_id' => :'userId',
82
+ :'phone_number' => :'phoneNumber',
83
+ :'to_number' => :'toNumber',
84
+ :'from_number' => :'fromNumber',
85
+ :'body' => :'body',
86
+ :'read' => :'read'
87
+ }
88
+ end
89
+
90
+ # Attribute type mapping.
91
+ def self.openapi_types
92
+ {
93
+ :'message_id' => :'String',
94
+ :'webhook_id' => :'String',
95
+ :'event_name' => :'String',
96
+ :'webhook_name' => :'String',
97
+ :'sms_id' => :'String',
98
+ :'user_id' => :'String',
99
+ :'phone_number' => :'String',
100
+ :'to_number' => :'String',
101
+ :'from_number' => :'String',
102
+ :'body' => :'String',
103
+ :'read' => :'Boolean'
104
+ }
105
+ end
106
+
107
+ # List of attributes with nullable: true
108
+ def self.openapi_nullable
109
+ Set.new([
110
+ :'webhook_name',
111
+ ])
112
+ end
113
+
114
+ # Initializes the object
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ def initialize(attributes = {})
117
+ if (!attributes.is_a?(Hash))
118
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::WebhookNewSmsPayload` initialize method"
119
+ end
120
+
121
+ # check to see if the attribute exists and convert string to symbol for hash key
122
+ attributes = attributes.each_with_object({}) { |(k, v), h|
123
+ if (!self.class.attribute_map.key?(k.to_sym))
124
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::WebhookNewSmsPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
125
+ end
126
+ h[k.to_sym] = v
127
+ }
128
+
129
+ if attributes.key?(:'message_id')
130
+ self.message_id = attributes[:'message_id']
131
+ end
132
+
133
+ if attributes.key?(:'webhook_id')
134
+ self.webhook_id = attributes[:'webhook_id']
135
+ end
136
+
137
+ if attributes.key?(:'event_name')
138
+ self.event_name = attributes[:'event_name']
139
+ end
140
+
141
+ if attributes.key?(:'webhook_name')
142
+ self.webhook_name = attributes[:'webhook_name']
143
+ end
144
+
145
+ if attributes.key?(:'sms_id')
146
+ self.sms_id = attributes[:'sms_id']
147
+ end
148
+
149
+ if attributes.key?(:'user_id')
150
+ self.user_id = attributes[:'user_id']
151
+ end
152
+
153
+ if attributes.key?(:'phone_number')
154
+ self.phone_number = attributes[:'phone_number']
155
+ end
156
+
157
+ if attributes.key?(:'to_number')
158
+ self.to_number = attributes[:'to_number']
159
+ end
160
+
161
+ if attributes.key?(:'from_number')
162
+ self.from_number = attributes[:'from_number']
163
+ end
164
+
165
+ if attributes.key?(:'body')
166
+ self.body = attributes[:'body']
167
+ end
168
+
169
+ if attributes.key?(:'read')
170
+ self.read = attributes[:'read']
171
+ end
172
+ end
173
+
174
+ # Show invalid properties with the reasons. Usually used together with valid?
175
+ # @return Array for valid properties with the reasons
176
+ def list_invalid_properties
177
+ invalid_properties = Array.new
178
+ if @message_id.nil?
179
+ invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
180
+ end
181
+
182
+ if @webhook_id.nil?
183
+ invalid_properties.push('invalid value for "webhook_id", webhook_id cannot be nil.')
184
+ end
185
+
186
+ if @event_name.nil?
187
+ invalid_properties.push('invalid value for "event_name", event_name cannot be nil.')
188
+ end
189
+
190
+ if @sms_id.nil?
191
+ invalid_properties.push('invalid value for "sms_id", sms_id cannot be nil.')
192
+ end
193
+
194
+ if @user_id.nil?
195
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
196
+ end
197
+
198
+ if @phone_number.nil?
199
+ invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
200
+ end
201
+
202
+ if @to_number.nil?
203
+ invalid_properties.push('invalid value for "to_number", to_number cannot be nil.')
204
+ end
205
+
206
+ if @from_number.nil?
207
+ invalid_properties.push('invalid value for "from_number", from_number cannot be nil.')
208
+ end
209
+
210
+ if @body.nil?
211
+ invalid_properties.push('invalid value for "body", body cannot be nil.')
212
+ end
213
+
214
+ if @read.nil?
215
+ invalid_properties.push('invalid value for "read", read cannot be nil.')
216
+ end
217
+
218
+ invalid_properties
219
+ end
220
+
221
+ # Check to see if the all the properties in the model are valid
222
+ # @return true if the model is valid
223
+ def valid?
224
+ return false if @message_id.nil?
225
+ return false if @webhook_id.nil?
226
+ return false if @event_name.nil?
227
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "DELIVERY_STATUS", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
228
+ return false unless event_name_validator.valid?(@event_name)
229
+ return false if @sms_id.nil?
230
+ return false if @user_id.nil?
231
+ return false if @phone_number.nil?
232
+ return false if @to_number.nil?
233
+ return false if @from_number.nil?
234
+ return false if @body.nil?
235
+ return false if @read.nil?
236
+ true
237
+ end
238
+
239
+ # Custom attribute writer method checking allowed values (enum).
240
+ # @param [Object] event_name Object to be assigned
241
+ def event_name=(event_name)
242
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "DELIVERY_STATUS", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
243
+ unless validator.valid?(event_name)
244
+ fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
245
+ end
246
+ @event_name = event_name
247
+ end
248
+
249
+ # Checks equality by comparing each attribute.
250
+ # @param [Object] Object to be compared
251
+ def ==(o)
252
+ return true if self.equal?(o)
253
+ self.class == o.class &&
254
+ message_id == o.message_id &&
255
+ webhook_id == o.webhook_id &&
256
+ event_name == o.event_name &&
257
+ webhook_name == o.webhook_name &&
258
+ sms_id == o.sms_id &&
259
+ user_id == o.user_id &&
260
+ phone_number == o.phone_number &&
261
+ to_number == o.to_number &&
262
+ from_number == o.from_number &&
263
+ body == o.body &&
264
+ read == o.read
265
+ end
266
+
267
+ # @see the `==` method
268
+ # @param [Object] Object to be compared
269
+ def eql?(o)
270
+ self == o
271
+ end
272
+
273
+ # Calculates hash code according to all attributes.
274
+ # @return [Integer] Hash code
275
+ def hash
276
+ [message_id, webhook_id, event_name, webhook_name, sms_id, user_id, phone_number, to_number, from_number, body, read].hash
277
+ end
278
+
279
+ # Builds the object from hash
280
+ # @param [Hash] attributes Model attributes in the form of hash
281
+ # @return [Object] Returns the model itself
282
+ def self.build_from_hash(attributes)
283
+ new.build_from_hash(attributes)
284
+ end
285
+
286
+ # Builds the object from hash
287
+ # @param [Hash] attributes Model attributes in the form of hash
288
+ # @return [Object] Returns the model itself
289
+ def build_from_hash(attributes)
290
+ return nil unless attributes.is_a?(Hash)
291
+ self.class.openapi_types.each_pair do |key, type|
292
+ if type =~ /\AArray<(.*)>/i
293
+ # check to ensure the input is an array given that the attribute
294
+ # is documented as an array but the input is not
295
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
296
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
297
+ end
298
+ elsif !attributes[self.class.attribute_map[key]].nil?
299
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
300
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
301
+ end
302
+
303
+ self
304
+ end
305
+
306
+ # Deserializes the data based on type
307
+ # @param string type Data type
308
+ # @param string value Value to be deserialized
309
+ # @return [Object] Deserialized data
310
+ def _deserialize(type, value)
311
+ case type.to_sym
312
+ when :DateTime
313
+ DateTime.parse(value)
314
+ when :Date
315
+ Date.parse(value)
316
+ when :String
317
+ value.to_s
318
+ when :Integer
319
+ value.to_i
320
+ when :Float
321
+ value.to_f
322
+ when :Boolean
323
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
324
+ true
325
+ else
326
+ false
327
+ end
328
+ when :Object
329
+ # generic object (usually a Hash), return directly
330
+ value
331
+ when /\AArray<(?<inner_type>.+)>\z/
332
+ inner_type = Regexp.last_match[:inner_type]
333
+ value.map { |v| _deserialize(inner_type, v) }
334
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
335
+ k_type = Regexp.last_match[:k_type]
336
+ v_type = Regexp.last_match[:v_type]
337
+ {}.tap do |hash|
338
+ value.each do |k, v|
339
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
340
+ end
341
+ end
342
+ else # model
343
+ MailSlurpClient.const_get(type).build_from_hash(value)
344
+ end
345
+ end
346
+
347
+ # Returns the string representation of the object
348
+ # @return [String] String presentation of the object
349
+ def to_s
350
+ to_hash.to_s
351
+ end
352
+
353
+ # to_body is an alias to to_hash (backward compatibility)
354
+ # @return [Hash] Returns the object in the form of hash
355
+ def to_body
356
+ to_hash
357
+ end
358
+
359
+ # Returns the object in the form of hash
360
+ # @return [Hash] Returns the object in the form of hash
361
+ def to_hash
362
+ hash = {}
363
+ self.class.attribute_map.each_pair do |attr, param|
364
+ value = self.send(attr)
365
+ if value.nil?
366
+ is_nullable = self.class.openapi_nullable.include?(attr)
367
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
368
+ end
369
+
370
+ hash[param] = _to_hash(value)
371
+ end
372
+ hash
373
+ end
374
+
375
+ # Outputs non-array value in the form of hash
376
+ # For object, use to_hash. Otherwise, just return the value
377
+ # @param [Object] value Any valid value
378
+ # @return [Hash] Returns the value in the form of hash
379
+ def _to_hash(value)
380
+ if value.is_a?(Array)
381
+ value.compact.map { |v| _to_hash(v) }
382
+ elsif value.is_a?(Hash)
383
+ {}.tap do |hash|
384
+ value.each { |k, v| hash[k] = _to_hash(v) }
385
+ end
386
+ elsif value.respond_to? :to_hash
387
+ value.to_hash
388
+ else
389
+ value
390
+ end
391
+ end
392
+ end
393
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module MailSlurpClient
14
- VERSION = '15.13.9'
14
+ VERSION = '15.13.10'
15
15
  end
@@ -189,6 +189,7 @@ require 'mailslurp_client/models/wait_for_single_sms_options'
189
189
  require 'mailslurp_client/models/wait_for_sms_conditions'
190
190
  require 'mailslurp_client/models/webhook_bounce_payload'
191
191
  require 'mailslurp_client/models/webhook_bounce_recipient_payload'
192
+ require 'mailslurp_client/models/webhook_delivery_status_payload'
192
193
  require 'mailslurp_client/models/webhook_dto'
193
194
  require 'mailslurp_client/models/webhook_email_opened_payload'
194
195
  require 'mailslurp_client/models/webhook_email_read_payload'
@@ -197,6 +198,7 @@ require 'mailslurp_client/models/webhook_headers'
197
198
  require 'mailslurp_client/models/webhook_new_attachment_payload'
198
199
  require 'mailslurp_client/models/webhook_new_contact_payload'
199
200
  require 'mailslurp_client/models/webhook_new_email_payload'
201
+ require 'mailslurp_client/models/webhook_new_sms_payload'
200
202
  require 'mailslurp_client/models/webhook_projection'
201
203
  require 'mailslurp_client/models/webhook_redrive_result'
202
204
  require 'mailslurp_client/models/webhook_result_dto'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailslurp_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.13.9
4
+ version: 15.13.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - mailslurp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-07 00:00:00.000000000 Z
11
+ date: 2022-08-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Create emails addresses in Ruby then send and receive real emails and
14
14
  attachments. See https://www.mailslurp.com/ruby/ for full Ruby documentation. Get
@@ -224,6 +224,7 @@ files:
224
224
  - lib/mailslurp_client/models/wait_for_sms_conditions.rb
225
225
  - lib/mailslurp_client/models/webhook_bounce_payload.rb
226
226
  - lib/mailslurp_client/models/webhook_bounce_recipient_payload.rb
227
+ - lib/mailslurp_client/models/webhook_delivery_status_payload.rb
227
228
  - lib/mailslurp_client/models/webhook_dto.rb
228
229
  - lib/mailslurp_client/models/webhook_email_opened_payload.rb
229
230
  - lib/mailslurp_client/models/webhook_email_read_payload.rb
@@ -232,6 +233,7 @@ files:
232
233
  - lib/mailslurp_client/models/webhook_new_attachment_payload.rb
233
234
  - lib/mailslurp_client/models/webhook_new_contact_payload.rb
234
235
  - lib/mailslurp_client/models/webhook_new_email_payload.rb
236
+ - lib/mailslurp_client/models/webhook_new_sms_payload.rb
235
237
  - lib/mailslurp_client/models/webhook_projection.rb
236
238
  - lib/mailslurp_client/models/webhook_redrive_result.rb
237
239
  - lib/mailslurp_client/models/webhook_result_dto.rb