mailslurp_client 12.4.5 → 12.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client.rb +12 -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 +152 -8
  7. data/lib/mailslurp_client/api/inbox_ruleset_controller_api.rb +548 -0
  8. data/lib/mailslurp_client/api/missed_email_controller_api.rb +81 -7
  9. data/lib/mailslurp_client/api/template_controller_api.rb +4 -4
  10. data/lib/mailslurp_client/api/tracking_controller_api.rb +215 -0
  11. data/lib/mailslurp_client/api/wait_for_controller_api.rb +2 -2
  12. data/lib/mailslurp_client/models/create_inbox_ruleset_options.rb +274 -0
  13. data/lib/mailslurp_client/models/create_tracking_pixel_options.rb +215 -0
  14. data/lib/mailslurp_client/models/inbox_ruleset_dto.rb +353 -0
  15. data/lib/mailslurp_client/models/inbox_ruleset_test_options.rb +211 -0
  16. data/lib/mailslurp_client/models/inbox_ruleset_test_result.rb +223 -0
  17. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +299 -0
  18. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +299 -0
  19. data/lib/mailslurp_client/models/send_email_options.rb +11 -1
  20. data/lib/mailslurp_client/models/sent_email_dto.rb +12 -1
  21. data/lib/mailslurp_client/models/test_new_inbox_ruleset_options.rb +225 -0
  22. data/lib/mailslurp_client/models/tracking_pixel_dto.rb +262 -0
  23. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +262 -0
  24. data/lib/mailslurp_client/version.rb +1 -1
  25. metadata +14 -2
@@ -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
@@ -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