mailslurp_client 15.5.4 → 15.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -11
  3. data/lib/mailslurp_client/api/api_internal_controller_api.rb +89 -0
  4. data/lib/mailslurp_client/api/attachment_controller_api.rb +1 -1
  5. data/lib/mailslurp_client/api/bounce_controller_api.rb +64 -0
  6. data/lib/mailslurp_client/api/email_verification_controller_api.rb +179 -0
  7. data/lib/mailslurp_client/api/mail_server_controller_api.rb +2 -2
  8. data/lib/mailslurp_client/models/alias_projection.rb +13 -13
  9. data/lib/mailslurp_client/models/attachment_projection.rb +28 -28
  10. data/lib/mailslurp_client/models/bounce_recipient.rb +0 -5
  11. data/lib/mailslurp_client/models/bounced_recipient_dto.rb +0 -5
  12. data/lib/mailslurp_client/models/contact_projection.rb +13 -13
  13. data/lib/mailslurp_client/models/email_projection.rb +23 -23
  14. data/lib/mailslurp_client/models/email_validation_request.rb +276 -0
  15. data/lib/mailslurp_client/models/filter_bounced_recipients_options.rb +213 -0
  16. data/lib/mailslurp_client/models/filter_bounced_recipients_result.rb +213 -0
  17. data/lib/mailslurp_client/models/get_or_create_saml_user_options.rb +234 -0
  18. data/lib/mailslurp_client/models/page_alias.rb +19 -19
  19. data/lib/mailslurp_client/models/page_attachment_entity.rb +19 -19
  20. data/lib/mailslurp_client/models/page_bounced_email.rb +19 -19
  21. data/lib/mailslurp_client/models/page_bounced_recipients.rb +19 -19
  22. data/lib/mailslurp_client/models/page_contact_projection.rb +19 -19
  23. data/lib/mailslurp_client/models/page_email_preview.rb +19 -19
  24. data/lib/mailslurp_client/models/page_email_projection.rb +19 -19
  25. data/lib/mailslurp_client/models/page_email_validation_request.rb +308 -0
  26. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +19 -19
  27. data/lib/mailslurp_client/models/page_group_projection.rb +19 -19
  28. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +19 -19
  29. data/lib/mailslurp_client/models/page_inbox_projection.rb +19 -19
  30. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +19 -19
  31. data/lib/mailslurp_client/models/page_missed_email_projection.rb +19 -19
  32. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +19 -19
  33. data/lib/mailslurp_client/models/page_template_projection.rb +19 -19
  34. data/lib/mailslurp_client/models/page_thread_projection.rb +19 -19
  35. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +19 -19
  36. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +19 -19
  37. data/lib/mailslurp_client/models/page_webhook_projection.rb +19 -19
  38. data/lib/mailslurp_client/models/page_webhook_result.rb +19 -19
  39. data/lib/mailslurp_client/models/send_email_options.rb +36 -4
  40. data/lib/mailslurp_client/models/sent_email_dto.rb +13 -4
  41. data/lib/mailslurp_client/models/sent_email_projection.rb +26 -26
  42. data/lib/mailslurp_client/models/template_projection.rb +18 -18
  43. data/lib/mailslurp_client/models/thread_projection.rb +15 -15
  44. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -10
  45. data/lib/mailslurp_client/models/unknown_missed_email_projection.rb +13 -13
  46. data/lib/mailslurp_client/models/user_dto.rb +438 -0
  47. data/lib/mailslurp_client/models/validate_email_address_list_options.rb +213 -0
  48. data/lib/mailslurp_client/models/validate_email_address_list_result.rb +245 -0
  49. data/lib/mailslurp_client/models/webhook_projection.rb +12 -12
  50. data/lib/mailslurp_client/version.rb +1 -1
  51. data/lib/mailslurp_client.rb +10 -0
  52. metadata +12 -2
@@ -19,28 +19,28 @@ module MailSlurpClient
19
19
  # Content length of attachment in bytes
20
20
  attr_accessor :content_length
21
21
 
22
- # Content type of attachment.
23
- attr_accessor :content_type
24
-
25
22
  attr_accessor :user_id
26
23
 
27
- attr_accessor :created_at
28
-
29
24
  # Attachment ID
30
25
  attr_accessor :attachment_id
31
26
 
27
+ attr_accessor :created_at
28
+
32
29
  attr_accessor :updated_at
33
30
 
31
+ # Content type of attachment.
32
+ attr_accessor :content_type
33
+
34
34
  # Attribute mapping from ruby-style variable name to JSON key.
35
35
  def self.attribute_map
36
36
  {
37
37
  :'name' => :'name',
38
38
  :'content_length' => :'contentLength',
39
- :'content_type' => :'contentType',
40
39
  :'user_id' => :'userId',
41
- :'created_at' => :'createdAt',
42
40
  :'attachment_id' => :'attachmentId',
43
- :'updated_at' => :'updatedAt'
41
+ :'created_at' => :'createdAt',
42
+ :'updated_at' => :'updatedAt',
43
+ :'content_type' => :'contentType'
44
44
  }
45
45
  end
46
46
 
@@ -49,11 +49,11 @@ module MailSlurpClient
49
49
  {
50
50
  :'name' => :'String',
51
51
  :'content_length' => :'Integer',
52
- :'content_type' => :'String',
53
52
  :'user_id' => :'String',
54
- :'created_at' => :'DateTime',
55
53
  :'attachment_id' => :'String',
56
- :'updated_at' => :'DateTime'
54
+ :'created_at' => :'DateTime',
55
+ :'updated_at' => :'DateTime',
56
+ :'content_type' => :'String'
57
57
  }
58
58
  end
59
59
 
@@ -86,25 +86,25 @@ module MailSlurpClient
86
86
  self.content_length = attributes[:'content_length']
87
87
  end
88
88
 
89
- if attributes.key?(:'content_type')
90
- self.content_type = attributes[:'content_type']
91
- end
92
-
93
89
  if attributes.key?(:'user_id')
94
90
  self.user_id = attributes[:'user_id']
95
91
  end
96
92
 
97
- if attributes.key?(:'created_at')
98
- self.created_at = attributes[:'created_at']
99
- end
100
-
101
93
  if attributes.key?(:'attachment_id')
102
94
  self.attachment_id = attributes[:'attachment_id']
103
95
  end
104
96
 
97
+ if attributes.key?(:'created_at')
98
+ self.created_at = attributes[:'created_at']
99
+ end
100
+
105
101
  if attributes.key?(:'updated_at')
106
102
  self.updated_at = attributes[:'updated_at']
107
103
  end
104
+
105
+ if attributes.key?(:'content_type')
106
+ self.content_type = attributes[:'content_type']
107
+ end
108
108
  end
109
109
 
110
110
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -115,14 +115,14 @@ module MailSlurpClient
115
115
  invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
116
116
  end
117
117
 
118
- if @created_at.nil?
119
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
120
- end
121
-
122
118
  if @attachment_id.nil?
123
119
  invalid_properties.push('invalid value for "attachment_id", attachment_id cannot be nil.')
124
120
  end
125
121
 
122
+ if @created_at.nil?
123
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
124
+ end
125
+
126
126
  if @updated_at.nil?
127
127
  invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
128
128
  end
@@ -134,8 +134,8 @@ module MailSlurpClient
134
134
  # @return true if the model is valid
135
135
  def valid?
136
136
  return false if @user_id.nil?
137
- return false if @created_at.nil?
138
137
  return false if @attachment_id.nil?
138
+ return false if @created_at.nil?
139
139
  return false if @updated_at.nil?
140
140
  true
141
141
  end
@@ -147,11 +147,11 @@ module MailSlurpClient
147
147
  self.class == o.class &&
148
148
  name == o.name &&
149
149
  content_length == o.content_length &&
150
- content_type == o.content_type &&
151
150
  user_id == o.user_id &&
152
- created_at == o.created_at &&
153
151
  attachment_id == o.attachment_id &&
154
- updated_at == o.updated_at
152
+ created_at == o.created_at &&
153
+ updated_at == o.updated_at &&
154
+ content_type == o.content_type
155
155
  end
156
156
 
157
157
  # @see the `==` method
@@ -163,7 +163,7 @@ module MailSlurpClient
163
163
  # Calculates hash code according to all attributes.
164
164
  # @return [Integer] Hash code
165
165
  def hash
166
- [name, content_length, content_type, user_id, created_at, attachment_id, updated_at].hash
166
+ [name, content_length, user_id, attachment_id, created_at, updated_at, content_type].hash
167
167
  end
168
168
 
169
169
  # Builds the object from hash
@@ -92,10 +92,6 @@ module MailSlurpClient
92
92
  # @return Array for valid properties with the reasons
93
93
  def list_invalid_properties
94
94
  invalid_properties = Array.new
95
- if @user_id.nil?
96
- invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
97
- end
98
-
99
95
  if @recipient.nil?
100
96
  invalid_properties.push('invalid value for "recipient", recipient cannot be nil.')
101
97
  end
@@ -114,7 +110,6 @@ module MailSlurpClient
114
110
  # Check to see if the all the properties in the model are valid
115
111
  # @return true if the model is valid
116
112
  def valid?
117
- return false if @user_id.nil?
118
113
  return false if @recipient.nil?
119
114
  return false if @created_at.nil?
120
115
  return false if @updated_at.nil?
@@ -85,10 +85,6 @@ module MailSlurpClient
85
85
  # @return Array for valid properties with the reasons
86
86
  def list_invalid_properties
87
87
  invalid_properties = Array.new
88
- if @user_id.nil?
89
- invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
90
- end
91
-
92
88
  if @recipient.nil?
93
89
  invalid_properties.push('invalid value for "recipient", recipient cannot be nil.')
94
90
  end
@@ -103,7 +99,6 @@ module MailSlurpClient
103
99
  # Check to see if the all the properties in the model are valid
104
100
  # @return true if the model is valid
105
101
  def valid?
106
- return false if @user_id.nil?
107
102
  return false if @recipient.nil?
108
103
  return false if @created_at.nil?
109
104
  true
@@ -18,8 +18,6 @@ module MailSlurpClient
18
18
 
19
19
  attr_accessor :group_id
20
20
 
21
- attr_accessor :created_at
22
-
23
21
  attr_accessor :first_name
24
22
 
25
23
  attr_accessor :last_name
@@ -30,17 +28,19 @@ module MailSlurpClient
30
28
 
31
29
  attr_accessor :opt_out
32
30
 
31
+ attr_accessor :created_at
32
+
33
33
  # Attribute mapping from ruby-style variable name to JSON key.
34
34
  def self.attribute_map
35
35
  {
36
36
  :'id' => :'id',
37
37
  :'group_id' => :'groupId',
38
- :'created_at' => :'createdAt',
39
38
  :'first_name' => :'firstName',
40
39
  :'last_name' => :'lastName',
41
40
  :'company' => :'company',
42
41
  :'email_addresses' => :'emailAddresses',
43
- :'opt_out' => :'optOut'
42
+ :'opt_out' => :'optOut',
43
+ :'created_at' => :'createdAt'
44
44
  }
45
45
  end
46
46
 
@@ -49,12 +49,12 @@ module MailSlurpClient
49
49
  {
50
50
  :'id' => :'String',
51
51
  :'group_id' => :'String',
52
- :'created_at' => :'DateTime',
53
52
  :'first_name' => :'String',
54
53
  :'last_name' => :'String',
55
54
  :'company' => :'String',
56
55
  :'email_addresses' => :'Array<String>',
57
- :'opt_out' => :'Boolean'
56
+ :'opt_out' => :'Boolean',
57
+ :'created_at' => :'DateTime'
58
58
  }
59
59
  end
60
60
 
@@ -87,10 +87,6 @@ module MailSlurpClient
87
87
  self.group_id = attributes[:'group_id']
88
88
  end
89
89
 
90
- if attributes.key?(:'created_at')
91
- self.created_at = attributes[:'created_at']
92
- end
93
-
94
90
  if attributes.key?(:'first_name')
95
91
  self.first_name = attributes[:'first_name']
96
92
  end
@@ -112,6 +108,10 @@ module MailSlurpClient
112
108
  if attributes.key?(:'opt_out')
113
109
  self.opt_out = attributes[:'opt_out']
114
110
  end
111
+
112
+ if attributes.key?(:'created_at')
113
+ self.created_at = attributes[:'created_at']
114
+ end
115
115
  end
116
116
 
117
117
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -144,12 +144,12 @@ module MailSlurpClient
144
144
  self.class == o.class &&
145
145
  id == o.id &&
146
146
  group_id == o.group_id &&
147
- created_at == o.created_at &&
148
147
  first_name == o.first_name &&
149
148
  last_name == o.last_name &&
150
149
  company == o.company &&
151
150
  email_addresses == o.email_addresses &&
152
- opt_out == o.opt_out
151
+ opt_out == o.opt_out &&
152
+ created_at == o.created_at
153
153
  end
154
154
 
155
155
  # @see the `==` method
@@ -161,7 +161,7 @@ module MailSlurpClient
161
161
  # Calculates hash code according to all attributes.
162
162
  # @return [Integer] Hash code
163
163
  def hash
164
- [id, group_id, created_at, first_name, last_name, company, email_addresses, opt_out].hash
164
+ [id, group_id, first_name, last_name, company, email_addresses, opt_out, created_at].hash
165
165
  end
166
166
 
167
167
  # Builds the object from hash
@@ -21,11 +21,9 @@ module MailSlurpClient
21
21
 
22
22
  attr_accessor :subject
23
23
 
24
- attr_accessor :attachments
25
-
26
24
  attr_accessor :inbox_id
27
25
 
28
- attr_accessor :created_at
26
+ attr_accessor :attachments
29
27
 
30
28
  attr_accessor :to
31
29
 
@@ -33,6 +31,8 @@ module MailSlurpClient
33
31
 
34
32
  attr_accessor :cc
35
33
 
34
+ attr_accessor :created_at
35
+
36
36
  attr_accessor :team_access
37
37
 
38
38
  attr_accessor :read
@@ -47,12 +47,12 @@ module MailSlurpClient
47
47
  :'id' => :'id',
48
48
  :'from' => :'from',
49
49
  :'subject' => :'subject',
50
- :'attachments' => :'attachments',
51
50
  :'inbox_id' => :'inboxId',
52
- :'created_at' => :'createdAt',
51
+ :'attachments' => :'attachments',
53
52
  :'to' => :'to',
54
53
  :'bcc' => :'bcc',
55
54
  :'cc' => :'cc',
55
+ :'created_at' => :'createdAt',
56
56
  :'team_access' => :'teamAccess',
57
57
  :'read' => :'read',
58
58
  :'body_md5_hash' => :'bodyMD5Hash',
@@ -66,12 +66,12 @@ module MailSlurpClient
66
66
  :'id' => :'String',
67
67
  :'from' => :'String',
68
68
  :'subject' => :'String',
69
- :'attachments' => :'Array<String>',
70
69
  :'inbox_id' => :'String',
71
- :'created_at' => :'DateTime',
70
+ :'attachments' => :'Array<String>',
72
71
  :'to' => :'Array<String>',
73
72
  :'bcc' => :'Array<String>',
74
73
  :'cc' => :'Array<String>',
74
+ :'created_at' => :'DateTime',
75
75
  :'team_access' => :'Boolean',
76
76
  :'read' => :'Boolean',
77
77
  :'body_md5_hash' => :'String',
@@ -112,18 +112,14 @@ module MailSlurpClient
112
112
  self.subject = attributes[:'subject']
113
113
  end
114
114
 
115
- if attributes.key?(:'attachments')
116
- if (value = attributes[:'attachments']).is_a?(Array)
117
- self.attachments = value
118
- end
119
- end
120
-
121
115
  if attributes.key?(:'inbox_id')
122
116
  self.inbox_id = attributes[:'inbox_id']
123
117
  end
124
118
 
125
- if attributes.key?(:'created_at')
126
- self.created_at = attributes[:'created_at']
119
+ if attributes.key?(:'attachments')
120
+ if (value = attributes[:'attachments']).is_a?(Array)
121
+ self.attachments = value
122
+ end
127
123
  end
128
124
 
129
125
  if attributes.key?(:'to')
@@ -144,6 +140,10 @@ module MailSlurpClient
144
140
  end
145
141
  end
146
142
 
143
+ if attributes.key?(:'created_at')
144
+ self.created_at = attributes[:'created_at']
145
+ end
146
+
147
147
  if attributes.key?(:'team_access')
148
148
  self.team_access = attributes[:'team_access']
149
149
  end
@@ -173,14 +173,14 @@ module MailSlurpClient
173
173
  invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
174
174
  end
175
175
 
176
- if @created_at.nil?
177
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
178
- end
179
-
180
176
  if @to.nil?
181
177
  invalid_properties.push('invalid value for "to", to cannot be nil.')
182
178
  end
183
179
 
180
+ if @created_at.nil?
181
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
182
+ end
183
+
184
184
  invalid_properties
185
185
  end
186
186
 
@@ -189,8 +189,8 @@ module MailSlurpClient
189
189
  def valid?
190
190
  return false if @id.nil?
191
191
  return false if @inbox_id.nil?
192
- return false if @created_at.nil?
193
192
  return false if @to.nil?
193
+ return false if @created_at.nil?
194
194
  true
195
195
  end
196
196
 
@@ -202,12 +202,12 @@ module MailSlurpClient
202
202
  id == o.id &&
203
203
  from == o.from &&
204
204
  subject == o.subject &&
205
- attachments == o.attachments &&
206
205
  inbox_id == o.inbox_id &&
207
- created_at == o.created_at &&
206
+ attachments == o.attachments &&
208
207
  to == o.to &&
209
208
  bcc == o.bcc &&
210
209
  cc == o.cc &&
210
+ created_at == o.created_at &&
211
211
  team_access == o.team_access &&
212
212
  read == o.read &&
213
213
  body_md5_hash == o.body_md5_hash &&
@@ -223,7 +223,7 @@ module MailSlurpClient
223
223
  # Calculates hash code according to all attributes.
224
224
  # @return [Integer] Hash code
225
225
  def hash
226
- [id, from, subject, attachments, inbox_id, created_at, to, bcc, cc, team_access, read, body_md5_hash, body_excerpt].hash
226
+ [id, from, subject, inbox_id, attachments, to, bcc, cc, created_at, team_access, read, body_md5_hash, body_excerpt].hash
227
227
  end
228
228
 
229
229
  # Builds the object from hash
@@ -0,0 +1,276 @@
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
+ 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 EmailValidationRequest
17
+ attr_accessor :id
18
+
19
+ attr_accessor :user_id
20
+
21
+ attr_accessor :email_address
22
+
23
+ attr_accessor :is_valid
24
+
25
+ attr_accessor :created_at
26
+
27
+ attr_accessor :updated_at
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'id' => :'id',
33
+ :'user_id' => :'userId',
34
+ :'email_address' => :'emailAddress',
35
+ :'is_valid' => :'isValid',
36
+ :'created_at' => :'createdAt',
37
+ :'updated_at' => :'updatedAt'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'id' => :'String',
45
+ :'user_id' => :'String',
46
+ :'email_address' => :'String',
47
+ :'is_valid' => :'Boolean',
48
+ :'created_at' => :'DateTime',
49
+ :'updated_at' => :'DateTime'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::EmailValidationRequest` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::EmailValidationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'id')
75
+ self.id = attributes[:'id']
76
+ end
77
+
78
+ if attributes.key?(:'user_id')
79
+ self.user_id = attributes[:'user_id']
80
+ end
81
+
82
+ if attributes.key?(:'email_address')
83
+ self.email_address = attributes[:'email_address']
84
+ end
85
+
86
+ if attributes.key?(:'is_valid')
87
+ self.is_valid = attributes[:'is_valid']
88
+ end
89
+
90
+ if attributes.key?(:'created_at')
91
+ self.created_at = attributes[:'created_at']
92
+ end
93
+
94
+ if attributes.key?(:'updated_at')
95
+ self.updated_at = attributes[:'updated_at']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ invalid_properties = Array.new
103
+ if @user_id.nil?
104
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
105
+ end
106
+
107
+ if @email_address.nil?
108
+ invalid_properties.push('invalid value for "email_address", email_address cannot be nil.')
109
+ end
110
+
111
+ if @is_valid.nil?
112
+ invalid_properties.push('invalid value for "is_valid", is_valid cannot be nil.')
113
+ end
114
+
115
+ if @created_at.nil?
116
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
117
+ end
118
+
119
+ if @updated_at.nil?
120
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
121
+ end
122
+
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ return false if @user_id.nil?
130
+ return false if @email_address.nil?
131
+ return false if @is_valid.nil?
132
+ return false if @created_at.nil?
133
+ return false if @updated_at.nil?
134
+ true
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
139
+ def ==(o)
140
+ return true if self.equal?(o)
141
+ self.class == o.class &&
142
+ id == o.id &&
143
+ user_id == o.user_id &&
144
+ email_address == o.email_address &&
145
+ is_valid == o.is_valid &&
146
+ created_at == o.created_at &&
147
+ updated_at == o.updated_at
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [id, user_id, email_address, is_valid, created_at, updated_at].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ new.build_from_hash(attributes)
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ self.class.openapi_types.each_pair do |key, type|
175
+ if type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
179
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
180
+ end
181
+ elsif !attributes[self.class.attribute_map[key]].nil?
182
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
183
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
184
+ end
185
+
186
+ self
187
+ end
188
+
189
+ # Deserializes the data based on type
190
+ # @param string type Data type
191
+ # @param string value Value to be deserialized
192
+ # @return [Object] Deserialized data
193
+ def _deserialize(type, value)
194
+ case type.to_sym
195
+ when :DateTime
196
+ DateTime.parse(value)
197
+ when :Date
198
+ Date.parse(value)
199
+ when :String
200
+ value.to_s
201
+ when :Integer
202
+ value.to_i
203
+ when :Float
204
+ value.to_f
205
+ when :Boolean
206
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
207
+ true
208
+ else
209
+ false
210
+ end
211
+ when :Object
212
+ # generic object (usually a Hash), return directly
213
+ value
214
+ when /\AArray<(?<inner_type>.+)>\z/
215
+ inner_type = Regexp.last_match[:inner_type]
216
+ value.map { |v| _deserialize(inner_type, v) }
217
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
218
+ k_type = Regexp.last_match[:k_type]
219
+ v_type = Regexp.last_match[:v_type]
220
+ {}.tap do |hash|
221
+ value.each do |k, v|
222
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
223
+ end
224
+ end
225
+ else # model
226
+ MailSlurpClient.const_get(type).build_from_hash(value)
227
+ end
228
+ end
229
+
230
+ # Returns the string representation of the object
231
+ # @return [String] String presentation of the object
232
+ def to_s
233
+ to_hash.to_s
234
+ end
235
+
236
+ # to_body is an alias to to_hash (backward compatibility)
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_body
239
+ to_hash
240
+ end
241
+
242
+ # Returns the object in the form of hash
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_hash
245
+ hash = {}
246
+ self.class.attribute_map.each_pair do |attr, param|
247
+ value = self.send(attr)
248
+ if value.nil?
249
+ is_nullable = self.class.openapi_nullable.include?(attr)
250
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
251
+ end
252
+
253
+ hash[param] = _to_hash(value)
254
+ end
255
+ hash
256
+ end
257
+
258
+ # Outputs non-array value in the form of hash
259
+ # For object, use to_hash. Otherwise, just return the value
260
+ # @param [Object] value Any valid value
261
+ # @return [Hash] Returns the value in the form of hash
262
+ def _to_hash(value)
263
+ if value.is_a?(Array)
264
+ value.compact.map { |v| _to_hash(v) }
265
+ elsif value.is_a?(Hash)
266
+ {}.tap do |hash|
267
+ value.each { |k, v| hash[k] = _to_hash(v) }
268
+ end
269
+ elsif value.respond_to? :to_hash
270
+ value.to_hash
271
+ else
272
+ value
273
+ end
274
+ end
275
+ end
276
+ end