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