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
@@ -0,0 +1,267 @@
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 SmsPreview
17
+ attr_accessor :id
18
+
19
+ attr_accessor :user_id
20
+
21
+ attr_accessor :phone_number
22
+
23
+ attr_accessor :from_number
24
+
25
+ attr_accessor :created_at
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'id' => :'id',
31
+ :'user_id' => :'userId',
32
+ :'phone_number' => :'phoneNumber',
33
+ :'from_number' => :'fromNumber',
34
+ :'created_at' => :'createdAt'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'id' => :'String',
42
+ :'user_id' => :'String',
43
+ :'phone_number' => :'String',
44
+ :'from_number' => :'String',
45
+ :'created_at' => :'DateTime'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::SmsPreview` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::SmsPreview`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'id')
71
+ self.id = attributes[:'id']
72
+ end
73
+
74
+ if attributes.key?(:'user_id')
75
+ self.user_id = attributes[:'user_id']
76
+ end
77
+
78
+ if attributes.key?(:'phone_number')
79
+ self.phone_number = attributes[:'phone_number']
80
+ end
81
+
82
+ if attributes.key?(:'from_number')
83
+ self.from_number = attributes[:'from_number']
84
+ end
85
+
86
+ if attributes.key?(:'created_at')
87
+ self.created_at = attributes[:'created_at']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ invalid_properties = Array.new
95
+ if @id.nil?
96
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
97
+ end
98
+
99
+ if @user_id.nil?
100
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
101
+ end
102
+
103
+ if @phone_number.nil?
104
+ invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
105
+ end
106
+
107
+ if @from_number.nil?
108
+ invalid_properties.push('invalid value for "from_number", from_number cannot be nil.')
109
+ end
110
+
111
+ if @created_at.nil?
112
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
113
+ end
114
+
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ return false if @id.nil?
122
+ return false if @user_id.nil?
123
+ return false if @phone_number.nil?
124
+ return false if @from_number.nil?
125
+ return false if @created_at.nil?
126
+ true
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(o)
132
+ return true if self.equal?(o)
133
+ self.class == o.class &&
134
+ id == o.id &&
135
+ user_id == o.user_id &&
136
+ phone_number == o.phone_number &&
137
+ from_number == o.from_number &&
138
+ created_at == o.created_at
139
+ end
140
+
141
+ # @see the `==` method
142
+ # @param [Object] Object to be compared
143
+ def eql?(o)
144
+ self == o
145
+ end
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Integer] Hash code
149
+ def hash
150
+ [id, user_id, phone_number, from_number, created_at].hash
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def self.build_from_hash(attributes)
157
+ new.build_from_hash(attributes)
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ self.class.openapi_types.each_pair do |key, type|
166
+ if type =~ /\AArray<(.*)>/i
167
+ # check to ensure the input is an array given that the attribute
168
+ # is documented as an array but the input is not
169
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
170
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
171
+ end
172
+ elsif !attributes[self.class.attribute_map[key]].nil?
173
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
174
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
175
+ end
176
+
177
+ self
178
+ end
179
+
180
+ # Deserializes the data based on type
181
+ # @param string type Data type
182
+ # @param string value Value to be deserialized
183
+ # @return [Object] Deserialized data
184
+ def _deserialize(type, value)
185
+ case type.to_sym
186
+ when :DateTime
187
+ DateTime.parse(value)
188
+ when :Date
189
+ Date.parse(value)
190
+ when :String
191
+ value.to_s
192
+ when :Integer
193
+ value.to_i
194
+ when :Float
195
+ value.to_f
196
+ when :Boolean
197
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
198
+ true
199
+ else
200
+ false
201
+ end
202
+ when :Object
203
+ # generic object (usually a Hash), return directly
204
+ value
205
+ when /\AArray<(?<inner_type>.+)>\z/
206
+ inner_type = Regexp.last_match[:inner_type]
207
+ value.map { |v| _deserialize(inner_type, v) }
208
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
209
+ k_type = Regexp.last_match[:k_type]
210
+ v_type = Regexp.last_match[:v_type]
211
+ {}.tap do |hash|
212
+ value.each do |k, v|
213
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
214
+ end
215
+ end
216
+ else # model
217
+ MailSlurpClient.const_get(type).build_from_hash(value)
218
+ end
219
+ end
220
+
221
+ # Returns the string representation of the object
222
+ # @return [String] String presentation of the object
223
+ def to_s
224
+ to_hash.to_s
225
+ end
226
+
227
+ # to_body is an alias to to_hash (backward compatibility)
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_body
230
+ to_hash
231
+ end
232
+
233
+ # Returns the object in the form of hash
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_hash
236
+ hash = {}
237
+ self.class.attribute_map.each_pair do |attr, param|
238
+ value = self.send(attr)
239
+ if value.nil?
240
+ is_nullable = self.class.openapi_nullable.include?(attr)
241
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
+ end
243
+
244
+ hash[param] = _to_hash(value)
245
+ end
246
+ hash
247
+ end
248
+
249
+ # Outputs non-array value in the form of hash
250
+ # For object, use to_hash. Otherwise, just return the value
251
+ # @param [Object] value Any valid value
252
+ # @return [Hash] Returns the value in the form of hash
253
+ def _to_hash(value)
254
+ if value.is_a?(Array)
255
+ value.compact.map { |v| _to_hash(v) }
256
+ elsif value.is_a?(Hash)
257
+ {}.tap do |hash|
258
+ value.each { |k, v| hash[k] = _to_hash(v) }
259
+ end
260
+ elsif value.respond_to? :to_hash
261
+ value.to_hash
262
+ else
263
+ value
264
+ end
265
+ end
266
+ end
267
+ end
@@ -0,0 +1,282 @@
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
+ # SMS projection
17
+ class SmsProjection
18
+ attr_accessor :id
19
+
20
+ attr_accessor :user_id
21
+
22
+ attr_accessor :phone_number
23
+
24
+ attr_accessor :created_at
25
+
26
+ attr_accessor :read
27
+
28
+ attr_accessor :from_number
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'id' => :'id',
34
+ :'user_id' => :'userId',
35
+ :'phone_number' => :'phoneNumber',
36
+ :'created_at' => :'createdAt',
37
+ :'read' => :'read',
38
+ :'from_number' => :'fromNumber'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'id' => :'String',
46
+ :'user_id' => :'String',
47
+ :'phone_number' => :'String',
48
+ :'created_at' => :'DateTime',
49
+ :'read' => :'Boolean',
50
+ :'from_number' => :'String'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::SmsProjection` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!self.class.attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::SmsProjection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'id')
76
+ self.id = attributes[:'id']
77
+ end
78
+
79
+ if attributes.key?(:'user_id')
80
+ self.user_id = attributes[:'user_id']
81
+ end
82
+
83
+ if attributes.key?(:'phone_number')
84
+ self.phone_number = attributes[:'phone_number']
85
+ end
86
+
87
+ if attributes.key?(:'created_at')
88
+ self.created_at = attributes[:'created_at']
89
+ end
90
+
91
+ if attributes.key?(:'read')
92
+ self.read = attributes[:'read']
93
+ end
94
+
95
+ if attributes.key?(:'from_number')
96
+ self.from_number = attributes[:'from_number']
97
+ end
98
+ end
99
+
100
+ # Show invalid properties with the reasons. Usually used together with valid?
101
+ # @return Array for valid properties with the reasons
102
+ def list_invalid_properties
103
+ invalid_properties = Array.new
104
+ if @id.nil?
105
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
106
+ end
107
+
108
+ if @user_id.nil?
109
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
110
+ end
111
+
112
+ if @phone_number.nil?
113
+ invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
114
+ end
115
+
116
+ if @created_at.nil?
117
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
118
+ end
119
+
120
+ if @read.nil?
121
+ invalid_properties.push('invalid value for "read", read cannot be nil.')
122
+ end
123
+
124
+ if @from_number.nil?
125
+ invalid_properties.push('invalid value for "from_number", from_number cannot be nil.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ return false if @id.nil?
135
+ return false if @user_id.nil?
136
+ return false if @phone_number.nil?
137
+ return false if @created_at.nil?
138
+ return false if @read.nil?
139
+ return false if @from_number.nil?
140
+ true
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ id == o.id &&
149
+ user_id == o.user_id &&
150
+ phone_number == o.phone_number &&
151
+ created_at == o.created_at &&
152
+ read == o.read &&
153
+ from_number == o.from_number
154
+ end
155
+
156
+ # @see the `==` method
157
+ # @param [Object] Object to be compared
158
+ def eql?(o)
159
+ self == o
160
+ end
161
+
162
+ # Calculates hash code according to all attributes.
163
+ # @return [Integer] Hash code
164
+ def hash
165
+ [id, user_id, phone_number, created_at, read, from_number].hash
166
+ end
167
+
168
+ # Builds the object from hash
169
+ # @param [Hash] attributes Model attributes in the form of hash
170
+ # @return [Object] Returns the model itself
171
+ def self.build_from_hash(attributes)
172
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
179
+ return nil unless attributes.is_a?(Hash)
180
+ self.class.openapi_types.each_pair do |key, type|
181
+ if type =~ /\AArray<(.*)>/i
182
+ # check to ensure the input is an array given that the attribute
183
+ # is documented as an array but the input is not
184
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
185
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
186
+ end
187
+ elsif !attributes[self.class.attribute_map[key]].nil?
188
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
189
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
190
+ end
191
+
192
+ self
193
+ end
194
+
195
+ # Deserializes the data based on type
196
+ # @param string type Data type
197
+ # @param string value Value to be deserialized
198
+ # @return [Object] Deserialized data
199
+ def _deserialize(type, value)
200
+ case type.to_sym
201
+ when :DateTime
202
+ DateTime.parse(value)
203
+ when :Date
204
+ Date.parse(value)
205
+ when :String
206
+ value.to_s
207
+ when :Integer
208
+ value.to_i
209
+ when :Float
210
+ value.to_f
211
+ when :Boolean
212
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
213
+ true
214
+ else
215
+ false
216
+ end
217
+ when :Object
218
+ # generic object (usually a Hash), return directly
219
+ value
220
+ when /\AArray<(?<inner_type>.+)>\z/
221
+ inner_type = Regexp.last_match[:inner_type]
222
+ value.map { |v| _deserialize(inner_type, v) }
223
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
224
+ k_type = Regexp.last_match[:k_type]
225
+ v_type = Regexp.last_match[:v_type]
226
+ {}.tap do |hash|
227
+ value.each do |k, v|
228
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
229
+ end
230
+ end
231
+ else # model
232
+ MailSlurpClient.const_get(type).build_from_hash(value)
233
+ end
234
+ end
235
+
236
+ # Returns the string representation of the object
237
+ # @return [String] String presentation of the object
238
+ def to_s
239
+ to_hash.to_s
240
+ end
241
+
242
+ # to_body is an alias to to_hash (backward compatibility)
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_body
245
+ to_hash
246
+ end
247
+
248
+ # Returns the object in the form of hash
249
+ # @return [Hash] Returns the object in the form of hash
250
+ def to_hash
251
+ hash = {}
252
+ self.class.attribute_map.each_pair do |attr, param|
253
+ value = self.send(attr)
254
+ if value.nil?
255
+ is_nullable = self.class.openapi_nullable.include?(attr)
256
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
257
+ end
258
+
259
+ hash[param] = _to_hash(value)
260
+ end
261
+ hash
262
+ end
263
+
264
+ # Outputs non-array value in the form of hash
265
+ # For object, use to_hash. Otherwise, just return the value
266
+ # @param [Object] value Any valid value
267
+ # @return [Hash] Returns the value in the form of hash
268
+ def _to_hash(value)
269
+ if value.is_a?(Array)
270
+ value.compact.map { |v| _to_hash(v) }
271
+ elsif value.is_a?(Hash)
272
+ {}.tap do |hash|
273
+ value.each { |k, v| hash[k] = _to_hash(v) }
274
+ end
275
+ elsif value.respond_to? :to_hash
276
+ value.to_hash
277
+ else
278
+ value
279
+ end
280
+ end
281
+ end
282
+ end
@@ -21,18 +21,18 @@ module MailSlurpClient
21
21
 
22
22
  attr_accessor :created_at
23
23
 
24
- attr_accessor :variables
25
-
26
24
  attr_accessor :updated_at
27
25
 
26
+ attr_accessor :variables
27
+
28
28
  # Attribute mapping from ruby-style variable name to JSON key.
29
29
  def self.attribute_map
30
30
  {
31
31
  :'name' => :'name',
32
32
  :'id' => :'id',
33
33
  :'created_at' => :'createdAt',
34
- :'variables' => :'variables',
35
- :'updated_at' => :'updatedAt'
34
+ :'updated_at' => :'updatedAt',
35
+ :'variables' => :'variables'
36
36
  }
37
37
  end
38
38
 
@@ -42,8 +42,8 @@ module MailSlurpClient
42
42
  :'name' => :'String',
43
43
  :'id' => :'String',
44
44
  :'created_at' => :'DateTime',
45
- :'variables' => :'Array<String>',
46
- :'updated_at' => :'DateTime'
45
+ :'updated_at' => :'DateTime',
46
+ :'variables' => :'Array<String>'
47
47
  }
48
48
  end
49
49
 
@@ -80,15 +80,15 @@ module MailSlurpClient
80
80
  self.created_at = attributes[:'created_at']
81
81
  end
82
82
 
83
+ if attributes.key?(:'updated_at')
84
+ self.updated_at = attributes[:'updated_at']
85
+ end
86
+
83
87
  if attributes.key?(:'variables')
84
88
  if (value = attributes[:'variables']).is_a?(Array)
85
89
  self.variables = value
86
90
  end
87
91
  end
88
-
89
- if attributes.key?(:'updated_at')
90
- self.updated_at = attributes[:'updated_at']
91
- end
92
92
  end
93
93
 
94
94
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -107,14 +107,14 @@ module MailSlurpClient
107
107
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
108
108
  end
109
109
 
110
- if @variables.nil?
111
- invalid_properties.push('invalid value for "variables", variables cannot be nil.')
112
- end
113
-
114
110
  if @updated_at.nil?
115
111
  invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
116
112
  end
117
113
 
114
+ if @variables.nil?
115
+ invalid_properties.push('invalid value for "variables", variables cannot be nil.')
116
+ end
117
+
118
118
  invalid_properties
119
119
  end
120
120
 
@@ -124,8 +124,8 @@ module MailSlurpClient
124
124
  return false if @name.nil?
125
125
  return false if @id.nil?
126
126
  return false if @created_at.nil?
127
- return false if @variables.nil?
128
127
  return false if @updated_at.nil?
128
+ return false if @variables.nil?
129
129
  true
130
130
  end
131
131
 
@@ -137,8 +137,8 @@ module MailSlurpClient
137
137
  name == o.name &&
138
138
  id == o.id &&
139
139
  created_at == o.created_at &&
140
- variables == o.variables &&
141
- updated_at == o.updated_at
140
+ updated_at == o.updated_at &&
141
+ variables == o.variables
142
142
  end
143
143
 
144
144
  # @see the `==` method
@@ -150,7 +150,7 @@ module MailSlurpClient
150
150
  # Calculates hash code according to all attributes.
151
151
  # @return [Integer] Hash code
152
152
  def hash
153
- [name, id, created_at, variables, updated_at].hash
153
+ [name, id, created_at, updated_at, variables].hash
154
154
  end
155
155
 
156
156
  # Builds the object from hash