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
@@ -0,0 +1,227 @@
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 InboxForwarderTestResult
17
+ attr_accessor :does_match
18
+
19
+ attr_accessor :matches
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'does_match' => :'doesMatch',
25
+ :'matches' => :'matches'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'does_match' => :'Boolean',
33
+ :'matches' => :'Hash<String, Boolean>'
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::InboxForwarderTestResult` 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::InboxForwarderTestResult`. 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?(:'does_match')
59
+ self.does_match = attributes[:'does_match']
60
+ end
61
+
62
+ if attributes.key?(:'matches')
63
+ if (value = attributes[:'matches']).is_a?(Hash)
64
+ self.matches = value
65
+ end
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ if @does_match.nil?
74
+ invalid_properties.push('invalid value for "does_match", does_match cannot be nil.')
75
+ end
76
+
77
+ if @matches.nil?
78
+ invalid_properties.push('invalid value for "matches", matches cannot be nil.')
79
+ end
80
+
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ return false if @does_match.nil?
88
+ return false if @matches.nil?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ does_match == o.does_match &&
98
+ matches == o.matches
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Integer] Hash code
109
+ def hash
110
+ [does_match, matches].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def self.build_from_hash(attributes)
117
+ new.build_from_hash(attributes)
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ self.class.openapi_types.each_pair do |key, type|
126
+ if type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :DateTime
147
+ DateTime.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ MailSlurpClient.const_get(type).build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+ end
227
+ end
@@ -16,6 +16,8 @@ module MailSlurpClient
16
16
  class InboxRulesetDto
17
17
  attr_accessor :action
18
18
 
19
+ attr_accessor :created_at
20
+
19
21
  attr_accessor :handler
20
22
 
21
23
  attr_accessor :id
@@ -52,6 +54,7 @@ module MailSlurpClient
52
54
  def self.attribute_map
53
55
  {
54
56
  :'action' => :'action',
57
+ :'created_at' => :'createdAt',
55
58
  :'handler' => :'handler',
56
59
  :'id' => :'id',
57
60
  :'inbox_id' => :'inboxId',
@@ -64,6 +67,7 @@ module MailSlurpClient
64
67
  def self.openapi_types
65
68
  {
66
69
  :'action' => :'String',
70
+ :'created_at' => :'DateTime',
67
71
  :'handler' => :'String',
68
72
  :'id' => :'String',
69
73
  :'inbox_id' => :'String',
@@ -97,6 +101,10 @@ module MailSlurpClient
97
101
  self.action = attributes[:'action']
98
102
  end
99
103
 
104
+ if attributes.key?(:'created_at')
105
+ self.created_at = attributes[:'created_at']
106
+ end
107
+
100
108
  if attributes.key?(:'handler')
101
109
  self.handler = attributes[:'handler']
102
110
  end
@@ -126,6 +134,10 @@ module MailSlurpClient
126
134
  invalid_properties.push('invalid value for "action", action cannot be nil.')
127
135
  end
128
136
 
137
+ if @created_at.nil?
138
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
139
+ end
140
+
129
141
  if @handler.nil?
130
142
  invalid_properties.push('invalid value for "handler", handler cannot be nil.')
131
143
  end
@@ -153,8 +165,9 @@ module MailSlurpClient
153
165
  # @return true if the model is valid
154
166
  def valid?
155
167
  return false if @action.nil?
156
- action_validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FORWARD"])
168
+ action_validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FILTER_REMOVE"])
157
169
  return false unless action_validator.valid?(@action)
170
+ return false if @created_at.nil?
158
171
  return false if @handler.nil?
159
172
  handler_validator = EnumAttributeValidator.new('String', ["EXCEPTION"])
160
173
  return false unless handler_validator.valid?(@handler)
@@ -170,7 +183,7 @@ module MailSlurpClient
170
183
  # Custom attribute writer method checking allowed values (enum).
171
184
  # @param [Object] action Object to be assigned
172
185
  def action=(action)
173
- validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FORWARD"])
186
+ validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FILTER_REMOVE"])
174
187
  unless validator.valid?(action)
175
188
  fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
176
189
  end
@@ -203,6 +216,7 @@ module MailSlurpClient
203
216
  return true if self.equal?(o)
204
217
  self.class == o.class &&
205
218
  action == o.action &&
219
+ created_at == o.created_at &&
206
220
  handler == o.handler &&
207
221
  id == o.id &&
208
222
  inbox_id == o.inbox_id &&
@@ -219,7 +233,7 @@ module MailSlurpClient
219
233
  # Calculates hash code according to all attributes.
220
234
  # @return [Integer] Hash code
221
235
  def hash
222
- [action, handler, id, inbox_id, scope, target].hash
236
+ [action, created_at, handler, id, inbox_id, scope, target].hash
223
237
  end
224
238
 
225
239
  # Builds the object from hash
@@ -0,0 +1,211 @@
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 InboxRulesetTestOptions
17
+ attr_accessor :test_target
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'test_target' => :'testTarget'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.openapi_types
28
+ {
29
+ :'test_target' => :'String'
30
+ }
31
+ end
32
+
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new([
36
+ ])
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ if (!attributes.is_a?(Hash))
43
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::InboxRulesetTestOptions` initialize method"
44
+ end
45
+
46
+ # check to see if the attribute exists and convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h|
48
+ if (!self.class.attribute_map.key?(k.to_sym))
49
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::InboxRulesetTestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
+ end
51
+ h[k.to_sym] = v
52
+ }
53
+
54
+ if attributes.key?(:'test_target')
55
+ self.test_target = attributes[:'test_target']
56
+ end
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ if @test_target.nil?
64
+ invalid_properties.push('invalid value for "test_target", test_target cannot be nil.')
65
+ end
66
+
67
+ invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ return false if @test_target.nil?
74
+ true
75
+ end
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] Object to be compared
79
+ def ==(o)
80
+ return true if self.equal?(o)
81
+ self.class == o.class &&
82
+ test_target == o.test_target
83
+ end
84
+
85
+ # @see the `==` method
86
+ # @param [Object] Object to be compared
87
+ def eql?(o)
88
+ self == o
89
+ end
90
+
91
+ # Calculates hash code according to all attributes.
92
+ # @return [Integer] Hash code
93
+ def hash
94
+ [test_target].hash
95
+ end
96
+
97
+ # Builds the object from hash
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ # @return [Object] Returns the model itself
100
+ def self.build_from_hash(attributes)
101
+ new.build_from_hash(attributes)
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def build_from_hash(attributes)
108
+ return nil unless attributes.is_a?(Hash)
109
+ self.class.openapi_types.each_pair do |key, type|
110
+ if type =~ /\AArray<(.*)>/i
111
+ # check to ensure the input is an array given that the attribute
112
+ # is documented as an array but the input is not
113
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
114
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
115
+ end
116
+ elsif !attributes[self.class.attribute_map[key]].nil?
117
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
118
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
119
+ end
120
+
121
+ self
122
+ end
123
+
124
+ # Deserializes the data based on type
125
+ # @param string type Data type
126
+ # @param string value Value to be deserialized
127
+ # @return [Object] Deserialized data
128
+ def _deserialize(type, value)
129
+ case type.to_sym
130
+ when :DateTime
131
+ DateTime.parse(value)
132
+ when :Date
133
+ Date.parse(value)
134
+ when :String
135
+ value.to_s
136
+ when :Integer
137
+ value.to_i
138
+ when :Float
139
+ value.to_f
140
+ when :Boolean
141
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
+ true
143
+ else
144
+ false
145
+ end
146
+ when :Object
147
+ # generic object (usually a Hash), return directly
148
+ value
149
+ when /\AArray<(?<inner_type>.+)>\z/
150
+ inner_type = Regexp.last_match[:inner_type]
151
+ value.map { |v| _deserialize(inner_type, v) }
152
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
+ k_type = Regexp.last_match[:k_type]
154
+ v_type = Regexp.last_match[:v_type]
155
+ {}.tap do |hash|
156
+ value.each do |k, v|
157
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
158
+ end
159
+ end
160
+ else # model
161
+ MailSlurpClient.const_get(type).build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ if value.nil?
184
+ is_nullable = self.class.openapi_nullable.include?(attr)
185
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
186
+ end
187
+
188
+ hash[param] = _to_hash(value)
189
+ end
190
+ hash
191
+ end
192
+
193
+ # Outputs non-array value in the form of hash
194
+ # For object, use to_hash. Otherwise, just return the value
195
+ # @param [Object] value Any valid value
196
+ # @return [Hash] Returns the value in the form of hash
197
+ def _to_hash(value)
198
+ if value.is_a?(Array)
199
+ value.compact.map { |v| _to_hash(v) }
200
+ elsif value.is_a?(Hash)
201
+ {}.tap do |hash|
202
+ value.each { |k, v| hash[k] = _to_hash(v) }
203
+ end
204
+ elsif value.respond_to? :to_hash
205
+ value.to_hash
206
+ else
207
+ value
208
+ end
209
+ end
210
+ end
211
+ end