mailslurp_client 15.12.12 → 15.12.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) 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/webhook_controller_api.rb +68 -0
  4. data/lib/mailslurp_client/models/alias_projection.rb +15 -15
  5. data/lib/mailslurp_client/models/attachment_projection.rb +14 -14
  6. data/lib/mailslurp_client/models/bounce_recipient_projection.rb +13 -13
  7. data/lib/mailslurp_client/models/create_contact_options.rb +7 -0
  8. data/lib/mailslurp_client/models/create_domain_options.rb +3 -0
  9. data/lib/mailslurp_client/models/create_inbox_dto.rb +10 -0
  10. data/lib/mailslurp_client/models/create_webhook_options.rb +22 -7
  11. data/lib/mailslurp_client/models/email.rb +15 -0
  12. data/lib/mailslurp_client/models/email_analysis.rb +5 -0
  13. data/lib/mailslurp_client/models/email_preview.rb +6 -5
  14. data/lib/mailslurp_client/models/email_projection.rb +10 -10
  15. data/lib/mailslurp_client/models/inbox_dto.rb +7 -0
  16. data/lib/mailslurp_client/models/inbox_preview.rb +5 -0
  17. data/lib/mailslurp_client/models/organization_inbox_projection.rb +4 -0
  18. data/lib/mailslurp_client/models/page_alias.rb +22 -22
  19. data/lib/mailslurp_client/models/page_attachment_entity.rb +22 -22
  20. data/lib/mailslurp_client/models/page_bounced_email.rb +22 -22
  21. data/lib/mailslurp_client/models/page_bounced_recipients.rb +22 -22
  22. data/lib/mailslurp_client/models/page_contact_projection.rb +22 -22
  23. data/lib/mailslurp_client/models/page_email_preview.rb +22 -22
  24. data/lib/mailslurp_client/models/page_email_projection.rb +22 -22
  25. data/lib/mailslurp_client/models/page_email_validation_request.rb +22 -22
  26. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +22 -22
  27. data/lib/mailslurp_client/models/page_group_projection.rb +22 -22
  28. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +22 -22
  29. data/lib/mailslurp_client/models/page_inbox_projection.rb +22 -22
  30. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +22 -22
  31. data/lib/mailslurp_client/models/page_missed_email_projection.rb +22 -22
  32. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +22 -22
  33. data/lib/mailslurp_client/models/page_phone_number_projection.rb +22 -22
  34. data/lib/mailslurp_client/models/page_sent_email_projection.rb +16 -16
  35. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +16 -16
  36. data/lib/mailslurp_client/models/page_sms_projection.rb +22 -22
  37. data/lib/mailslurp_client/models/page_template_projection.rb +22 -22
  38. data/lib/mailslurp_client/models/page_thread_projection.rb +22 -22
  39. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +22 -22
  40. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +22 -22
  41. data/lib/mailslurp_client/models/page_webhook_projection.rb +22 -22
  42. data/lib/mailslurp_client/models/page_webhook_result.rb +22 -22
  43. data/lib/mailslurp_client/models/sent_email_dto.rb +52 -1
  44. data/lib/mailslurp_client/models/sent_email_projection.rb +67 -67
  45. data/lib/mailslurp_client/models/thread_projection.rb +16 -16
  46. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +19 -19
  47. data/lib/mailslurp_client/models/update_inbox_options.rb +5 -0
  48. data/lib/mailslurp_client/models/upload_attachment_options.rb +2 -0
  49. data/lib/mailslurp_client/models/webhook_dto.rb +18 -9
  50. data/lib/mailslurp_client/models/webhook_header_name_value.rb +228 -0
  51. data/lib/mailslurp_client/models/webhook_headers.rb +215 -0
  52. data/lib/mailslurp_client/version.rb +1 -1
  53. data/lib/mailslurp_client.rb +2 -0
  54. metadata +4 -2
@@ -19,18 +19,18 @@ module MailSlurpClient
19
19
 
20
20
  attr_accessor :id
21
21
 
22
- attr_accessor :user_id
23
-
24
22
  attr_accessor :inbox_id
25
23
 
24
+ attr_accessor :user_id
25
+
26
26
  attr_accessor :sent_email_id
27
27
 
28
28
  attr_accessor :created_at
29
29
 
30
- attr_accessor :recipient
31
-
32
30
  attr_accessor :seen
33
31
 
32
+ attr_accessor :recipient
33
+
34
34
  attr_accessor :seen_at
35
35
 
36
36
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -38,12 +38,12 @@ module MailSlurpClient
38
38
  {
39
39
  :'name' => :'name',
40
40
  :'id' => :'id',
41
- :'user_id' => :'userId',
42
41
  :'inbox_id' => :'inboxId',
42
+ :'user_id' => :'userId',
43
43
  :'sent_email_id' => :'sentEmailId',
44
44
  :'created_at' => :'createdAt',
45
- :'recipient' => :'recipient',
46
45
  :'seen' => :'seen',
46
+ :'recipient' => :'recipient',
47
47
  :'seen_at' => :'seenAt'
48
48
  }
49
49
  end
@@ -53,12 +53,12 @@ module MailSlurpClient
53
53
  {
54
54
  :'name' => :'String',
55
55
  :'id' => :'String',
56
- :'user_id' => :'String',
57
56
  :'inbox_id' => :'String',
57
+ :'user_id' => :'String',
58
58
  :'sent_email_id' => :'String',
59
59
  :'created_at' => :'DateTime',
60
- :'recipient' => :'String',
61
60
  :'seen' => :'Boolean',
61
+ :'recipient' => :'String',
62
62
  :'seen_at' => :'DateTime'
63
63
  }
64
64
  end
@@ -92,14 +92,14 @@ module MailSlurpClient
92
92
  self.id = attributes[:'id']
93
93
  end
94
94
 
95
- if attributes.key?(:'user_id')
96
- self.user_id = attributes[:'user_id']
97
- end
98
-
99
95
  if attributes.key?(:'inbox_id')
100
96
  self.inbox_id = attributes[:'inbox_id']
101
97
  end
102
98
 
99
+ if attributes.key?(:'user_id')
100
+ self.user_id = attributes[:'user_id']
101
+ end
102
+
103
103
  if attributes.key?(:'sent_email_id')
104
104
  self.sent_email_id = attributes[:'sent_email_id']
105
105
  end
@@ -108,14 +108,14 @@ module MailSlurpClient
108
108
  self.created_at = attributes[:'created_at']
109
109
  end
110
110
 
111
- if attributes.key?(:'recipient')
112
- self.recipient = attributes[:'recipient']
113
- end
114
-
115
111
  if attributes.key?(:'seen')
116
112
  self.seen = attributes[:'seen']
117
113
  end
118
114
 
115
+ if attributes.key?(:'recipient')
116
+ self.recipient = attributes[:'recipient']
117
+ end
118
+
119
119
  if attributes.key?(:'seen_at')
120
120
  self.seen_at = attributes[:'seen_at']
121
121
  end
@@ -161,12 +161,12 @@ module MailSlurpClient
161
161
  self.class == o.class &&
162
162
  name == o.name &&
163
163
  id == o.id &&
164
- user_id == o.user_id &&
165
164
  inbox_id == o.inbox_id &&
165
+ user_id == o.user_id &&
166
166
  sent_email_id == o.sent_email_id &&
167
167
  created_at == o.created_at &&
168
- recipient == o.recipient &&
169
168
  seen == o.seen &&
169
+ recipient == o.recipient &&
170
170
  seen_at == o.seen_at
171
171
  end
172
172
 
@@ -179,7 +179,7 @@ module MailSlurpClient
179
179
  # Calculates hash code according to all attributes.
180
180
  # @return [Integer] Hash code
181
181
  def hash
182
- [name, id, user_id, inbox_id, sent_email_id, created_at, recipient, seen, seen_at].hash
182
+ [name, id, inbox_id, user_id, sent_email_id, created_at, seen, recipient, seen_at].hash
183
183
  end
184
184
 
185
185
  # Builds the object from hash
@@ -55,6 +55,11 @@ module MailSlurpClient
55
55
  # List of attributes with nullable: true
56
56
  def self.openapi_nullable
57
57
  Set.new([
58
+ :'name',
59
+ :'description',
60
+ :'tags',
61
+ :'expires_at',
62
+ :'favourite'
58
63
  ])
59
64
  end
60
65
 
@@ -45,6 +45,8 @@ module MailSlurpClient
45
45
  # List of attributes with nullable: true
46
46
  def self.openapi_nullable
47
47
  Set.new([
48
+ :'content_type',
49
+ :'filename',
48
50
  ])
49
51
  end
50
52
 
@@ -44,8 +44,11 @@ module MailSlurpClient
44
44
 
45
45
  attr_accessor :updated_at
46
46
 
47
+ # Webhook trigger event name
47
48
  attr_accessor :event_name
48
49
 
50
+ attr_accessor :request_headers
51
+
49
52
  class EnumAttributeValidator
50
53
  attr_reader :datatype
51
54
  attr_reader :allowable_values
@@ -81,7 +84,8 @@ module MailSlurpClient
81
84
  :'payload_json_schema' => :'payloadJsonSchema',
82
85
  :'created_at' => :'createdAt',
83
86
  :'updated_at' => :'updatedAt',
84
- :'event_name' => :'eventName'
87
+ :'event_name' => :'eventName',
88
+ :'request_headers' => :'requestHeaders'
85
89
  }
86
90
  end
87
91
 
@@ -98,13 +102,18 @@ module MailSlurpClient
98
102
  :'payload_json_schema' => :'String',
99
103
  :'created_at' => :'DateTime',
100
104
  :'updated_at' => :'DateTime',
101
- :'event_name' => :'String'
105
+ :'event_name' => :'String',
106
+ :'request_headers' => :'WebhookHeaders'
102
107
  }
103
108
  end
104
109
 
105
110
  # List of attributes with nullable: true
106
111
  def self.openapi_nullable
107
112
  Set.new([
113
+ :'name',
114
+ :'inbox_id',
115
+ :'created_at',
116
+ :'event_name',
108
117
  ])
109
118
  end
110
119
 
@@ -166,6 +175,10 @@ module MailSlurpClient
166
175
  if attributes.key?(:'event_name')
167
176
  self.event_name = attributes[:'event_name']
168
177
  end
178
+
179
+ if attributes.key?(:'request_headers')
180
+ self.request_headers = attributes[:'request_headers']
181
+ end
169
182
  end
170
183
 
171
184
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -196,10 +209,6 @@ module MailSlurpClient
196
209
  invalid_properties.push('invalid value for "payload_json_schema", payload_json_schema cannot be nil.')
197
210
  end
198
211
 
199
- if @created_at.nil?
200
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
201
- end
202
-
203
212
  if @updated_at.nil?
204
213
  invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
205
214
  end
@@ -218,7 +227,6 @@ module MailSlurpClient
218
227
  method_validator = EnumAttributeValidator.new('String', ["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "TRACE"])
219
228
  return false unless method_validator.valid?(@method)
220
229
  return false if @payload_json_schema.nil?
221
- return false if @created_at.nil?
222
230
  return false if @updated_at.nil?
223
231
  event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
224
232
  return false unless event_name_validator.valid?(@event_name)
@@ -260,7 +268,8 @@ module MailSlurpClient
260
268
  payload_json_schema == o.payload_json_schema &&
261
269
  created_at == o.created_at &&
262
270
  updated_at == o.updated_at &&
263
- event_name == o.event_name
271
+ event_name == o.event_name &&
272
+ request_headers == o.request_headers
264
273
  end
265
274
 
266
275
  # @see the `==` method
@@ -272,7 +281,7 @@ module MailSlurpClient
272
281
  # Calculates hash code according to all attributes.
273
282
  # @return [Integer] Hash code
274
283
  def hash
275
- [id, user_id, basic_auth, name, inbox_id, url, method, payload_json_schema, created_at, updated_at, event_name].hash
284
+ [id, user_id, basic_auth, name, inbox_id, url, method, payload_json_schema, created_at, updated_at, event_name, request_headers].hash
276
285
  end
277
286
 
278
287
  # Builds the object from hash
@@ -0,0 +1,228 @@
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
+ # Name value pair for webhook header
17
+ class WebhookHeaderNameValue
18
+ # Name of header
19
+ attr_accessor :name
20
+
21
+ # Value of header
22
+ attr_accessor :value
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'name' => :'name',
28
+ :'value' => :'value'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'name' => :'String',
36
+ :'value' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::WebhookHeaderNameValue` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::WebhookHeaderNameValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'name')
62
+ self.name = attributes[:'name']
63
+ end
64
+
65
+ if attributes.key?(:'value')
66
+ self.value = attributes[:'value']
67
+ end
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properties with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = Array.new
74
+ if @name.nil?
75
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
76
+ end
77
+
78
+ if @value.nil?
79
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ return false if @name.nil?
89
+ return false if @value.nil?
90
+ true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ name == o.name &&
99
+ value == o.value
100
+ end
101
+
102
+ # @see the `==` method
103
+ # @param [Object] Object to be compared
104
+ def eql?(o)
105
+ self == o
106
+ end
107
+
108
+ # Calculates hash code according to all attributes.
109
+ # @return [Integer] Hash code
110
+ def hash
111
+ [name, value].hash
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def self.build_from_hash(attributes)
118
+ new.build_from_hash(attributes)
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+ self.class.openapi_types.each_pair do |key, type|
127
+ if type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ MailSlurpClient.const_get(type).build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+ end
228
+ end
@@ -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://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
+ # Webhook HTTP headers to include with each request from MailSlurp to your server
17
+ class WebhookHeaders
18
+ # List of header name value pairs to include with webhook requests
19
+ attr_accessor :headers
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'headers' => :'headers'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.openapi_types
30
+ {
31
+ :'headers' => :'Array<WebhookHeaderNameValue>'
32
+ }
33
+ end
34
+
35
+ # List of attributes with nullable: true
36
+ def self.openapi_nullable
37
+ Set.new([
38
+ ])
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ if (!attributes.is_a?(Hash))
45
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::WebhookHeaders` initialize method"
46
+ end
47
+
48
+ # check to see if the attribute exists and convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h|
50
+ if (!self.class.attribute_map.key?(k.to_sym))
51
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::WebhookHeaders`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
+ end
53
+ h[k.to_sym] = v
54
+ }
55
+
56
+ if attributes.key?(:'headers')
57
+ if (value = attributes[:'headers']).is_a?(Array)
58
+ self.headers = value
59
+ end
60
+ end
61
+ end
62
+
63
+ # Show invalid properties with the reasons. Usually used together with valid?
64
+ # @return Array for valid properties with the reasons
65
+ def list_invalid_properties
66
+ invalid_properties = Array.new
67
+ if @headers.nil?
68
+ invalid_properties.push('invalid value for "headers", headers cannot be nil.')
69
+ end
70
+
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
+ return false if @headers.nil?
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ headers == o.headers
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
+ [headers].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
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module MailSlurpClient
14
- VERSION = '15.12.12'
14
+ VERSION = '15.12.15'
15
15
  end
@@ -186,6 +186,8 @@ require 'mailslurp_client/models/webhook_bounce_recipient_payload'
186
186
  require 'mailslurp_client/models/webhook_dto'
187
187
  require 'mailslurp_client/models/webhook_email_opened_payload'
188
188
  require 'mailslurp_client/models/webhook_email_read_payload'
189
+ require 'mailslurp_client/models/webhook_header_name_value'
190
+ require 'mailslurp_client/models/webhook_headers'
189
191
  require 'mailslurp_client/models/webhook_new_attachment_payload'
190
192
  require 'mailslurp_client/models/webhook_new_contact_payload'
191
193
  require 'mailslurp_client/models/webhook_new_email_payload'