mailslurp_client 15.12.15 → 15.12.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/bounce_controller_api.rb +79 -0
  3. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +212 -0
  4. data/lib/mailslurp_client/api/webhook_controller_api.rb +3 -0
  5. data/lib/mailslurp_client/models/alias_projection.rb +15 -15
  6. data/lib/mailslurp_client/models/attachment_projection.rb +14 -14
  7. data/lib/mailslurp_client/models/bounce_projection.rb +13 -13
  8. data/lib/mailslurp_client/models/bounce_recipient_projection.rb +13 -13
  9. data/lib/mailslurp_client/models/complaint.rb +289 -0
  10. data/lib/mailslurp_client/models/create_webhook_options.rb +0 -5
  11. data/lib/mailslurp_client/models/delivery_status.rb +331 -0
  12. data/lib/mailslurp_client/models/email_projection.rb +10 -10
  13. data/lib/mailslurp_client/models/missed_email_projection.rb +10 -10
  14. data/lib/mailslurp_client/models/page_alias.rb +22 -22
  15. data/lib/mailslurp_client/models/page_attachment_entity.rb +22 -22
  16. data/lib/mailslurp_client/models/page_bounced_email.rb +22 -22
  17. data/lib/mailslurp_client/models/page_bounced_recipients.rb +22 -22
  18. data/lib/mailslurp_client/models/page_complaint.rb +308 -0
  19. data/lib/mailslurp_client/models/page_contact_projection.rb +22 -22
  20. data/lib/mailslurp_client/models/page_delivery_status.rb +308 -0
  21. data/lib/mailslurp_client/models/page_email_preview.rb +22 -22
  22. data/lib/mailslurp_client/models/page_email_projection.rb +22 -22
  23. data/lib/mailslurp_client/models/page_email_validation_request.rb +22 -22
  24. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +22 -22
  25. data/lib/mailslurp_client/models/page_group_projection.rb +22 -22
  26. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +22 -22
  27. data/lib/mailslurp_client/models/page_inbox_projection.rb +22 -22
  28. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +22 -22
  29. data/lib/mailslurp_client/models/page_missed_email_projection.rb +22 -22
  30. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +22 -22
  31. data/lib/mailslurp_client/models/page_phone_number_projection.rb +22 -22
  32. data/lib/mailslurp_client/models/page_sent_email_projection.rb +16 -16
  33. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +16 -16
  34. data/lib/mailslurp_client/models/page_sms_projection.rb +22 -22
  35. data/lib/mailslurp_client/models/page_template_projection.rb +22 -22
  36. data/lib/mailslurp_client/models/page_thread_projection.rb +22 -22
  37. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +22 -22
  38. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +22 -22
  39. data/lib/mailslurp_client/models/page_webhook_projection.rb +22 -22
  40. data/lib/mailslurp_client/models/page_webhook_result.rb +22 -22
  41. data/lib/mailslurp_client/models/sent_email_projection.rb +18 -18
  42. data/lib/mailslurp_client/models/thread_projection.rb +20 -20
  43. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +19 -19
  44. data/lib/mailslurp_client/version.rb +1 -1
  45. data/lib/mailslurp_client.rb +4 -0
  46. metadata +9 -5
@@ -17,6 +17,8 @@ module MailSlurpClient
17
17
  class BounceRecipientProjection
18
18
  attr_accessor :id
19
19
 
20
+ attr_accessor :action
21
+
20
22
  attr_accessor :status
21
23
 
22
24
  attr_accessor :sent_email_id
@@ -25,17 +27,15 @@ module MailSlurpClient
25
27
 
26
28
  attr_accessor :recipient
27
29
 
28
- attr_accessor :action
29
-
30
30
  # Attribute mapping from ruby-style variable name to JSON key.
31
31
  def self.attribute_map
32
32
  {
33
33
  :'id' => :'id',
34
+ :'action' => :'action',
34
35
  :'status' => :'status',
35
36
  :'sent_email_id' => :'sentEmailId',
36
37
  :'created_at' => :'createdAt',
37
- :'recipient' => :'recipient',
38
- :'action' => :'action'
38
+ :'recipient' => :'recipient'
39
39
  }
40
40
  end
41
41
 
@@ -43,11 +43,11 @@ module MailSlurpClient
43
43
  def self.openapi_types
44
44
  {
45
45
  :'id' => :'String',
46
+ :'action' => :'String',
46
47
  :'status' => :'String',
47
48
  :'sent_email_id' => :'String',
48
49
  :'created_at' => :'DateTime',
49
- :'recipient' => :'String',
50
- :'action' => :'String'
50
+ :'recipient' => :'String'
51
51
  }
52
52
  end
53
53
 
@@ -76,6 +76,10 @@ module MailSlurpClient
76
76
  self.id = attributes[:'id']
77
77
  end
78
78
 
79
+ if attributes.key?(:'action')
80
+ self.action = attributes[:'action']
81
+ end
82
+
79
83
  if attributes.key?(:'status')
80
84
  self.status = attributes[:'status']
81
85
  end
@@ -91,10 +95,6 @@ module MailSlurpClient
91
95
  if attributes.key?(:'recipient')
92
96
  self.recipient = attributes[:'recipient']
93
97
  end
94
-
95
- if attributes.key?(:'action')
96
- self.action = attributes[:'action']
97
- end
98
98
  end
99
99
 
100
100
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -126,11 +126,11 @@ module MailSlurpClient
126
126
  return true if self.equal?(o)
127
127
  self.class == o.class &&
128
128
  id == o.id &&
129
+ action == o.action &&
129
130
  status == o.status &&
130
131
  sent_email_id == o.sent_email_id &&
131
132
  created_at == o.created_at &&
132
- recipient == o.recipient &&
133
- action == o.action
133
+ recipient == o.recipient
134
134
  end
135
135
 
136
136
  # @see the `==` method
@@ -142,7 +142,7 @@ module MailSlurpClient
142
142
  # Calculates hash code according to all attributes.
143
143
  # @return [Integer] Hash code
144
144
  def hash
145
- [id, status, sent_email_id, created_at, recipient, action].hash
145
+ [id, action, status, sent_email_id, created_at, recipient].hash
146
146
  end
147
147
 
148
148
  # Builds the object from hash
@@ -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://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
5
+
6
+ The version of the OpenAPI document: 6.5.2
7
+ Contact: contact@mailslurp.dev
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 Complaint
17
+ attr_accessor :id
18
+
19
+ attr_accessor :user_id
20
+
21
+ attr_accessor :event_type
22
+
23
+ attr_accessor :mail_source
24
+
25
+ attr_accessor :mail_message_id
26
+
27
+ attr_accessor :complaint_recipient
28
+
29
+ attr_accessor :created_at
30
+
31
+ attr_accessor :updated_at
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'id' => :'id',
37
+ :'user_id' => :'userId',
38
+ :'event_type' => :'eventType',
39
+ :'mail_source' => :'mailSource',
40
+ :'mail_message_id' => :'mailMessageId',
41
+ :'complaint_recipient' => :'complaintRecipient',
42
+ :'created_at' => :'createdAt',
43
+ :'updated_at' => :'updatedAt'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'id' => :'String',
51
+ :'user_id' => :'String',
52
+ :'event_type' => :'String',
53
+ :'mail_source' => :'String',
54
+ :'mail_message_id' => :'String',
55
+ :'complaint_recipient' => :'String',
56
+ :'created_at' => :'DateTime',
57
+ :'updated_at' => :'DateTime'
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::Complaint` 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::Complaint`. 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?(:'id')
83
+ self.id = attributes[:'id']
84
+ end
85
+
86
+ if attributes.key?(:'user_id')
87
+ self.user_id = attributes[:'user_id']
88
+ end
89
+
90
+ if attributes.key?(:'event_type')
91
+ self.event_type = attributes[:'event_type']
92
+ end
93
+
94
+ if attributes.key?(:'mail_source')
95
+ self.mail_source = attributes[:'mail_source']
96
+ end
97
+
98
+ if attributes.key?(:'mail_message_id')
99
+ self.mail_message_id = attributes[:'mail_message_id']
100
+ end
101
+
102
+ if attributes.key?(:'complaint_recipient')
103
+ self.complaint_recipient = attributes[:'complaint_recipient']
104
+ end
105
+
106
+ if attributes.key?(:'created_at')
107
+ self.created_at = attributes[:'created_at']
108
+ end
109
+
110
+ if attributes.key?(:'updated_at')
111
+ self.updated_at = attributes[:'updated_at']
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 @id.nil?
120
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
121
+ end
122
+
123
+ if @complaint_recipient.nil?
124
+ invalid_properties.push('invalid value for "complaint_recipient", complaint_recipient cannot be nil.')
125
+ end
126
+
127
+ if @created_at.nil?
128
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
129
+ end
130
+
131
+ if @updated_at.nil?
132
+ invalid_properties.push('invalid value for "updated_at", updated_at 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 @id.nil?
142
+ return false if @complaint_recipient.nil?
143
+ return false if @created_at.nil?
144
+ return false if @updated_at.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
+ id == o.id &&
154
+ user_id == o.user_id &&
155
+ event_type == o.event_type &&
156
+ mail_source == o.mail_source &&
157
+ mail_message_id == o.mail_message_id &&
158
+ complaint_recipient == o.complaint_recipient &&
159
+ created_at == o.created_at &&
160
+ updated_at == o.updated_at
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
+ [id, user_id, event_type, mail_source, mail_message_id, complaint_recipient, created_at, updated_at].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
@@ -123,10 +123,6 @@ module MailSlurpClient
123
123
  invalid_properties.push('invalid value for "url", url cannot be nil.')
124
124
  end
125
125
 
126
- if @event_name.nil?
127
- invalid_properties.push('invalid value for "event_name", event_name cannot be nil.')
128
- end
129
-
130
126
  invalid_properties
131
127
  end
132
128
 
@@ -134,7 +130,6 @@ module MailSlurpClient
134
130
  # @return true if the model is valid
135
131
  def valid?
136
132
  return false if @url.nil?
137
- return false if @event_name.nil?
138
133
  event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
139
134
  return false unless event_name_validator.valid?(@event_name)
140
135
  true