mailslurp_client 15.11.0 → 15.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/attachment_controller_api.rb +4 -4
  3. data/lib/mailslurp_client/api/email_controller_api.rb +68 -3
  4. data/lib/mailslurp_client/api/missed_email_controller_api.rb +56 -0
  5. data/lib/mailslurp_client/api/phone_controller_api.rb +487 -0
  6. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +73 -0
  7. data/lib/mailslurp_client/api/sms_controller_api.rb +286 -0
  8. data/lib/mailslurp_client/api/wait_for_controller_api.rb +64 -0
  9. data/lib/mailslurp_client/api/webhook_controller_api.rb +2 -2
  10. data/lib/mailslurp_client/models/abstract_webhook_payload.rb +2 -2
  11. data/lib/mailslurp_client/models/alias_projection.rb +27 -27
  12. data/lib/mailslurp_client/models/attachment_projection.rb +14 -14
  13. data/lib/mailslurp_client/models/contact_projection.rb +18 -18
  14. data/lib/mailslurp_client/models/create_emergency_address_options.rb +324 -0
  15. data/lib/mailslurp_client/models/create_webhook_options.rb +2 -2
  16. data/lib/mailslurp_client/models/email_html_dto.rb +215 -0
  17. data/lib/mailslurp_client/models/email_projection.rb +10 -10
  18. data/lib/mailslurp_client/models/emergency_address.rb +408 -0
  19. data/lib/mailslurp_client/models/emergency_address_dto.rb +273 -0
  20. data/lib/mailslurp_client/models/empty_response_dto.rb +206 -0
  21. data/lib/mailslurp_client/models/page_alias.rb +19 -19
  22. data/lib/mailslurp_client/models/page_attachment_entity.rb +19 -19
  23. data/lib/mailslurp_client/models/page_bounced_email.rb +19 -19
  24. data/lib/mailslurp_client/models/page_bounced_recipients.rb +19 -19
  25. data/lib/mailslurp_client/models/page_contact_projection.rb +19 -19
  26. data/lib/mailslurp_client/models/page_email_preview.rb +19 -19
  27. data/lib/mailslurp_client/models/page_email_projection.rb +19 -19
  28. data/lib/mailslurp_client/models/page_email_validation_request.rb +19 -19
  29. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +19 -19
  30. data/lib/mailslurp_client/models/page_group_projection.rb +19 -19
  31. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +19 -19
  32. data/lib/mailslurp_client/models/page_inbox_projection.rb +19 -19
  33. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +19 -19
  34. data/lib/mailslurp_client/models/page_missed_email_projection.rb +19 -19
  35. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +19 -19
  36. data/lib/mailslurp_client/models/page_phone_number_projection.rb +308 -0
  37. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +344 -0
  38. data/lib/mailslurp_client/models/page_sms_projection.rb +308 -0
  39. data/lib/mailslurp_client/models/page_template_projection.rb +19 -19
  40. data/lib/mailslurp_client/models/page_thread_projection.rb +19 -19
  41. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +19 -19
  42. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +19 -19
  43. data/lib/mailslurp_client/models/page_webhook_projection.rb +19 -19
  44. data/lib/mailslurp_client/models/page_webhook_result.rb +19 -19
  45. data/lib/mailslurp_client/models/phone_number_dto.rb +347 -0
  46. data/lib/mailslurp_client/models/phone_number_projection.rb +302 -0
  47. data/lib/mailslurp_client/models/phone_plan_dto.rb +287 -0
  48. data/lib/mailslurp_client/models/send_with_queue_result.rb +318 -0
  49. data/lib/mailslurp_client/models/sent_email_projection.rb +15 -15
  50. data/lib/mailslurp_client/models/sms_match_option.rb +289 -0
  51. data/lib/mailslurp_client/models/sms_message.rb +318 -0
  52. data/lib/mailslurp_client/models/sms_preview.rb +267 -0
  53. data/lib/mailslurp_client/models/sms_projection.rb +282 -0
  54. data/lib/mailslurp_client/models/template_projection.rb +18 -18
  55. data/lib/mailslurp_client/models/thread_projection.rb +36 -36
  56. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -10
  57. data/lib/mailslurp_client/models/wait_for_sms_conditions.rb +371 -0
  58. data/lib/mailslurp_client/models/webhook_bounce_payload.rb +2 -2
  59. data/lib/mailslurp_client/models/webhook_bounce_recipient_payload.rb +2 -2
  60. data/lib/mailslurp_client/models/webhook_dto.rb +2 -2
  61. data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +2 -2
  62. data/lib/mailslurp_client/models/webhook_email_read_payload.rb +2 -2
  63. data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +2 -2
  64. data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +2 -2
  65. data/lib/mailslurp_client/models/webhook_new_email_payload.rb +2 -2
  66. data/lib/mailslurp_client/models/webhook_projection.rb +2 -2
  67. data/lib/mailslurp_client/models/webhook_result_dto.rb +2 -2
  68. data/lib/mailslurp_client/version.rb +1 -1
  69. data/lib/mailslurp_client.rb +19 -0
  70. metadata +21 -2
@@ -24,27 +24,27 @@ module MailSlurpClient
24
24
  # Thread subject
25
25
  attr_accessor :subject
26
26
 
27
- # Inbox ID
28
- attr_accessor :inbox_id
29
-
30
27
  # User ID
31
28
  attr_accessor :user_id
32
29
 
30
+ # Inbox ID
31
+ attr_accessor :inbox_id
32
+
33
33
  # To recipients
34
34
  attr_accessor :to
35
35
 
36
- # BCC recipients
37
- attr_accessor :bcc
38
-
39
- # CC recipients
40
- attr_accessor :cc
41
-
42
36
  # Created at DateTime
43
37
  attr_accessor :created_at
44
38
 
45
39
  # Updated at DateTime
46
40
  attr_accessor :updated_at
47
41
 
42
+ # BCC recipients
43
+ attr_accessor :bcc
44
+
45
+ # CC recipients
46
+ attr_accessor :cc
47
+
48
48
  # Alias ID
49
49
  attr_accessor :alias_id
50
50
 
@@ -54,13 +54,13 @@ module MailSlurpClient
54
54
  :'name' => :'name',
55
55
  :'id' => :'id',
56
56
  :'subject' => :'subject',
57
- :'inbox_id' => :'inboxId',
58
57
  :'user_id' => :'userId',
58
+ :'inbox_id' => :'inboxId',
59
59
  :'to' => :'to',
60
- :'bcc' => :'bcc',
61
- :'cc' => :'cc',
62
60
  :'created_at' => :'createdAt',
63
61
  :'updated_at' => :'updatedAt',
62
+ :'bcc' => :'bcc',
63
+ :'cc' => :'cc',
64
64
  :'alias_id' => :'aliasId'
65
65
  }
66
66
  end
@@ -71,13 +71,13 @@ module MailSlurpClient
71
71
  :'name' => :'String',
72
72
  :'id' => :'String',
73
73
  :'subject' => :'String',
74
- :'inbox_id' => :'String',
75
74
  :'user_id' => :'String',
75
+ :'inbox_id' => :'String',
76
76
  :'to' => :'Array<String>',
77
- :'bcc' => :'Array<String>',
78
- :'cc' => :'Array<String>',
79
77
  :'created_at' => :'DateTime',
80
78
  :'updated_at' => :'DateTime',
79
+ :'bcc' => :'Array<String>',
80
+ :'cc' => :'Array<String>',
81
81
  :'alias_id' => :'String'
82
82
  }
83
83
  end
@@ -115,20 +115,28 @@ module MailSlurpClient
115
115
  self.subject = attributes[:'subject']
116
116
  end
117
117
 
118
- if attributes.key?(:'inbox_id')
119
- self.inbox_id = attributes[:'inbox_id']
120
- end
121
-
122
118
  if attributes.key?(:'user_id')
123
119
  self.user_id = attributes[:'user_id']
124
120
  end
125
121
 
122
+ if attributes.key?(:'inbox_id')
123
+ self.inbox_id = attributes[:'inbox_id']
124
+ end
125
+
126
126
  if attributes.key?(:'to')
127
127
  if (value = attributes[:'to']).is_a?(Array)
128
128
  self.to = value
129
129
  end
130
130
  end
131
131
 
132
+ if attributes.key?(:'created_at')
133
+ self.created_at = attributes[:'created_at']
134
+ end
135
+
136
+ if attributes.key?(:'updated_at')
137
+ self.updated_at = attributes[:'updated_at']
138
+ end
139
+
132
140
  if attributes.key?(:'bcc')
133
141
  if (value = attributes[:'bcc']).is_a?(Array)
134
142
  self.bcc = value
@@ -141,14 +149,6 @@ module MailSlurpClient
141
149
  end
142
150
  end
143
151
 
144
- if attributes.key?(:'created_at')
145
- self.created_at = attributes[:'created_at']
146
- end
147
-
148
- if attributes.key?(:'updated_at')
149
- self.updated_at = attributes[:'updated_at']
150
- end
151
-
152
152
  if attributes.key?(:'alias_id')
153
153
  self.alias_id = attributes[:'alias_id']
154
154
  end
@@ -162,14 +162,14 @@ module MailSlurpClient
162
162
  invalid_properties.push('invalid value for "id", id cannot be nil.')
163
163
  end
164
164
 
165
- if @inbox_id.nil?
166
- invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
167
- end
168
-
169
165
  if @user_id.nil?
170
166
  invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
171
167
  end
172
168
 
169
+ if @inbox_id.nil?
170
+ invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
171
+ end
172
+
173
173
  if @to.nil?
174
174
  invalid_properties.push('invalid value for "to", to cannot be nil.')
175
175
  end
@@ -193,8 +193,8 @@ module MailSlurpClient
193
193
  # @return true if the model is valid
194
194
  def valid?
195
195
  return false if @id.nil?
196
- return false if @inbox_id.nil?
197
196
  return false if @user_id.nil?
197
+ return false if @inbox_id.nil?
198
198
  return false if @to.nil?
199
199
  return false if @created_at.nil?
200
200
  return false if @updated_at.nil?
@@ -210,13 +210,13 @@ module MailSlurpClient
210
210
  name == o.name &&
211
211
  id == o.id &&
212
212
  subject == o.subject &&
213
- inbox_id == o.inbox_id &&
214
213
  user_id == o.user_id &&
214
+ inbox_id == o.inbox_id &&
215
215
  to == o.to &&
216
- bcc == o.bcc &&
217
- cc == o.cc &&
218
216
  created_at == o.created_at &&
219
217
  updated_at == o.updated_at &&
218
+ bcc == o.bcc &&
219
+ cc == o.cc &&
220
220
  alias_id == o.alias_id
221
221
  end
222
222
 
@@ -229,7 +229,7 @@ module MailSlurpClient
229
229
  # Calculates hash code according to all attributes.
230
230
  # @return [Integer] Hash code
231
231
  def hash
232
- [name, id, subject, inbox_id, user_id, to, bcc, cc, created_at, updated_at, alias_id].hash
232
+ [name, id, subject, user_id, inbox_id, to, created_at, updated_at, bcc, cc, alias_id].hash
233
233
  end
234
234
 
235
235
  # Builds the object from hash
@@ -19,10 +19,10 @@ module MailSlurpClient
19
19
 
20
20
  attr_accessor :id
21
21
 
22
- attr_accessor :inbox_id
23
-
24
22
  attr_accessor :user_id
25
23
 
24
+ attr_accessor :inbox_id
25
+
26
26
  attr_accessor :created_at
27
27
 
28
28
  attr_accessor :recipient
@@ -38,8 +38,8 @@ module MailSlurpClient
38
38
  {
39
39
  :'name' => :'name',
40
40
  :'id' => :'id',
41
- :'inbox_id' => :'inboxId',
42
41
  :'user_id' => :'userId',
42
+ :'inbox_id' => :'inboxId',
43
43
  :'created_at' => :'createdAt',
44
44
  :'recipient' => :'recipient',
45
45
  :'seen' => :'seen',
@@ -53,8 +53,8 @@ module MailSlurpClient
53
53
  {
54
54
  :'name' => :'String',
55
55
  :'id' => :'String',
56
- :'inbox_id' => :'String',
57
56
  :'user_id' => :'String',
57
+ :'inbox_id' => :'String',
58
58
  :'created_at' => :'DateTime',
59
59
  :'recipient' => :'String',
60
60
  :'seen' => :'Boolean',
@@ -92,14 +92,14 @@ module MailSlurpClient
92
92
  self.id = attributes[:'id']
93
93
  end
94
94
 
95
- if attributes.key?(:'inbox_id')
96
- self.inbox_id = attributes[:'inbox_id']
97
- end
98
-
99
95
  if attributes.key?(:'user_id')
100
96
  self.user_id = attributes[:'user_id']
101
97
  end
102
98
 
99
+ if attributes.key?(:'inbox_id')
100
+ self.inbox_id = attributes[:'inbox_id']
101
+ end
102
+
103
103
  if attributes.key?(:'created_at')
104
104
  self.created_at = attributes[:'created_at']
105
105
  end
@@ -161,8 +161,8 @@ module MailSlurpClient
161
161
  self.class == o.class &&
162
162
  name == o.name &&
163
163
  id == o.id &&
164
- inbox_id == o.inbox_id &&
165
164
  user_id == o.user_id &&
165
+ inbox_id == o.inbox_id &&
166
166
  created_at == o.created_at &&
167
167
  recipient == o.recipient &&
168
168
  seen == o.seen &&
@@ -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, inbox_id, user_id, created_at, recipient, seen, seen_at, sent_email_id].hash
182
+ [name, id, user_id, inbox_id, created_at, recipient, seen, seen_at, sent_email_id].hash
183
183
  end
184
184
 
185
185
  # Builds the object from hash
@@ -0,0 +1,371 @@
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
+ # Conditions to apply to emails that you are waiting for
17
+ class WaitForSmsConditions
18
+ # ID of phone number to search within and apply conditions to. Essentially filtering the SMS found to give a count.
19
+ attr_accessor :phone_number_id
20
+
21
+ # Limit results
22
+ attr_accessor :limit
23
+
24
+ # Number of results that should match conditions. Either exactly or at least this amount based on the `countType`. If count condition is not met and the timeout has not been reached the `waitFor` method will retry the operation.
25
+ attr_accessor :count
26
+
27
+ # Max time in milliseconds to wait between retries if a `timeout` is specified.
28
+ attr_accessor :delay_timeout
29
+
30
+ # Max time in milliseconds to retry the `waitFor` operation until conditions are met.
31
+ attr_accessor :timeout
32
+
33
+ # Apply conditions only to **unread** SMS. All SMS messages begin with `read=false`. An SMS is marked `read=true` when an `SMS` has been returned to the user at least once. For example you have called `getSms` or `waitForSms` etc., or you have viewed the SMS in the dashboard.
34
+ attr_accessor :unread_only
35
+
36
+ # How result size should be compared with the expected size. Exactly or at-least matching result?
37
+ attr_accessor :count_type
38
+
39
+ # Conditions that should be matched for an SMS to qualify for results. Each condition will be applied in order to each SMS within a phone number to filter a result list of matching SMSs you are waiting for.
40
+ attr_accessor :matches
41
+
42
+ # Direction to sort matching SMSs by created time
43
+ attr_accessor :sort_direction
44
+
45
+ # ISO Date Time earliest time of SMS to consider. Filter for matching SMSs that were received after this date
46
+ attr_accessor :since
47
+
48
+ # ISO Date Time latest time of SMS to consider. Filter for matching SMSs that were received before this date
49
+ attr_accessor :before
50
+
51
+ class EnumAttributeValidator
52
+ attr_reader :datatype
53
+ attr_reader :allowable_values
54
+
55
+ def initialize(datatype, allowable_values)
56
+ @allowable_values = allowable_values.map do |value|
57
+ case datatype.to_s
58
+ when /Integer/i
59
+ value.to_i
60
+ when /Float/i
61
+ value.to_f
62
+ else
63
+ value
64
+ end
65
+ end
66
+ end
67
+
68
+ def valid?(value)
69
+ !value || allowable_values.include?(value)
70
+ end
71
+ end
72
+
73
+ # Attribute mapping from ruby-style variable name to JSON key.
74
+ def self.attribute_map
75
+ {
76
+ :'phone_number_id' => :'phoneNumberId',
77
+ :'limit' => :'limit',
78
+ :'count' => :'count',
79
+ :'delay_timeout' => :'delayTimeout',
80
+ :'timeout' => :'timeout',
81
+ :'unread_only' => :'unreadOnly',
82
+ :'count_type' => :'countType',
83
+ :'matches' => :'matches',
84
+ :'sort_direction' => :'sortDirection',
85
+ :'since' => :'since',
86
+ :'before' => :'before'
87
+ }
88
+ end
89
+
90
+ # Attribute type mapping.
91
+ def self.openapi_types
92
+ {
93
+ :'phone_number_id' => :'String',
94
+ :'limit' => :'Integer',
95
+ :'count' => :'Integer',
96
+ :'delay_timeout' => :'Integer',
97
+ :'timeout' => :'Integer',
98
+ :'unread_only' => :'Boolean',
99
+ :'count_type' => :'String',
100
+ :'matches' => :'Array<SmsMatchOption>',
101
+ :'sort_direction' => :'String',
102
+ :'since' => :'DateTime',
103
+ :'before' => :'DateTime'
104
+ }
105
+ end
106
+
107
+ # List of attributes with nullable: true
108
+ def self.openapi_nullable
109
+ Set.new([
110
+ ])
111
+ end
112
+
113
+ # Initializes the object
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ def initialize(attributes = {})
116
+ if (!attributes.is_a?(Hash))
117
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::WaitForSmsConditions` initialize method"
118
+ end
119
+
120
+ # check to see if the attribute exists and convert string to symbol for hash key
121
+ attributes = attributes.each_with_object({}) { |(k, v), h|
122
+ if (!self.class.attribute_map.key?(k.to_sym))
123
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::WaitForSmsConditions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
124
+ end
125
+ h[k.to_sym] = v
126
+ }
127
+
128
+ if attributes.key?(:'phone_number_id')
129
+ self.phone_number_id = attributes[:'phone_number_id']
130
+ end
131
+
132
+ if attributes.key?(:'limit')
133
+ self.limit = attributes[:'limit']
134
+ end
135
+
136
+ if attributes.key?(:'count')
137
+ self.count = attributes[:'count']
138
+ end
139
+
140
+ if attributes.key?(:'delay_timeout')
141
+ self.delay_timeout = attributes[:'delay_timeout']
142
+ end
143
+
144
+ if attributes.key?(:'timeout')
145
+ self.timeout = attributes[:'timeout']
146
+ end
147
+
148
+ if attributes.key?(:'unread_only')
149
+ self.unread_only = attributes[:'unread_only']
150
+ end
151
+
152
+ if attributes.key?(:'count_type')
153
+ self.count_type = attributes[:'count_type']
154
+ end
155
+
156
+ if attributes.key?(:'matches')
157
+ if (value = attributes[:'matches']).is_a?(Array)
158
+ self.matches = value
159
+ end
160
+ end
161
+
162
+ if attributes.key?(:'sort_direction')
163
+ self.sort_direction = attributes[:'sort_direction']
164
+ end
165
+
166
+ if attributes.key?(:'since')
167
+ self.since = attributes[:'since']
168
+ end
169
+
170
+ if attributes.key?(:'before')
171
+ self.before = attributes[:'before']
172
+ end
173
+ end
174
+
175
+ # Show invalid properties with the reasons. Usually used together with valid?
176
+ # @return Array for valid properties with the reasons
177
+ def list_invalid_properties
178
+ invalid_properties = Array.new
179
+ if @phone_number_id.nil?
180
+ invalid_properties.push('invalid value for "phone_number_id", phone_number_id cannot be nil.')
181
+ end
182
+
183
+ if @count.nil?
184
+ invalid_properties.push('invalid value for "count", count cannot be nil.')
185
+ end
186
+
187
+ if @timeout.nil?
188
+ invalid_properties.push('invalid value for "timeout", timeout cannot be nil.')
189
+ end
190
+
191
+ invalid_properties
192
+ end
193
+
194
+ # Check to see if the all the properties in the model are valid
195
+ # @return true if the model is valid
196
+ def valid?
197
+ return false if @phone_number_id.nil?
198
+ return false if @count.nil?
199
+ return false if @timeout.nil?
200
+ count_type_validator = EnumAttributeValidator.new('String', ["EXACTLY", "ATLEAST"])
201
+ return false unless count_type_validator.valid?(@count_type)
202
+ sort_direction_validator = EnumAttributeValidator.new('String', ["ASC", "DESC"])
203
+ return false unless sort_direction_validator.valid?(@sort_direction)
204
+ true
205
+ end
206
+
207
+ # Custom attribute writer method checking allowed values (enum).
208
+ # @param [Object] count_type Object to be assigned
209
+ def count_type=(count_type)
210
+ validator = EnumAttributeValidator.new('String', ["EXACTLY", "ATLEAST"])
211
+ unless validator.valid?(count_type)
212
+ fail ArgumentError, "invalid value for \"count_type\", must be one of #{validator.allowable_values}."
213
+ end
214
+ @count_type = count_type
215
+ end
216
+
217
+ # Custom attribute writer method checking allowed values (enum).
218
+ # @param [Object] sort_direction Object to be assigned
219
+ def sort_direction=(sort_direction)
220
+ validator = EnumAttributeValidator.new('String', ["ASC", "DESC"])
221
+ unless validator.valid?(sort_direction)
222
+ fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{validator.allowable_values}."
223
+ end
224
+ @sort_direction = sort_direction
225
+ end
226
+
227
+ # Checks equality by comparing each attribute.
228
+ # @param [Object] Object to be compared
229
+ def ==(o)
230
+ return true if self.equal?(o)
231
+ self.class == o.class &&
232
+ phone_number_id == o.phone_number_id &&
233
+ limit == o.limit &&
234
+ count == o.count &&
235
+ delay_timeout == o.delay_timeout &&
236
+ timeout == o.timeout &&
237
+ unread_only == o.unread_only &&
238
+ count_type == o.count_type &&
239
+ matches == o.matches &&
240
+ sort_direction == o.sort_direction &&
241
+ since == o.since &&
242
+ before == o.before
243
+ end
244
+
245
+ # @see the `==` method
246
+ # @param [Object] Object to be compared
247
+ def eql?(o)
248
+ self == o
249
+ end
250
+
251
+ # Calculates hash code according to all attributes.
252
+ # @return [Integer] Hash code
253
+ def hash
254
+ [phone_number_id, limit, count, delay_timeout, timeout, unread_only, count_type, matches, sort_direction, since, before].hash
255
+ end
256
+
257
+ # Builds the object from hash
258
+ # @param [Hash] attributes Model attributes in the form of hash
259
+ # @return [Object] Returns the model itself
260
+ def self.build_from_hash(attributes)
261
+ new.build_from_hash(attributes)
262
+ end
263
+
264
+ # Builds the object from hash
265
+ # @param [Hash] attributes Model attributes in the form of hash
266
+ # @return [Object] Returns the model itself
267
+ def build_from_hash(attributes)
268
+ return nil unless attributes.is_a?(Hash)
269
+ self.class.openapi_types.each_pair do |key, type|
270
+ if type =~ /\AArray<(.*)>/i
271
+ # check to ensure the input is an array given that the attribute
272
+ # is documented as an array but the input is not
273
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
274
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
275
+ end
276
+ elsif !attributes[self.class.attribute_map[key]].nil?
277
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
278
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
279
+ end
280
+
281
+ self
282
+ end
283
+
284
+ # Deserializes the data based on type
285
+ # @param string type Data type
286
+ # @param string value Value to be deserialized
287
+ # @return [Object] Deserialized data
288
+ def _deserialize(type, value)
289
+ case type.to_sym
290
+ when :DateTime
291
+ DateTime.parse(value)
292
+ when :Date
293
+ Date.parse(value)
294
+ when :String
295
+ value.to_s
296
+ when :Integer
297
+ value.to_i
298
+ when :Float
299
+ value.to_f
300
+ when :Boolean
301
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
302
+ true
303
+ else
304
+ false
305
+ end
306
+ when :Object
307
+ # generic object (usually a Hash), return directly
308
+ value
309
+ when /\AArray<(?<inner_type>.+)>\z/
310
+ inner_type = Regexp.last_match[:inner_type]
311
+ value.map { |v| _deserialize(inner_type, v) }
312
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
313
+ k_type = Regexp.last_match[:k_type]
314
+ v_type = Regexp.last_match[:v_type]
315
+ {}.tap do |hash|
316
+ value.each do |k, v|
317
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
318
+ end
319
+ end
320
+ else # model
321
+ MailSlurpClient.const_get(type).build_from_hash(value)
322
+ end
323
+ end
324
+
325
+ # Returns the string representation of the object
326
+ # @return [String] String presentation of the object
327
+ def to_s
328
+ to_hash.to_s
329
+ end
330
+
331
+ # to_body is an alias to to_hash (backward compatibility)
332
+ # @return [Hash] Returns the object in the form of hash
333
+ def to_body
334
+ to_hash
335
+ end
336
+
337
+ # Returns the object in the form of hash
338
+ # @return [Hash] Returns the object in the form of hash
339
+ def to_hash
340
+ hash = {}
341
+ self.class.attribute_map.each_pair do |attr, param|
342
+ value = self.send(attr)
343
+ if value.nil?
344
+ is_nullable = self.class.openapi_nullable.include?(attr)
345
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
346
+ end
347
+
348
+ hash[param] = _to_hash(value)
349
+ end
350
+ hash
351
+ end
352
+
353
+ # Outputs non-array value in the form of hash
354
+ # For object, use to_hash. Otherwise, just return the value
355
+ # @param [Object] value Any valid value
356
+ # @return [Hash] Returns the value in the form of hash
357
+ def _to_hash(value)
358
+ if value.is_a?(Array)
359
+ value.compact.map { |v| _to_hash(v) }
360
+ elsif value.is_a?(Hash)
361
+ {}.tap do |hash|
362
+ value.each { |k, v| hash[k] = _to_hash(v) }
363
+ end
364
+ elsif value.respond_to? :to_hash
365
+ value.to_hash
366
+ else
367
+ value
368
+ end
369
+ end
370
+ end
371
+ end
@@ -178,7 +178,7 @@ module MailSlurpClient
178
178
  return false if @message_id.nil?
179
179
  return false if @webhook_id.nil?
180
180
  return false if @event_name.nil?
181
- event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
181
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
182
182
  return false unless event_name_validator.valid?(@event_name)
183
183
  return false if @bounce_id.nil?
184
184
  return false if @sender.nil?
@@ -188,7 +188,7 @@ module MailSlurpClient
188
188
  # Custom attribute writer method checking allowed values (enum).
189
189
  # @param [Object] event_name Object to be assigned
190
190
  def event_name=(event_name)
191
- validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
191
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
192
192
  unless validator.valid?(event_name)
193
193
  fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
194
194
  end
@@ -145,7 +145,7 @@ module MailSlurpClient
145
145
  return false if @message_id.nil?
146
146
  return false if @webhook_id.nil?
147
147
  return false if @event_name.nil?
148
- event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
148
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
149
149
  return false unless event_name_validator.valid?(@event_name)
150
150
  return false if @recipient.nil?
151
151
  true
@@ -154,7 +154,7 @@ module MailSlurpClient
154
154
  # Custom attribute writer method checking allowed values (enum).
155
155
  # @param [Object] event_name Object to be assigned
156
156
  def event_name=(event_name)
157
- validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
157
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
158
158
  unless validator.valid?(event_name)
159
159
  fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
160
160
  end
@@ -220,7 +220,7 @@ module MailSlurpClient
220
220
  return false if @payload_json_schema.nil?
221
221
  return false if @created_at.nil?
222
222
  return false if @updated_at.nil?
223
- event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
223
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
224
224
  return false unless event_name_validator.valid?(@event_name)
225
225
  true
226
226
  end
@@ -238,7 +238,7 @@ module MailSlurpClient
238
238
  # Custom attribute writer method checking allowed values (enum).
239
239
  # @param [Object] event_name Object to be assigned
240
240
  def event_name=(event_name)
241
- validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
241
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
242
242
  unless validator.valid?(event_name)
243
243
  fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
244
244
  end
@@ -197,7 +197,7 @@ module MailSlurpClient
197
197
  return false if @message_id.nil?
198
198
  return false if @webhook_id.nil?
199
199
  return false if @event_name.nil?
200
- event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
200
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
201
201
  return false unless event_name_validator.valid?(@event_name)
202
202
  return false if @inbox_id.nil?
203
203
  return false if @pixel_id.nil?
@@ -210,7 +210,7 @@ module MailSlurpClient
210
210
  # Custom attribute writer method checking allowed values (enum).
211
211
  # @param [Object] event_name Object to be assigned
212
212
  def event_name=(event_name)
213
- validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
213
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
214
214
  unless validator.valid?(event_name)
215
215
  fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
216
216
  end