mailslurp_client 12.6.3 → 12.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client.rb +13 -0
  3. data/lib/mailslurp_client/api/bounce_controller_api.rb +284 -0
  4. data/lib/mailslurp_client/api/email_controller_api.rb +7 -5
  5. data/lib/mailslurp_client/api/inbox_controller_api.rb +4 -4
  6. data/lib/mailslurp_client/api/inbox_forwarder_controller_api.rb +548 -0
  7. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +60 -0
  8. data/lib/mailslurp_client/models/bounce.rb +325 -0
  9. data/lib/mailslurp_client/models/bounce_projection.rb +234 -0
  10. data/lib/mailslurp_client/models/bounce_recipient.rb +262 -0
  11. data/lib/mailslurp_client/models/create_inbox_forwarder_options.rb +275 -0
  12. data/lib/mailslurp_client/models/domain_preview.rb +66 -4
  13. data/lib/mailslurp_client/models/email.rb +11 -1
  14. data/lib/mailslurp_client/models/email_projection.rb +10 -1
  15. data/lib/mailslurp_client/models/inbox_forwarder_dto.rb +317 -0
  16. data/lib/mailslurp_client/models/inbox_forwarder_test_options.rb +211 -0
  17. data/lib/mailslurp_client/models/inbox_forwarder_test_result.rb +227 -0
  18. data/lib/mailslurp_client/models/page_bounced_email.rb +299 -0
  19. data/lib/mailslurp_client/models/page_bounced_recipients.rb +299 -0
  20. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +299 -0
  21. data/lib/mailslurp_client/models/test_new_inbox_forwarder_options.rb +225 -0
  22. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -1
  23. data/lib/mailslurp_client/models/webhook_projection.rb +44 -1
  24. data/lib/mailslurp_client/models/webhook_result_entity.rb +22 -1
  25. data/lib/mailslurp_client/version.rb +1 -1
  26. metadata +15 -2
@@ -21,15 +21,43 @@ module MailSlurpClient
21
21
 
22
22
  attr_accessor :domain
23
23
 
24
+ attr_accessor :domain_type
25
+
24
26
  attr_accessor :id
25
27
 
28
+ attr_accessor :is_verified
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
26
52
  # Attribute mapping from ruby-style variable name to JSON key.
27
53
  def self.attribute_map
28
54
  {
29
55
  :'catch_all_inbox_id' => :'catchAllInboxId',
30
56
  :'created_at' => :'createdAt',
31
57
  :'domain' => :'domain',
32
- :'id' => :'id'
58
+ :'domain_type' => :'domainType',
59
+ :'id' => :'id',
60
+ :'is_verified' => :'isVerified'
33
61
  }
34
62
  end
35
63
 
@@ -39,7 +67,9 @@ module MailSlurpClient
39
67
  :'catch_all_inbox_id' => :'String',
40
68
  :'created_at' => :'DateTime',
41
69
  :'domain' => :'String',
42
- :'id' => :'String'
70
+ :'domain_type' => :'String',
71
+ :'id' => :'String',
72
+ :'is_verified' => :'Boolean'
43
73
  }
44
74
  end
45
75
 
@@ -76,9 +106,17 @@ module MailSlurpClient
76
106
  self.domain = attributes[:'domain']
77
107
  end
78
108
 
109
+ if attributes.key?(:'domain_type')
110
+ self.domain_type = attributes[:'domain_type']
111
+ end
112
+
79
113
  if attributes.key?(:'id')
80
114
  self.id = attributes[:'id']
81
115
  end
116
+
117
+ if attributes.key?(:'is_verified')
118
+ self.is_verified = attributes[:'is_verified']
119
+ end
82
120
  end
83
121
 
84
122
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -93,10 +131,18 @@ module MailSlurpClient
93
131
  invalid_properties.push('invalid value for "domain", domain cannot be nil.')
94
132
  end
95
133
 
134
+ if @domain_type.nil?
135
+ invalid_properties.push('invalid value for "domain_type", domain_type cannot be nil.')
136
+ end
137
+
96
138
  if @id.nil?
97
139
  invalid_properties.push('invalid value for "id", id cannot be nil.')
98
140
  end
99
141
 
142
+ if @is_verified.nil?
143
+ invalid_properties.push('invalid value for "is_verified", is_verified cannot be nil.')
144
+ end
145
+
100
146
  invalid_properties
101
147
  end
102
148
 
@@ -105,10 +151,24 @@ module MailSlurpClient
105
151
  def valid?
106
152
  return false if @created_at.nil?
107
153
  return false if @domain.nil?
154
+ return false if @domain_type.nil?
155
+ domain_type_validator = EnumAttributeValidator.new('String', ["HTTP_INBOX", "SMTP_DOMAIN"])
156
+ return false unless domain_type_validator.valid?(@domain_type)
108
157
  return false if @id.nil?
158
+ return false if @is_verified.nil?
109
159
  true
110
160
  end
111
161
 
162
+ # Custom attribute writer method checking allowed values (enum).
163
+ # @param [Object] domain_type Object to be assigned
164
+ def domain_type=(domain_type)
165
+ validator = EnumAttributeValidator.new('String', ["HTTP_INBOX", "SMTP_DOMAIN"])
166
+ unless validator.valid?(domain_type)
167
+ fail ArgumentError, "invalid value for \"domain_type\", must be one of #{validator.allowable_values}."
168
+ end
169
+ @domain_type = domain_type
170
+ end
171
+
112
172
  # Checks equality by comparing each attribute.
113
173
  # @param [Object] Object to be compared
114
174
  def ==(o)
@@ -117,7 +177,9 @@ module MailSlurpClient
117
177
  catch_all_inbox_id == o.catch_all_inbox_id &&
118
178
  created_at == o.created_at &&
119
179
  domain == o.domain &&
120
- id == o.id
180
+ domain_type == o.domain_type &&
181
+ id == o.id &&
182
+ is_verified == o.is_verified
121
183
  end
122
184
 
123
185
  # @see the `==` method
@@ -129,7 +191,7 @@ module MailSlurpClient
129
191
  # Calculates hash code according to all attributes.
130
192
  # @return [Integer] Hash code
131
193
  def hash
132
- [catch_all_inbox_id, created_at, domain, id].hash
194
+ [catch_all_inbox_id, created_at, domain, domain_type, id, is_verified].hash
133
195
  end
134
196
 
135
197
  # Builds the object from hash
@@ -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,317 @@
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 InboxForwarderDto
17
+ attr_accessor :created_at
18
+
19
+ attr_accessor :field
20
+
21
+ attr_accessor :forward_to_recipients
22
+
23
+ attr_accessor :id
24
+
25
+ attr_accessor :inbox_id
26
+
27
+ attr_accessor :match
28
+
29
+ class EnumAttributeValidator
30
+ attr_reader :datatype
31
+ attr_reader :allowable_values
32
+
33
+ def initialize(datatype, allowable_values)
34
+ @allowable_values = allowable_values.map do |value|
35
+ case datatype.to_s
36
+ when /Integer/i
37
+ value.to_i
38
+ when /Float/i
39
+ value.to_f
40
+ else
41
+ value
42
+ end
43
+ end
44
+ end
45
+
46
+ def valid?(value)
47
+ !value || allowable_values.include?(value)
48
+ end
49
+ end
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'created_at' => :'createdAt',
55
+ :'field' => :'field',
56
+ :'forward_to_recipients' => :'forwardToRecipients',
57
+ :'id' => :'id',
58
+ :'inbox_id' => :'inboxId',
59
+ :'match' => :'match'
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'created_at' => :'DateTime',
67
+ :'field' => :'String',
68
+ :'forward_to_recipients' => :'Array<String>',
69
+ :'id' => :'String',
70
+ :'inbox_id' => :'String',
71
+ :'match' => :'String'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::InboxForwarderDto` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!self.class.attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::InboxForwarderDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'created_at')
97
+ self.created_at = attributes[:'created_at']
98
+ end
99
+
100
+ if attributes.key?(:'field')
101
+ self.field = attributes[:'field']
102
+ end
103
+
104
+ if attributes.key?(:'forward_to_recipients')
105
+ if (value = attributes[:'forward_to_recipients']).is_a?(Array)
106
+ self.forward_to_recipients = value
107
+ end
108
+ end
109
+
110
+ if attributes.key?(:'id')
111
+ self.id = attributes[:'id']
112
+ end
113
+
114
+ if attributes.key?(:'inbox_id')
115
+ self.inbox_id = attributes[:'inbox_id']
116
+ end
117
+
118
+ if attributes.key?(:'match')
119
+ self.match = attributes[:'match']
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ invalid_properties = Array.new
127
+ if @created_at.nil?
128
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
129
+ end
130
+
131
+ if @field.nil?
132
+ invalid_properties.push('invalid value for "field", field cannot be nil.')
133
+ end
134
+
135
+ if @forward_to_recipients.nil?
136
+ invalid_properties.push('invalid value for "forward_to_recipients", forward_to_recipients cannot be nil.')
137
+ end
138
+
139
+ if @id.nil?
140
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
141
+ end
142
+
143
+ if @inbox_id.nil?
144
+ invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
145
+ end
146
+
147
+ if @match.nil?
148
+ invalid_properties.push('invalid value for "match", match cannot be nil.')
149
+ end
150
+
151
+ invalid_properties
152
+ end
153
+
154
+ # Check to see if the all the properties in the model are valid
155
+ # @return true if the model is valid
156
+ def valid?
157
+ return false if @created_at.nil?
158
+ return false if @field.nil?
159
+ field_validator = EnumAttributeValidator.new('String', ["RECIPIENTS", "SENDER", "SUBJECT", "ATTACHMENTS"])
160
+ return false unless field_validator.valid?(@field)
161
+ return false if @forward_to_recipients.nil?
162
+ return false if @id.nil?
163
+ return false if @inbox_id.nil?
164
+ return false if @match.nil?
165
+ true
166
+ end
167
+
168
+ # Custom attribute writer method checking allowed values (enum).
169
+ # @param [Object] field Object to be assigned
170
+ def field=(field)
171
+ validator = EnumAttributeValidator.new('String', ["RECIPIENTS", "SENDER", "SUBJECT", "ATTACHMENTS"])
172
+ unless validator.valid?(field)
173
+ fail ArgumentError, "invalid value for \"field\", must be one of #{validator.allowable_values}."
174
+ end
175
+ @field = field
176
+ end
177
+
178
+ # Checks equality by comparing each attribute.
179
+ # @param [Object] Object to be compared
180
+ def ==(o)
181
+ return true if self.equal?(o)
182
+ self.class == o.class &&
183
+ created_at == o.created_at &&
184
+ field == o.field &&
185
+ forward_to_recipients == o.forward_to_recipients &&
186
+ id == o.id &&
187
+ inbox_id == o.inbox_id &&
188
+ match == o.match
189
+ end
190
+
191
+ # @see the `==` method
192
+ # @param [Object] Object to be compared
193
+ def eql?(o)
194
+ self == o
195
+ end
196
+
197
+ # Calculates hash code according to all attributes.
198
+ # @return [Integer] Hash code
199
+ def hash
200
+ [created_at, field, forward_to_recipients, id, inbox_id, match].hash
201
+ end
202
+
203
+ # Builds the object from hash
204
+ # @param [Hash] attributes Model attributes in the form of hash
205
+ # @return [Object] Returns the model itself
206
+ def self.build_from_hash(attributes)
207
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
214
+ return nil unless attributes.is_a?(Hash)
215
+ self.class.openapi_types.each_pair do |key, type|
216
+ if type =~ /\AArray<(.*)>/i
217
+ # check to ensure the input is an array given that the attribute
218
+ # is documented as an array but the input is not
219
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
220
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
221
+ end
222
+ elsif !attributes[self.class.attribute_map[key]].nil?
223
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
224
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
225
+ end
226
+
227
+ self
228
+ end
229
+
230
+ # Deserializes the data based on type
231
+ # @param string type Data type
232
+ # @param string value Value to be deserialized
233
+ # @return [Object] Deserialized data
234
+ def _deserialize(type, value)
235
+ case type.to_sym
236
+ when :DateTime
237
+ DateTime.parse(value)
238
+ when :Date
239
+ Date.parse(value)
240
+ when :String
241
+ value.to_s
242
+ when :Integer
243
+ value.to_i
244
+ when :Float
245
+ value.to_f
246
+ when :Boolean
247
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
248
+ true
249
+ else
250
+ false
251
+ end
252
+ when :Object
253
+ # generic object (usually a Hash), return directly
254
+ value
255
+ when /\AArray<(?<inner_type>.+)>\z/
256
+ inner_type = Regexp.last_match[:inner_type]
257
+ value.map { |v| _deserialize(inner_type, v) }
258
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
259
+ k_type = Regexp.last_match[:k_type]
260
+ v_type = Regexp.last_match[:v_type]
261
+ {}.tap do |hash|
262
+ value.each do |k, v|
263
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
264
+ end
265
+ end
266
+ else # model
267
+ MailSlurpClient.const_get(type).build_from_hash(value)
268
+ end
269
+ end
270
+
271
+ # Returns the string representation of the object
272
+ # @return [String] String presentation of the object
273
+ def to_s
274
+ to_hash.to_s
275
+ end
276
+
277
+ # to_body is an alias to to_hash (backward compatibility)
278
+ # @return [Hash] Returns the object in the form of hash
279
+ def to_body
280
+ to_hash
281
+ end
282
+
283
+ # Returns the object in the form of hash
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_hash
286
+ hash = {}
287
+ self.class.attribute_map.each_pair do |attr, param|
288
+ value = self.send(attr)
289
+ if value.nil?
290
+ is_nullable = self.class.openapi_nullable.include?(attr)
291
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
292
+ end
293
+
294
+ hash[param] = _to_hash(value)
295
+ end
296
+ hash
297
+ end
298
+
299
+ # Outputs non-array value in the form of hash
300
+ # For object, use to_hash. Otherwise, just return the value
301
+ # @param [Object] value Any valid value
302
+ # @return [Hash] Returns the value in the form of hash
303
+ def _to_hash(value)
304
+ if value.is_a?(Array)
305
+ value.compact.map { |v| _to_hash(v) }
306
+ elsif value.is_a?(Hash)
307
+ {}.tap do |hash|
308
+ value.each { |k, v| hash[k] = _to_hash(v) }
309
+ end
310
+ elsif value.respond_to? :to_hash
311
+ value.to_hash
312
+ else
313
+ value
314
+ end
315
+ end
316
+ end
317
+ end