mailslurp_client 12.5.0 → 12.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client.rb +17 -2
  3. data/lib/mailslurp_client/api/contact_controller_api.rb +4 -4
  4. data/lib/mailslurp_client/api/email_controller_api.rb +71 -5
  5. data/lib/mailslurp_client/api/group_controller_api.rb +4 -4
  6. data/lib/mailslurp_client/api/inbox_controller_api.rb +107 -22
  7. data/lib/mailslurp_client/api/inbox_forwarder_controller_api.rb +548 -0
  8. data/lib/mailslurp_client/api/inbox_ruleset_controller_api.rb +211 -3
  9. data/lib/mailslurp_client/api/missed_email_controller_api.rb +75 -7
  10. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +150 -4
  11. data/lib/mailslurp_client/api/template_controller_api.rb +4 -4
  12. data/lib/mailslurp_client/api/tracking_controller_api.rb +218 -0
  13. data/lib/mailslurp_client/api/wait_for_controller_api.rb +2 -2
  14. data/lib/mailslurp_client/api/webhook_controller_api.rb +55 -1
  15. data/lib/mailslurp_client/models/abstract_webhook_payload.rb +3 -3
  16. data/lib/mailslurp_client/models/create_inbox_forwarder_options.rb +275 -0
  17. data/lib/mailslurp_client/models/create_inbox_ruleset_options.rb +4 -4
  18. data/lib/mailslurp_client/models/create_tracking_pixel_options.rb +215 -0
  19. data/lib/mailslurp_client/models/create_webhook_options.rb +3 -3
  20. data/lib/mailslurp_client/models/domain_preview.rb +66 -4
  21. data/lib/mailslurp_client/models/email.rb +11 -1
  22. data/lib/mailslurp_client/models/email_projection.rb +10 -1
  23. data/lib/mailslurp_client/models/{inbox_ruleset_projection.rb → inbox_forwarder_dto.rb} +55 -78
  24. data/lib/mailslurp_client/models/inbox_forwarder_test_options.rb +211 -0
  25. data/lib/mailslurp_client/models/inbox_forwarder_test_result.rb +227 -0
  26. data/lib/mailslurp_client/models/inbox_ruleset_dto.rb +17 -3
  27. data/lib/mailslurp_client/models/inbox_ruleset_test_options.rb +211 -0
  28. data/lib/mailslurp_client/models/inbox_ruleset_test_result.rb +223 -0
  29. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +299 -0
  30. data/lib/mailslurp_client/models/{page_inbox_ruleset_projection.rb → page_inbox_ruleset_dto.rb} +4 -4
  31. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +299 -0
  32. data/lib/mailslurp_client/models/send_email_options.rb +11 -1
  33. data/lib/mailslurp_client/models/sent_email_dto.rb +12 -1
  34. data/lib/mailslurp_client/models/test_new_inbox_forwarder_options.rb +225 -0
  35. data/lib/mailslurp_client/models/test_new_inbox_ruleset_options.rb +225 -0
  36. data/lib/mailslurp_client/models/tracking_pixel_dto.rb +303 -0
  37. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +289 -0
  38. data/lib/mailslurp_client/models/webhook_dto.rb +2 -2
  39. data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +322 -0
  40. data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +2 -2
  41. data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +2 -2
  42. data/lib/mailslurp_client/models/webhook_new_email_payload.rb +2 -2
  43. data/lib/mailslurp_client/models/webhook_result_entity.rb +2 -2
  44. data/lib/mailslurp_client/version.rb +1 -1
  45. metadata +19 -4
@@ -13,9 +13,9 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
- # Options for creating inbox rulesets. Inbox rulesets can be used to block, allow, or forward emails when sending or receiving using the inbox.
16
+ # Options for creating inbox rulesets. Inbox rulesets can be used to block, allow, filter, or forward emails when sending or receiving using the inbox.
17
17
  class CreateInboxRulesetOptions
18
- # Action to be taken when the ruleset matches an email for the given scope. For example: `BLOCK` action with target `*` and scope `SENDING_EMAILS` blocks sending to all recipients. Note `ALLOW` takes precedent over `BLOCK`.
18
+ # Action to be taken when the ruleset matches an email for the given scope. For example: `BLOCK` action with target `*` and scope `SENDING_EMAILS` blocks sending to all recipients. Note `ALLOW` takes precedent over `BLOCK`. `FILTER_REMOVE` is like block but will remove offending email addresses during a send or receive event instead of blocking the action.
19
19
  attr_accessor :action
20
20
 
21
21
  # What type of emails actions to apply ruleset to. Either `SENDING_EMAILS` or `RECEIVING_EMAILS` will apply action and target to any sending or receiving of emails respectively.
@@ -108,7 +108,7 @@ module MailSlurpClient
108
108
  # Check to see if the all the properties in the model are valid
109
109
  # @return true if the model is valid
110
110
  def valid?
111
- action_validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FORWARD"])
111
+ action_validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FILTER_REMOVE"])
112
112
  return false unless action_validator.valid?(@action)
113
113
  scope_validator = EnumAttributeValidator.new('String', ["RECEIVING_EMAILS", "SENDING_EMAILS"])
114
114
  return false unless scope_validator.valid?(@scope)
@@ -118,7 +118,7 @@ module MailSlurpClient
118
118
  # Custom attribute writer method checking allowed values (enum).
119
119
  # @param [Object] action Object to be assigned
120
120
  def action=(action)
121
- validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FORWARD"])
121
+ validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FILTER_REMOVE"])
122
122
  unless validator.valid?(action)
123
123
  fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
124
124
  end
@@ -0,0 +1,215 @@
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 CreateTrackingPixelOptions
17
+ attr_accessor :name
18
+
19
+ attr_accessor :recipient
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'name' => :'name',
25
+ :'recipient' => :'recipient'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'name' => :'String',
33
+ :'recipient' => :'String'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CreateTrackingPixelOptions` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::CreateTrackingPixelOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'name')
59
+ self.name = attributes[:'name']
60
+ end
61
+
62
+ if attributes.key?(:'recipient')
63
+ self.recipient = attributes[:'recipient']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ name == o.name &&
86
+ recipient == o.recipient
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [name, recipient].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :DateTime
135
+ DateTime.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ MailSlurpClient.const_get(type).build_from_hash(value)
166
+ end
167
+ end
168
+
169
+ # Returns the string representation of the object
170
+ # @return [String] String presentation of the object
171
+ def to_s
172
+ to_hash.to_s
173
+ end
174
+
175
+ # to_body is an alias to to_hash (backward compatibility)
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_body
178
+ to_hash
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ if value.nil?
188
+ is_nullable = self.class.openapi_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+ end
215
+ end
@@ -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
@@ -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