mailslurp_client 15.12.13 → 15.12.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/api_user_controller_api.rb +104 -0
  3. data/lib/mailslurp_client/api/bounce_controller_api.rb +79 -0
  4. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +212 -0
  5. data/lib/mailslurp_client/api/webhook_controller_api.rb +71 -0
  6. data/lib/mailslurp_client/models/alias_projection.rb +15 -15
  7. data/lib/mailslurp_client/models/complaint.rb +289 -0
  8. data/lib/mailslurp_client/models/create_contact_options.rb +7 -0
  9. data/lib/mailslurp_client/models/create_domain_options.rb +3 -0
  10. data/lib/mailslurp_client/models/create_inbox_dto.rb +10 -0
  11. data/lib/mailslurp_client/models/create_webhook_options.rb +17 -7
  12. data/lib/mailslurp_client/models/delivery_status.rb +331 -0
  13. data/lib/mailslurp_client/models/email.rb +15 -0
  14. data/lib/mailslurp_client/models/email_analysis.rb +5 -0
  15. data/lib/mailslurp_client/models/email_preview.rb +6 -5
  16. data/lib/mailslurp_client/models/email_projection.rb +10 -10
  17. data/lib/mailslurp_client/models/inbox_dto.rb +2 -0
  18. data/lib/mailslurp_client/models/inbox_preview.rb +5 -0
  19. data/lib/mailslurp_client/models/missed_email_projection.rb +10 -10
  20. data/lib/mailslurp_client/models/organization_inbox_projection.rb +4 -0
  21. data/lib/mailslurp_client/models/page_alias.rb +10 -10
  22. data/lib/mailslurp_client/models/page_attachment_entity.rb +10 -10
  23. data/lib/mailslurp_client/models/page_bounced_email.rb +10 -10
  24. data/lib/mailslurp_client/models/page_bounced_recipients.rb +10 -10
  25. data/lib/mailslurp_client/models/page_complaint.rb +308 -0
  26. data/lib/mailslurp_client/models/page_contact_projection.rb +10 -10
  27. data/lib/mailslurp_client/models/page_delivery_status.rb +308 -0
  28. data/lib/mailslurp_client/models/page_email_preview.rb +10 -10
  29. data/lib/mailslurp_client/models/page_email_projection.rb +10 -10
  30. data/lib/mailslurp_client/models/page_email_validation_request.rb +10 -10
  31. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +10 -10
  32. data/lib/mailslurp_client/models/page_group_projection.rb +10 -10
  33. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +10 -10
  34. data/lib/mailslurp_client/models/page_inbox_projection.rb +10 -10
  35. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +10 -10
  36. data/lib/mailslurp_client/models/page_missed_email_projection.rb +10 -10
  37. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +10 -10
  38. data/lib/mailslurp_client/models/page_phone_number_projection.rb +10 -10
  39. data/lib/mailslurp_client/models/page_sent_email_projection.rb +16 -16
  40. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +16 -16
  41. data/lib/mailslurp_client/models/page_sms_projection.rb +10 -10
  42. data/lib/mailslurp_client/models/page_template_projection.rb +10 -10
  43. data/lib/mailslurp_client/models/page_thread_projection.rb +10 -10
  44. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +10 -10
  45. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +10 -10
  46. data/lib/mailslurp_client/models/page_webhook_projection.rb +10 -10
  47. data/lib/mailslurp_client/models/page_webhook_result.rb +10 -10
  48. data/lib/mailslurp_client/models/sent_email_dto.rb +52 -1
  49. data/lib/mailslurp_client/models/sent_email_projection.rb +59 -59
  50. data/lib/mailslurp_client/models/thread_projection.rb +20 -20
  51. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -10
  52. data/lib/mailslurp_client/models/update_inbox_options.rb +5 -0
  53. data/lib/mailslurp_client/models/upload_attachment_options.rb +2 -0
  54. data/lib/mailslurp_client/models/webhook_dto.rb +18 -9
  55. data/lib/mailslurp_client/models/webhook_header_name_value.rb +228 -0
  56. data/lib/mailslurp_client/models/webhook_headers.rb +215 -0
  57. data/lib/mailslurp_client/version.rb +1 -1
  58. data/lib/mailslurp_client.rb +6 -0
  59. metadata +11 -5
@@ -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
@@ -66,6 +66,13 @@ module MailSlurpClient
66
66
  # List of attributes with nullable: true
67
67
  def self.openapi_nullable
68
68
  Set.new([
69
+ :'first_name',
70
+ :'last_name',
71
+ :'company',
72
+ :'email_addresses',
73
+ :'tags',
74
+ :'opt_out',
75
+ :'group_id'
69
76
  ])
70
77
  end
71
78
 
@@ -72,6 +72,9 @@ module MailSlurpClient
72
72
  # List of attributes with nullable: true
73
73
  def self.openapi_nullable
74
74
  Set.new([
75
+ :'description',
76
+ :'created_catch_all_inbox',
77
+ :'domain_type'
75
78
  ])
76
79
  end
77
80
 
@@ -107,6 +107,16 @@ module MailSlurpClient
107
107
  # List of attributes with nullable: true
108
108
  def self.openapi_nullable
109
109
  Set.new([
110
+ :'name',
111
+ :'description',
112
+ :'use_domain_pool',
113
+ :'tags',
114
+ :'expires_at',
115
+ :'favourite',
116
+ :'expires_in',
117
+ :'allow_team_access',
118
+ :'inbox_type',
119
+ :'virtual_inbox'
110
120
  ])
111
121
  end
112
122
 
@@ -13,9 +13,9 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
- # Options for creating a webhook. Webhooks can be attached to inboxes and MailSlurp will POST a webhook payload to the URL specified whenever the inbox receives an email. Webhooks are great for processing many inbound emails.
16
+ # Options for creating a webhook. Webhooks can be attached to inboxes and MailSlurp will POST a webhook payload to the URL specified whenever the webhook's event is triggered. Webhooks are great for processing many inbound emails and responding to other events at scale.
17
17
  class CreateWebhookOptions
18
- # Public URL on your server that MailSlurp can post WebhookNotification payload to when an email is received or an event is trigger. The payload of the submitted JSON is dependent on the webhook event type. The default `EMAIL_RECEIVED` payload is described by `https://ruby.api.mailslurp.com/schemas/webhook-payload`. The other events, `NEW_EMAIL`, `NEW_CONTACT`, and `NEW_ATTACHMENT` are described by `https://ruby.api.mailslurp.com/schemas/webhook-new-email-payload`, `https://ruby.api.mailslurp.com/schemas/webhook-new-contact-payload`,`https://ruby.api.mailslurp.com/schemas/webhook-new-attachment-payload` respectively.
18
+ # Public URL on your server that MailSlurp can post WebhookNotification payload to when an email is received or an event is trigger. The payload of the submitted JSON is dependent on the webhook event type. See docs.mailslurp.com/webhooks for event payload documentation.
19
19
  attr_accessor :url
20
20
 
21
21
  attr_accessor :basic_auth
@@ -23,9 +23,11 @@ module MailSlurpClient
23
23
  # Optional name for the webhook
24
24
  attr_accessor :name
25
25
 
26
- # Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name. The other events are `NEW_EMAIL`, `NEW_CONTACT`, and `NEW_ATTACHMENT` and `EMAIL_OPENED`. `EMAIL_OPENED` requires the use of tracking pixels when sending. See the email tracking guide for more information.
26
+ # Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name.
27
27
  attr_accessor :event_name
28
28
 
29
+ attr_accessor :include_headers
30
+
29
31
  class EnumAttributeValidator
30
32
  attr_reader :datatype
31
33
  attr_reader :allowable_values
@@ -54,7 +56,8 @@ module MailSlurpClient
54
56
  :'url' => :'url',
55
57
  :'basic_auth' => :'basicAuth',
56
58
  :'name' => :'name',
57
- :'event_name' => :'eventName'
59
+ :'event_name' => :'eventName',
60
+ :'include_headers' => :'includeHeaders'
58
61
  }
59
62
  end
60
63
 
@@ -64,13 +67,15 @@ module MailSlurpClient
64
67
  :'url' => :'String',
65
68
  :'basic_auth' => :'BasicAuthOptions',
66
69
  :'name' => :'String',
67
- :'event_name' => :'String'
70
+ :'event_name' => :'String',
71
+ :'include_headers' => :'WebhookHeaders'
68
72
  }
69
73
  end
70
74
 
71
75
  # List of attributes with nullable: true
72
76
  def self.openapi_nullable
73
77
  Set.new([
78
+ :'basic_auth',
74
79
  ])
75
80
  end
76
81
 
@@ -104,6 +109,10 @@ module MailSlurpClient
104
109
  if attributes.key?(:'event_name')
105
110
  self.event_name = attributes[:'event_name']
106
111
  end
112
+
113
+ if attributes.key?(:'include_headers')
114
+ self.include_headers = attributes[:'include_headers']
115
+ end
107
116
  end
108
117
 
109
118
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -144,7 +153,8 @@ module MailSlurpClient
144
153
  url == o.url &&
145
154
  basic_auth == o.basic_auth &&
146
155
  name == o.name &&
147
- event_name == o.event_name
156
+ event_name == o.event_name &&
157
+ include_headers == o.include_headers
148
158
  end
149
159
 
150
160
  # @see the `==` method
@@ -156,7 +166,7 @@ module MailSlurpClient
156
166
  # Calculates hash code according to all attributes.
157
167
  # @return [Integer] Hash code
158
168
  def hash
159
- [url, basic_auth, name, event_name].hash
169
+ [url, basic_auth, name, event_name, include_headers].hash
160
170
  end
161
171
 
162
172
  # Builds the object from hash