mailslurp_client 12.4.8 → 12.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client.rb +13 -0
  3. data/lib/mailslurp_client/api/contact_controller_api.rb +4 -4
  4. data/lib/mailslurp_client/api/email_controller_api.rb +64 -0
  5. data/lib/mailslurp_client/api/group_controller_api.rb +4 -4
  6. data/lib/mailslurp_client/api/inbox_controller_api.rb +238 -12
  7. data/lib/mailslurp_client/api/inbox_ruleset_controller_api.rb +548 -0
  8. data/lib/mailslurp_client/api/missed_email_controller_api.rb +75 -7
  9. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +150 -4
  10. data/lib/mailslurp_client/api/template_controller_api.rb +4 -4
  11. data/lib/mailslurp_client/api/tracking_controller_api.rb +218 -0
  12. data/lib/mailslurp_client/api/wait_for_controller_api.rb +2 -2
  13. data/lib/mailslurp_client/api/webhook_controller_api.rb +55 -1
  14. data/lib/mailslurp_client/models/abstract_webhook_payload.rb +3 -3
  15. data/lib/mailslurp_client/models/create_inbox_ruleset_options.rb +274 -0
  16. data/lib/mailslurp_client/models/create_tracking_pixel_options.rb +215 -0
  17. data/lib/mailslurp_client/models/create_webhook_options.rb +3 -3
  18. data/lib/mailslurp_client/models/email.rb +11 -1
  19. data/lib/mailslurp_client/models/email_projection.rb +10 -1
  20. data/lib/mailslurp_client/models/inbox_ruleset_dto.rb +353 -0
  21. data/lib/mailslurp_client/models/inbox_ruleset_test_options.rb +211 -0
  22. data/lib/mailslurp_client/models/inbox_ruleset_test_result.rb +223 -0
  23. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +299 -0
  24. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +299 -0
  25. data/lib/mailslurp_client/models/send_email_options.rb +11 -1
  26. data/lib/mailslurp_client/models/sent_email_dto.rb +12 -1
  27. data/lib/mailslurp_client/models/test_new_inbox_ruleset_options.rb +225 -0
  28. data/lib/mailslurp_client/models/tracking_pixel_dto.rb +303 -0
  29. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +289 -0
  30. data/lib/mailslurp_client/models/webhook_dto.rb +2 -2
  31. data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +322 -0
  32. data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +2 -2
  33. data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +2 -2
  34. data/lib/mailslurp_client/models/webhook_new_email_payload.rb +2 -2
  35. data/lib/mailslurp_client/models/webhook_result_entity.rb +2 -2
  36. data/lib/mailslurp_client/version.rb +1 -1
  37. metadata +15 -2
@@ -17,7 +17,7 @@ module MailSlurpClient
17
17
  class CreateWebhookOptions
18
18
  attr_accessor :basic_auth
19
19
 
20
- # Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name. The other events are `NEW_EMAIL`, `NEW_CONTACT`, and `NEW_ATTACHMENT`.
20
+ # Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name. The other events are `NEW_EMAIL`, `NEW_CONTACT`, and `NEW_ATTACHMENT` and `EMAIL_OPENED`. `EMAIL_OPENED` requires the use of tracking pixels when sending. See the email tracking guide for more information.
21
21
  attr_accessor :event_name
22
22
 
23
23
  # Optional name for the webhook
@@ -116,7 +116,7 @@ module MailSlurpClient
116
116
  # Check to see if the all the properties in the model are valid
117
117
  # @return true if the model is valid
118
118
  def valid?
119
- event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
119
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
120
120
  return false unless event_name_validator.valid?(@event_name)
121
121
  true
122
122
  end
@@ -124,7 +124,7 @@ module MailSlurpClient
124
124
  # Custom attribute writer method checking allowed values (enum).
125
125
  # @param [Object] event_name Object to be assigned
126
126
  def event_name=(event_name)
127
- validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
127
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
128
128
  unless validator.valid?(event_name)
129
129
  fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
130
130
  end
@@ -26,6 +26,9 @@ module MailSlurpClient
26
26
  # The body of the email message
27
27
  attr_accessor :body
28
28
 
29
+ # An excerpt of the body of the email message
30
+ attr_accessor :body_excerpt
31
+
29
32
  # A hash signature of the email message
30
33
  attr_accessor :body_md5_hash
31
34
 
@@ -81,6 +84,7 @@ module MailSlurpClient
81
84
  :'attachments' => :'attachments',
82
85
  :'bcc' => :'bcc',
83
86
  :'body' => :'body',
87
+ :'body_excerpt' => :'bodyExcerpt',
84
88
  :'body_md5_hash' => :'bodyMD5Hash',
85
89
  :'cc' => :'cc',
86
90
  :'charset' => :'charset',
@@ -107,6 +111,7 @@ module MailSlurpClient
107
111
  :'attachments' => :'Array<String>',
108
112
  :'bcc' => :'Array<String>',
109
113
  :'body' => :'String',
114
+ :'body_excerpt' => :'String',
110
115
  :'body_md5_hash' => :'String',
111
116
  :'cc' => :'Array<String>',
112
117
  :'charset' => :'String',
@@ -167,6 +172,10 @@ module MailSlurpClient
167
172
  self.body = attributes[:'body']
168
173
  end
169
174
 
175
+ if attributes.key?(:'body_excerpt')
176
+ self.body_excerpt = attributes[:'body_excerpt']
177
+ end
178
+
170
179
  if attributes.key?(:'body_md5_hash')
171
180
  self.body_md5_hash = attributes[:'body_md5_hash']
172
181
  end
@@ -260,6 +269,7 @@ module MailSlurpClient
260
269
  attachments == o.attachments &&
261
270
  bcc == o.bcc &&
262
271
  body == o.body &&
272
+ body_excerpt == o.body_excerpt &&
263
273
  body_md5_hash == o.body_md5_hash &&
264
274
  cc == o.cc &&
265
275
  charset == o.charset &&
@@ -287,7 +297,7 @@ module MailSlurpClient
287
297
  # Calculates hash code according to all attributes.
288
298
  # @return [Integer] Hash code
289
299
  def hash
290
- [analysis, attachments, bcc, body, body_md5_hash, cc, charset, created_at, from, headers, id, inbox_id, is_html, read, reply_to, subject, team_access, to, updated_at, user_id].hash
300
+ [analysis, attachments, bcc, body, body_excerpt, body_md5_hash, cc, charset, created_at, from, headers, id, inbox_id, is_html, read, reply_to, subject, team_access, to, updated_at, user_id].hash
291
301
  end
292
302
 
293
303
  # Builds the object from hash
@@ -19,6 +19,8 @@ module MailSlurpClient
19
19
 
20
20
  attr_accessor :bcc
21
21
 
22
+ attr_accessor :body_excerpt
23
+
22
24
  attr_accessor :body_md5_hash
23
25
 
24
26
  attr_accessor :cc
@@ -44,6 +46,7 @@ module MailSlurpClient
44
46
  {
45
47
  :'attachments' => :'attachments',
46
48
  :'bcc' => :'bcc',
49
+ :'body_excerpt' => :'bodyExcerpt',
47
50
  :'body_md5_hash' => :'bodyMD5Hash',
48
51
  :'cc' => :'cc',
49
52
  :'created_at' => :'createdAt',
@@ -62,6 +65,7 @@ module MailSlurpClient
62
65
  {
63
66
  :'attachments' => :'Array<String>',
64
67
  :'bcc' => :'Array<String>',
68
+ :'body_excerpt' => :'String',
65
69
  :'body_md5_hash' => :'String',
66
70
  :'cc' => :'Array<String>',
67
71
  :'created_at' => :'DateTime',
@@ -108,6 +112,10 @@ module MailSlurpClient
108
112
  end
109
113
  end
110
114
 
115
+ if attributes.key?(:'body_excerpt')
116
+ self.body_excerpt = attributes[:'body_excerpt']
117
+ end
118
+
111
119
  if attributes.key?(:'body_md5_hash')
112
120
  self.body_md5_hash = attributes[:'body_md5_hash']
113
121
  end
@@ -193,6 +201,7 @@ module MailSlurpClient
193
201
  self.class == o.class &&
194
202
  attachments == o.attachments &&
195
203
  bcc == o.bcc &&
204
+ body_excerpt == o.body_excerpt &&
196
205
  body_md5_hash == o.body_md5_hash &&
197
206
  cc == o.cc &&
198
207
  created_at == o.created_at &&
@@ -214,7 +223,7 @@ module MailSlurpClient
214
223
  # Calculates hash code according to all attributes.
215
224
  # @return [Integer] Hash code
216
225
  def hash
217
- [attachments, bcc, body_md5_hash, cc, created_at, from, id, inbox_id, read, subject, team_access, to].hash
226
+ [attachments, bcc, body_excerpt, body_md5_hash, cc, created_at, from, id, inbox_id, read, subject, team_access, to].hash
218
227
  end
219
228
 
220
229
  # Builds the object from hash
@@ -0,0 +1,353 @@
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
+
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 InboxRulesetDto
17
+ attr_accessor :action
18
+
19
+ attr_accessor :created_at
20
+
21
+ attr_accessor :handler
22
+
23
+ attr_accessor :id
24
+
25
+ attr_accessor :inbox_id
26
+
27
+ attr_accessor :scope
28
+
29
+ attr_accessor :target
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
+ :'action' => :'action',
57
+ :'created_at' => :'createdAt',
58
+ :'handler' => :'handler',
59
+ :'id' => :'id',
60
+ :'inbox_id' => :'inboxId',
61
+ :'scope' => :'scope',
62
+ :'target' => :'target'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'action' => :'String',
70
+ :'created_at' => :'DateTime',
71
+ :'handler' => :'String',
72
+ :'id' => :'String',
73
+ :'inbox_id' => :'String',
74
+ :'scope' => :'String',
75
+ :'target' => :'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::InboxRulesetDto` 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::InboxRulesetDto`. 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?(:'action')
101
+ self.action = attributes[:'action']
102
+ end
103
+
104
+ if attributes.key?(:'created_at')
105
+ self.created_at = attributes[:'created_at']
106
+ end
107
+
108
+ if attributes.key?(:'handler')
109
+ self.handler = attributes[:'handler']
110
+ end
111
+
112
+ if attributes.key?(:'id')
113
+ self.id = attributes[:'id']
114
+ end
115
+
116
+ if attributes.key?(:'inbox_id')
117
+ self.inbox_id = attributes[:'inbox_id']
118
+ end
119
+
120
+ if attributes.key?(:'scope')
121
+ self.scope = attributes[:'scope']
122
+ end
123
+
124
+ if attributes.key?(:'target')
125
+ self.target = attributes[:'target']
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 @action.nil?
134
+ invalid_properties.push('invalid value for "action", action cannot be nil.')
135
+ end
136
+
137
+ if @created_at.nil?
138
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
139
+ end
140
+
141
+ if @handler.nil?
142
+ invalid_properties.push('invalid value for "handler", handler cannot be nil.')
143
+ end
144
+
145
+ if @id.nil?
146
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
147
+ end
148
+
149
+ if @inbox_id.nil?
150
+ invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
151
+ end
152
+
153
+ if @scope.nil?
154
+ invalid_properties.push('invalid value for "scope", scope cannot be nil.')
155
+ end
156
+
157
+ if @target.nil?
158
+ invalid_properties.push('invalid value for "target", target cannot be nil.')
159
+ end
160
+
161
+ invalid_properties
162
+ end
163
+
164
+ # Check to see if the all the properties in the model are valid
165
+ # @return true if the model is valid
166
+ def valid?
167
+ return false if @action.nil?
168
+ action_validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FILTER_REMOVE"])
169
+ return false unless action_validator.valid?(@action)
170
+ return false if @created_at.nil?
171
+ return false if @handler.nil?
172
+ handler_validator = EnumAttributeValidator.new('String', ["EXCEPTION"])
173
+ return false unless handler_validator.valid?(@handler)
174
+ return false if @id.nil?
175
+ return false if @inbox_id.nil?
176
+ return false if @scope.nil?
177
+ scope_validator = EnumAttributeValidator.new('String', ["RECEIVING_EMAILS", "SENDING_EMAILS"])
178
+ return false unless scope_validator.valid?(@scope)
179
+ return false if @target.nil?
180
+ true
181
+ end
182
+
183
+ # Custom attribute writer method checking allowed values (enum).
184
+ # @param [Object] action Object to be assigned
185
+ def action=(action)
186
+ validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FILTER_REMOVE"])
187
+ unless validator.valid?(action)
188
+ fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
189
+ end
190
+ @action = action
191
+ end
192
+
193
+ # Custom attribute writer method checking allowed values (enum).
194
+ # @param [Object] handler Object to be assigned
195
+ def handler=(handler)
196
+ validator = EnumAttributeValidator.new('String', ["EXCEPTION"])
197
+ unless validator.valid?(handler)
198
+ fail ArgumentError, "invalid value for \"handler\", must be one of #{validator.allowable_values}."
199
+ end
200
+ @handler = handler
201
+ end
202
+
203
+ # Custom attribute writer method checking allowed values (enum).
204
+ # @param [Object] scope Object to be assigned
205
+ def scope=(scope)
206
+ validator = EnumAttributeValidator.new('String', ["RECEIVING_EMAILS", "SENDING_EMAILS"])
207
+ unless validator.valid?(scope)
208
+ fail ArgumentError, "invalid value for \"scope\", must be one of #{validator.allowable_values}."
209
+ end
210
+ @scope = scope
211
+ end
212
+
213
+ # Checks equality by comparing each attribute.
214
+ # @param [Object] Object to be compared
215
+ def ==(o)
216
+ return true if self.equal?(o)
217
+ self.class == o.class &&
218
+ action == o.action &&
219
+ created_at == o.created_at &&
220
+ handler == o.handler &&
221
+ id == o.id &&
222
+ inbox_id == o.inbox_id &&
223
+ scope == o.scope &&
224
+ target == o.target
225
+ end
226
+
227
+ # @see the `==` method
228
+ # @param [Object] Object to be compared
229
+ def eql?(o)
230
+ self == o
231
+ end
232
+
233
+ # Calculates hash code according to all attributes.
234
+ # @return [Integer] Hash code
235
+ def hash
236
+ [action, created_at, handler, id, inbox_id, scope, target].hash
237
+ end
238
+
239
+ # Builds the object from hash
240
+ # @param [Hash] attributes Model attributes in the form of hash
241
+ # @return [Object] Returns the model itself
242
+ def self.build_from_hash(attributes)
243
+ new.build_from_hash(attributes)
244
+ end
245
+
246
+ # Builds the object from hash
247
+ # @param [Hash] attributes Model attributes in the form of hash
248
+ # @return [Object] Returns the model itself
249
+ def build_from_hash(attributes)
250
+ return nil unless attributes.is_a?(Hash)
251
+ self.class.openapi_types.each_pair do |key, type|
252
+ if type =~ /\AArray<(.*)>/i
253
+ # check to ensure the input is an array given that the attribute
254
+ # is documented as an array but the input is not
255
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
256
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
257
+ end
258
+ elsif !attributes[self.class.attribute_map[key]].nil?
259
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
260
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
261
+ end
262
+
263
+ self
264
+ end
265
+
266
+ # Deserializes the data based on type
267
+ # @param string type Data type
268
+ # @param string value Value to be deserialized
269
+ # @return [Object] Deserialized data
270
+ def _deserialize(type, value)
271
+ case type.to_sym
272
+ when :DateTime
273
+ DateTime.parse(value)
274
+ when :Date
275
+ Date.parse(value)
276
+ when :String
277
+ value.to_s
278
+ when :Integer
279
+ value.to_i
280
+ when :Float
281
+ value.to_f
282
+ when :Boolean
283
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
284
+ true
285
+ else
286
+ false
287
+ end
288
+ when :Object
289
+ # generic object (usually a Hash), return directly
290
+ value
291
+ when /\AArray<(?<inner_type>.+)>\z/
292
+ inner_type = Regexp.last_match[:inner_type]
293
+ value.map { |v| _deserialize(inner_type, v) }
294
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
295
+ k_type = Regexp.last_match[:k_type]
296
+ v_type = Regexp.last_match[:v_type]
297
+ {}.tap do |hash|
298
+ value.each do |k, v|
299
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
300
+ end
301
+ end
302
+ else # model
303
+ MailSlurpClient.const_get(type).build_from_hash(value)
304
+ end
305
+ end
306
+
307
+ # Returns the string representation of the object
308
+ # @return [String] String presentation of the object
309
+ def to_s
310
+ to_hash.to_s
311
+ end
312
+
313
+ # to_body is an alias to to_hash (backward compatibility)
314
+ # @return [Hash] Returns the object in the form of hash
315
+ def to_body
316
+ to_hash
317
+ end
318
+
319
+ # Returns the object in the form of hash
320
+ # @return [Hash] Returns the object in the form of hash
321
+ def to_hash
322
+ hash = {}
323
+ self.class.attribute_map.each_pair do |attr, param|
324
+ value = self.send(attr)
325
+ if value.nil?
326
+ is_nullable = self.class.openapi_nullable.include?(attr)
327
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
328
+ end
329
+
330
+ hash[param] = _to_hash(value)
331
+ end
332
+ hash
333
+ end
334
+
335
+ # Outputs non-array value in the form of hash
336
+ # For object, use to_hash. Otherwise, just return the value
337
+ # @param [Object] value Any valid value
338
+ # @return [Hash] Returns the value in the form of hash
339
+ def _to_hash(value)
340
+ if value.is_a?(Array)
341
+ value.compact.map { |v| _to_hash(v) }
342
+ elsif value.is_a?(Hash)
343
+ {}.tap do |hash|
344
+ value.each { |k, v| hash[k] = _to_hash(v) }
345
+ end
346
+ elsif value.respond_to? :to_hash
347
+ value.to_hash
348
+ else
349
+ value
350
+ end
351
+ end
352
+ end
353
+ end