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
@@ -0,0 +1,225 @@
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 TestNewInboxForwarderOptions
17
+ attr_accessor :inbox_forwarder_test_options
18
+
19
+ attr_accessor :create_inbox_forwarder_options
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'inbox_forwarder_test_options' => :'inboxForwarderTestOptions',
25
+ :'create_inbox_forwarder_options' => :'createInboxForwarderOptions'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'inbox_forwarder_test_options' => :'InboxForwarderTestOptions',
33
+ :'create_inbox_forwarder_options' => :'CreateInboxForwarderOptions'
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::TestNewInboxForwarderOptions` 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::TestNewInboxForwarderOptions`. 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?(:'inbox_forwarder_test_options')
59
+ self.inbox_forwarder_test_options = attributes[:'inbox_forwarder_test_options']
60
+ end
61
+
62
+ if attributes.key?(:'create_inbox_forwarder_options')
63
+ self.create_inbox_forwarder_options = attributes[:'create_inbox_forwarder_options']
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
+ if @inbox_forwarder_test_options.nil?
72
+ invalid_properties.push('invalid value for "inbox_forwarder_test_options", inbox_forwarder_test_options cannot be nil.')
73
+ end
74
+
75
+ if @create_inbox_forwarder_options.nil?
76
+ invalid_properties.push('invalid value for "create_inbox_forwarder_options", create_inbox_forwarder_options cannot be nil.')
77
+ end
78
+
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ return false if @inbox_forwarder_test_options.nil?
86
+ return false if @create_inbox_forwarder_options.nil?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ inbox_forwarder_test_options == o.inbox_forwarder_test_options &&
96
+ create_inbox_forwarder_options == o.create_inbox_forwarder_options
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [inbox_forwarder_test_options, create_inbox_forwarder_options].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.openapi_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :Boolean
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ MailSlurpClient.const_get(type).build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.openapi_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+ end
225
+ end
@@ -28,6 +28,8 @@ module MailSlurpClient
28
28
 
29
29
  attr_accessor :seen_at
30
30
 
31
+ attr_accessor :sent_email_id
32
+
31
33
  attr_accessor :user_id
32
34
 
33
35
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -40,6 +42,7 @@ module MailSlurpClient
40
42
  :'recipient' => :'recipient',
41
43
  :'seen' => :'seen',
42
44
  :'seen_at' => :'seenAt',
45
+ :'sent_email_id' => :'sentEmailId',
43
46
  :'user_id' => :'userId'
44
47
  }
45
48
  end
@@ -54,6 +57,7 @@ module MailSlurpClient
54
57
  :'recipient' => :'String',
55
58
  :'seen' => :'Boolean',
56
59
  :'seen_at' => :'DateTime',
60
+ :'sent_email_id' => :'String',
57
61
  :'user_id' => :'String'
58
62
  }
59
63
  end
@@ -107,6 +111,10 @@ module MailSlurpClient
107
111
  self.seen_at = attributes[:'seen_at']
108
112
  end
109
113
 
114
+ if attributes.key?(:'sent_email_id')
115
+ self.sent_email_id = attributes[:'sent_email_id']
116
+ end
117
+
110
118
  if attributes.key?(:'user_id')
111
119
  self.user_id = attributes[:'user_id']
112
120
  end
@@ -157,6 +165,7 @@ module MailSlurpClient
157
165
  recipient == o.recipient &&
158
166
  seen == o.seen &&
159
167
  seen_at == o.seen_at &&
168
+ sent_email_id == o.sent_email_id &&
160
169
  user_id == o.user_id
161
170
  end
162
171
 
@@ -169,7 +178,7 @@ module MailSlurpClient
169
178
  # Calculates hash code according to all attributes.
170
179
  # @return [Integer] Hash code
171
180
  def hash
172
- [created_at, id, inbox_id, name, recipient, seen, seen_at, user_id].hash
181
+ [created_at, id, inbox_id, name, recipient, seen, seen_at, sent_email_id, user_id].hash
173
182
  end
174
183
 
175
184
  # Builds the object from hash
@@ -17,6 +17,8 @@ module MailSlurpClient
17
17
  class WebhookProjection
18
18
  attr_accessor :created_at
19
19
 
20
+ attr_accessor :event_name
21
+
20
22
  attr_accessor :id
21
23
 
22
24
  attr_accessor :inbox_id
@@ -27,10 +29,33 @@ module MailSlurpClient
27
29
 
28
30
  attr_accessor :url
29
31
 
32
+ class EnumAttributeValidator
33
+ attr_reader :datatype
34
+ attr_reader :allowable_values
35
+
36
+ def initialize(datatype, allowable_values)
37
+ @allowable_values = allowable_values.map do |value|
38
+ case datatype.to_s
39
+ when /Integer/i
40
+ value.to_i
41
+ when /Float/i
42
+ value.to_f
43
+ else
44
+ value
45
+ end
46
+ end
47
+ end
48
+
49
+ def valid?(value)
50
+ !value || allowable_values.include?(value)
51
+ end
52
+ end
53
+
30
54
  # Attribute mapping from ruby-style variable name to JSON key.
31
55
  def self.attribute_map
32
56
  {
33
57
  :'created_at' => :'createdAt',
58
+ :'event_name' => :'eventName',
34
59
  :'id' => :'id',
35
60
  :'inbox_id' => :'inboxId',
36
61
  :'name' => :'name',
@@ -43,6 +68,7 @@ module MailSlurpClient
43
68
  def self.openapi_types
44
69
  {
45
70
  :'created_at' => :'DateTime',
71
+ :'event_name' => :'String',
46
72
  :'id' => :'String',
47
73
  :'inbox_id' => :'String',
48
74
  :'name' => :'String',
@@ -76,6 +102,10 @@ module MailSlurpClient
76
102
  self.created_at = attributes[:'created_at']
77
103
  end
78
104
 
105
+ if attributes.key?(:'event_name')
106
+ self.event_name = attributes[:'event_name']
107
+ end
108
+
79
109
  if attributes.key?(:'id')
80
110
  self.id = attributes[:'id']
81
111
  end
@@ -128,6 +158,8 @@ module MailSlurpClient
128
158
  # @return true if the model is valid
129
159
  def valid?
130
160
  return false if @created_at.nil?
161
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
162
+ return false unless event_name_validator.valid?(@event_name)
131
163
  return false if @id.nil?
132
164
  return false if @inbox_id.nil?
133
165
  return false if @updated_at.nil?
@@ -135,12 +167,23 @@ module MailSlurpClient
135
167
  true
136
168
  end
137
169
 
170
+ # Custom attribute writer method checking allowed values (enum).
171
+ # @param [Object] event_name Object to be assigned
172
+ def event_name=(event_name)
173
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
174
+ unless validator.valid?(event_name)
175
+ fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
176
+ end
177
+ @event_name = event_name
178
+ end
179
+
138
180
  # Checks equality by comparing each attribute.
139
181
  # @param [Object] Object to be compared
140
182
  def ==(o)
141
183
  return true if self.equal?(o)
142
184
  self.class == o.class &&
143
185
  created_at == o.created_at &&
186
+ event_name == o.event_name &&
144
187
  id == o.id &&
145
188
  inbox_id == o.inbox_id &&
146
189
  name == o.name &&
@@ -157,7 +200,7 @@ module MailSlurpClient
157
200
  # Calculates hash code according to all attributes.
158
201
  # @return [Integer] Hash code
159
202
  def hash
160
- [created_at, id, inbox_id, name, updated_at, url].hash
203
+ [created_at, event_name, id, inbox_id, name, updated_at, url].hash
161
204
  end
162
205
 
163
206
  # Builds the object from hash
@@ -30,6 +30,8 @@ module MailSlurpClient
30
30
 
31
31
  attr_accessor :response_time_millis
32
32
 
33
+ attr_accessor :result_type
34
+
33
35
  attr_accessor :updated_at
34
36
 
35
37
  attr_accessor :user_id
@@ -73,6 +75,7 @@ module MailSlurpClient
73
75
  :'response_body_extract' => :'responseBodyExtract',
74
76
  :'response_status' => :'responseStatus',
75
77
  :'response_time_millis' => :'responseTimeMillis',
78
+ :'result_type' => :'resultType',
76
79
  :'updated_at' => :'updatedAt',
77
80
  :'user_id' => :'userId',
78
81
  :'webhook_event' => :'webhookEvent',
@@ -92,6 +95,7 @@ module MailSlurpClient
92
95
  :'response_body_extract' => :'String',
93
96
  :'response_status' => :'Integer',
94
97
  :'response_time_millis' => :'Integer',
98
+ :'result_type' => :'String',
95
99
  :'updated_at' => :'DateTime',
96
100
  :'user_id' => :'String',
97
101
  :'webhook_event' => :'String',
@@ -153,6 +157,10 @@ module MailSlurpClient
153
157
  self.response_time_millis = attributes[:'response_time_millis']
154
158
  end
155
159
 
160
+ if attributes.key?(:'result_type')
161
+ self.result_type = attributes[:'result_type']
162
+ end
163
+
156
164
  if attributes.key?(:'updated_at')
157
165
  self.updated_at = attributes[:'updated_at']
158
166
  end
@@ -231,6 +239,8 @@ module MailSlurpClient
231
239
  return false if @inbox_id.nil?
232
240
  return false if @message_id.nil?
233
241
  return false if @response_time_millis.nil?
242
+ result_type_validator = EnumAttributeValidator.new('String', ["BAD_RESPONSE", "EXCEPTION", "SUCCESS"])
243
+ return false unless result_type_validator.valid?(@result_type)
234
244
  return false if @updated_at.nil?
235
245
  return false if @user_id.nil?
236
246
  return false if @webhook_event.nil?
@@ -251,6 +261,16 @@ module MailSlurpClient
251
261
  @http_method = http_method
252
262
  end
253
263
 
264
+ # Custom attribute writer method checking allowed values (enum).
265
+ # @param [Object] result_type Object to be assigned
266
+ def result_type=(result_type)
267
+ validator = EnumAttributeValidator.new('String', ["BAD_RESPONSE", "EXCEPTION", "SUCCESS"])
268
+ unless validator.valid?(result_type)
269
+ fail ArgumentError, "invalid value for \"result_type\", must be one of #{validator.allowable_values}."
270
+ end
271
+ @result_type = result_type
272
+ end
273
+
254
274
  # Custom attribute writer method checking allowed values (enum).
255
275
  # @param [Object] webhook_event Object to be assigned
256
276
  def webhook_event=(webhook_event)
@@ -274,6 +294,7 @@ module MailSlurpClient
274
294
  response_body_extract == o.response_body_extract &&
275
295
  response_status == o.response_status &&
276
296
  response_time_millis == o.response_time_millis &&
297
+ result_type == o.result_type &&
277
298
  updated_at == o.updated_at &&
278
299
  user_id == o.user_id &&
279
300
  webhook_event == o.webhook_event &&
@@ -290,7 +311,7 @@ module MailSlurpClient
290
311
  # Calculates hash code according to all attributes.
291
312
  # @return [Integer] Hash code
292
313
  def hash
293
- [created_at, http_method, id, inbox_id, message_id, response_body_extract, response_status, response_time_millis, updated_at, user_id, webhook_event, webhook_id, webhook_url].hash
314
+ [created_at, http_method, id, inbox_id, message_id, response_body_extract, response_status, response_time_millis, result_type, updated_at, user_id, webhook_event, webhook_id, webhook_url].hash
294
315
  end
295
316
 
296
317
  # Builds the object from hash