mailslurp_client 15.5.6 → 15.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/api_internal_controller_api.rb +89 -0
  3. data/lib/mailslurp_client/api/bounce_controller_api.rb +64 -0
  4. data/lib/mailslurp_client/api/email_verification_controller_api.rb +179 -0
  5. data/lib/mailslurp_client/api/mail_server_controller_api.rb +2 -2
  6. data/lib/mailslurp_client/models/alias_projection.rb +10 -10
  7. data/lib/mailslurp_client/models/bounce_recipient.rb +0 -5
  8. data/lib/mailslurp_client/models/bounced_recipient_dto.rb +0 -5
  9. data/lib/mailslurp_client/models/email_projection.rb +12 -12
  10. data/lib/mailslurp_client/models/email_validation_request.rb +276 -0
  11. data/lib/mailslurp_client/models/filter_bounced_recipients_options.rb +213 -0
  12. data/lib/mailslurp_client/models/filter_bounced_recipients_result.rb +213 -0
  13. data/lib/mailslurp_client/models/get_or_create_saml_user_options.rb +234 -0
  14. data/lib/mailslurp_client/models/page_email_validation_request.rb +308 -0
  15. data/lib/mailslurp_client/models/send_email_options.rb +36 -4
  16. data/lib/mailslurp_client/models/sent_email_dto.rb +13 -4
  17. data/lib/mailslurp_client/models/sent_email_projection.rb +17 -17
  18. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -10
  19. data/lib/mailslurp_client/models/user_dto.rb +438 -0
  20. data/lib/mailslurp_client/models/validate_email_address_list_options.rb +213 -0
  21. data/lib/mailslurp_client/models/validate_email_address_list_result.rb +245 -0
  22. data/lib/mailslurp_client/version.rb +1 -1
  23. data/lib/mailslurp_client.rb +10 -0
  24. metadata +12 -2
@@ -25,10 +25,10 @@ module MailSlurpClient
25
25
 
26
26
  attr_accessor :inbox_id
27
27
 
28
- attr_accessor :to
29
-
30
28
  attr_accessor :attachments
31
29
 
30
+ attr_accessor :to
31
+
32
32
  attr_accessor :bcc
33
33
 
34
34
  attr_accessor :cc
@@ -45,8 +45,8 @@ module MailSlurpClient
45
45
  :'user_id' => :'userId',
46
46
  :'subject' => :'subject',
47
47
  :'inbox_id' => :'inboxId',
48
- :'to' => :'to',
49
48
  :'attachments' => :'attachments',
49
+ :'to' => :'to',
50
50
  :'bcc' => :'bcc',
51
51
  :'cc' => :'cc',
52
52
  :'created_at' => :'createdAt',
@@ -62,8 +62,8 @@ module MailSlurpClient
62
62
  :'user_id' => :'String',
63
63
  :'subject' => :'String',
64
64
  :'inbox_id' => :'String',
65
- :'to' => :'Array<String>',
66
65
  :'attachments' => :'Array<String>',
66
+ :'to' => :'Array<String>',
67
67
  :'bcc' => :'Array<String>',
68
68
  :'cc' => :'Array<String>',
69
69
  :'created_at' => :'DateTime',
@@ -112,18 +112,18 @@ module MailSlurpClient
112
112
  self.inbox_id = attributes[:'inbox_id']
113
113
  end
114
114
 
115
- if attributes.key?(:'to')
116
- if (value = attributes[:'to']).is_a?(Array)
117
- self.to = value
118
- end
119
- end
120
-
121
115
  if attributes.key?(:'attachments')
122
116
  if (value = attributes[:'attachments']).is_a?(Array)
123
117
  self.attachments = value
124
118
  end
125
119
  end
126
120
 
121
+ if attributes.key?(:'to')
122
+ if (value = attributes[:'to']).is_a?(Array)
123
+ self.to = value
124
+ end
125
+ end
126
+
127
127
  if attributes.key?(:'bcc')
128
128
  if (value = attributes[:'bcc']).is_a?(Array)
129
129
  self.bcc = value
@@ -161,14 +161,14 @@ module MailSlurpClient
161
161
  invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
162
162
  end
163
163
 
164
- if @to.nil?
165
- invalid_properties.push('invalid value for "to", to cannot be nil.')
166
- end
167
-
168
164
  if @attachments.nil?
169
165
  invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
170
166
  end
171
167
 
168
+ if @to.nil?
169
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
170
+ end
171
+
172
172
  if @bcc.nil?
173
173
  invalid_properties.push('invalid value for "bcc", bcc cannot be nil.')
174
174
  end
@@ -190,8 +190,8 @@ module MailSlurpClient
190
190
  return false if @id.nil?
191
191
  return false if @user_id.nil?
192
192
  return false if @inbox_id.nil?
193
- return false if @to.nil?
194
193
  return false if @attachments.nil?
194
+ return false if @to.nil?
195
195
  return false if @bcc.nil?
196
196
  return false if @cc.nil?
197
197
  return false if @created_at.nil?
@@ -208,8 +208,8 @@ module MailSlurpClient
208
208
  user_id == o.user_id &&
209
209
  subject == o.subject &&
210
210
  inbox_id == o.inbox_id &&
211
- to == o.to &&
212
211
  attachments == o.attachments &&
212
+ to == o.to &&
213
213
  bcc == o.bcc &&
214
214
  cc == o.cc &&
215
215
  created_at == o.created_at &&
@@ -225,7 +225,7 @@ module MailSlurpClient
225
225
  # Calculates hash code according to all attributes.
226
226
  # @return [Integer] Hash code
227
227
  def hash
228
- [id, from, user_id, subject, inbox_id, to, attachments, bcc, cc, created_at, body_md5_hash].hash
228
+ [id, from, user_id, subject, inbox_id, attachments, to, bcc, cc, created_at, body_md5_hash].hash
229
229
  end
230
230
 
231
231
  # Builds the object from hash
@@ -24,10 +24,10 @@ module MailSlurpClient
24
24
 
25
25
  attr_accessor :created_at
26
26
 
27
- attr_accessor :seen
28
-
29
27
  attr_accessor :recipient
30
28
 
29
+ attr_accessor :seen
30
+
31
31
  attr_accessor :seen_at
32
32
 
33
33
  attr_accessor :sent_email_id
@@ -40,8 +40,8 @@ module MailSlurpClient
40
40
  :'user_id' => :'userId',
41
41
  :'inbox_id' => :'inboxId',
42
42
  :'created_at' => :'createdAt',
43
- :'seen' => :'seen',
44
43
  :'recipient' => :'recipient',
44
+ :'seen' => :'seen',
45
45
  :'seen_at' => :'seenAt',
46
46
  :'sent_email_id' => :'sentEmailId'
47
47
  }
@@ -55,8 +55,8 @@ module MailSlurpClient
55
55
  :'user_id' => :'String',
56
56
  :'inbox_id' => :'String',
57
57
  :'created_at' => :'DateTime',
58
- :'seen' => :'Boolean',
59
58
  :'recipient' => :'String',
59
+ :'seen' => :'Boolean',
60
60
  :'seen_at' => :'DateTime',
61
61
  :'sent_email_id' => :'String'
62
62
  }
@@ -103,14 +103,14 @@ module MailSlurpClient
103
103
  self.created_at = attributes[:'created_at']
104
104
  end
105
105
 
106
- if attributes.key?(:'seen')
107
- self.seen = attributes[:'seen']
108
- end
109
-
110
106
  if attributes.key?(:'recipient')
111
107
  self.recipient = attributes[:'recipient']
112
108
  end
113
109
 
110
+ if attributes.key?(:'seen')
111
+ self.seen = attributes[:'seen']
112
+ end
113
+
114
114
  if attributes.key?(:'seen_at')
115
115
  self.seen_at = attributes[:'seen_at']
116
116
  end
@@ -163,8 +163,8 @@ module MailSlurpClient
163
163
  user_id == o.user_id &&
164
164
  inbox_id == o.inbox_id &&
165
165
  created_at == o.created_at &&
166
- seen == o.seen &&
167
166
  recipient == o.recipient &&
167
+ seen == o.seen &&
168
168
  seen_at == o.seen_at &&
169
169
  sent_email_id == o.sent_email_id
170
170
  end
@@ -178,7 +178,7 @@ module MailSlurpClient
178
178
  # Calculates hash code according to all attributes.
179
179
  # @return [Integer] Hash code
180
180
  def hash
181
- [name, id, user_id, inbox_id, created_at, seen, recipient, seen_at, sent_email_id].hash
181
+ [name, id, user_id, inbox_id, created_at, recipient, seen, seen_at, sent_email_id].hash
182
182
  end
183
183
 
184
184
  # Builds the object from hash
@@ -0,0 +1,438 @@
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
+ # Representation a user's account
17
+ class UserDto
18
+ attr_accessor :id
19
+
20
+ attr_accessor :api_key
21
+
22
+ attr_accessor :email_address
23
+
24
+ attr_accessor :email_address_md5
25
+
26
+ attr_accessor :created
27
+
28
+ attr_accessor :user_type
29
+
30
+ # Does user belong to an organization
31
+ attr_accessor :organization
32
+
33
+ # Has user accepted an organization invite
34
+ attr_accessor :verified
35
+
36
+ attr_accessor :has_password
37
+
38
+ attr_accessor :is_frozen
39
+
40
+ attr_accessor :add_new_contacts
41
+
42
+ attr_accessor :sso_provider
43
+
44
+ attr_accessor :customer_id
45
+
46
+ attr_accessor :has_onboarded
47
+
48
+ attr_accessor :imap_username
49
+
50
+ attr_accessor :imap_password
51
+
52
+ attr_accessor :smtp_username
53
+
54
+ attr_accessor :smtp_password
55
+
56
+ class EnumAttributeValidator
57
+ attr_reader :datatype
58
+ attr_reader :allowable_values
59
+
60
+ def initialize(datatype, allowable_values)
61
+ @allowable_values = allowable_values.map do |value|
62
+ case datatype.to_s
63
+ when /Integer/i
64
+ value.to_i
65
+ when /Float/i
66
+ value.to_f
67
+ else
68
+ value
69
+ end
70
+ end
71
+ end
72
+
73
+ def valid?(value)
74
+ !value || allowable_values.include?(value)
75
+ end
76
+ end
77
+
78
+ # Attribute mapping from ruby-style variable name to JSON key.
79
+ def self.attribute_map
80
+ {
81
+ :'id' => :'id',
82
+ :'api_key' => :'apiKey',
83
+ :'email_address' => :'emailAddress',
84
+ :'email_address_md5' => :'emailAddressMd5',
85
+ :'created' => :'created',
86
+ :'user_type' => :'userType',
87
+ :'organization' => :'organization',
88
+ :'verified' => :'verified',
89
+ :'has_password' => :'hasPassword',
90
+ :'is_frozen' => :'isFrozen',
91
+ :'add_new_contacts' => :'addNewContacts',
92
+ :'sso_provider' => :'ssoProvider',
93
+ :'customer_id' => :'customerId',
94
+ :'has_onboarded' => :'hasOnboarded',
95
+ :'imap_username' => :'imapUsername',
96
+ :'imap_password' => :'imapPassword',
97
+ :'smtp_username' => :'smtpUsername',
98
+ :'smtp_password' => :'smtpPassword'
99
+ }
100
+ end
101
+
102
+ # Attribute type mapping.
103
+ def self.openapi_types
104
+ {
105
+ :'id' => :'String',
106
+ :'api_key' => :'String',
107
+ :'email_address' => :'String',
108
+ :'email_address_md5' => :'String',
109
+ :'created' => :'DateTime',
110
+ :'user_type' => :'String',
111
+ :'organization' => :'String',
112
+ :'verified' => :'String',
113
+ :'has_password' => :'Boolean',
114
+ :'is_frozen' => :'Boolean',
115
+ :'add_new_contacts' => :'Boolean',
116
+ :'sso_provider' => :'String',
117
+ :'customer_id' => :'String',
118
+ :'has_onboarded' => :'Boolean',
119
+ :'imap_username' => :'String',
120
+ :'imap_password' => :'String',
121
+ :'smtp_username' => :'String',
122
+ :'smtp_password' => :'String'
123
+ }
124
+ end
125
+
126
+ # List of attributes with nullable: true
127
+ def self.openapi_nullable
128
+ Set.new([
129
+ ])
130
+ end
131
+
132
+ # Initializes the object
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ def initialize(attributes = {})
135
+ if (!attributes.is_a?(Hash))
136
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::UserDto` initialize method"
137
+ end
138
+
139
+ # check to see if the attribute exists and convert string to symbol for hash key
140
+ attributes = attributes.each_with_object({}) { |(k, v), h|
141
+ if (!self.class.attribute_map.key?(k.to_sym))
142
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::UserDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
143
+ end
144
+ h[k.to_sym] = v
145
+ }
146
+
147
+ if attributes.key?(:'id')
148
+ self.id = attributes[:'id']
149
+ end
150
+
151
+ if attributes.key?(:'api_key')
152
+ self.api_key = attributes[:'api_key']
153
+ end
154
+
155
+ if attributes.key?(:'email_address')
156
+ self.email_address = attributes[:'email_address']
157
+ end
158
+
159
+ if attributes.key?(:'email_address_md5')
160
+ self.email_address_md5 = attributes[:'email_address_md5']
161
+ end
162
+
163
+ if attributes.key?(:'created')
164
+ self.created = attributes[:'created']
165
+ end
166
+
167
+ if attributes.key?(:'user_type')
168
+ self.user_type = attributes[:'user_type']
169
+ end
170
+
171
+ if attributes.key?(:'organization')
172
+ self.organization = attributes[:'organization']
173
+ end
174
+
175
+ if attributes.key?(:'verified')
176
+ self.verified = attributes[:'verified']
177
+ end
178
+
179
+ if attributes.key?(:'has_password')
180
+ self.has_password = attributes[:'has_password']
181
+ end
182
+
183
+ if attributes.key?(:'is_frozen')
184
+ self.is_frozen = attributes[:'is_frozen']
185
+ end
186
+
187
+ if attributes.key?(:'add_new_contacts')
188
+ self.add_new_contacts = attributes[:'add_new_contacts']
189
+ end
190
+
191
+ if attributes.key?(:'sso_provider')
192
+ self.sso_provider = attributes[:'sso_provider']
193
+ end
194
+
195
+ if attributes.key?(:'customer_id')
196
+ self.customer_id = attributes[:'customer_id']
197
+ end
198
+
199
+ if attributes.key?(:'has_onboarded')
200
+ self.has_onboarded = attributes[:'has_onboarded']
201
+ end
202
+
203
+ if attributes.key?(:'imap_username')
204
+ self.imap_username = attributes[:'imap_username']
205
+ end
206
+
207
+ if attributes.key?(:'imap_password')
208
+ self.imap_password = attributes[:'imap_password']
209
+ end
210
+
211
+ if attributes.key?(:'smtp_username')
212
+ self.smtp_username = attributes[:'smtp_username']
213
+ end
214
+
215
+ if attributes.key?(:'smtp_password')
216
+ self.smtp_password = attributes[:'smtp_password']
217
+ end
218
+ end
219
+
220
+ # Show invalid properties with the reasons. Usually used together with valid?
221
+ # @return Array for valid properties with the reasons
222
+ def list_invalid_properties
223
+ invalid_properties = Array.new
224
+ if @id.nil?
225
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
226
+ end
227
+
228
+ if @api_key.nil?
229
+ invalid_properties.push('invalid value for "api_key", api_key cannot be nil.')
230
+ end
231
+
232
+ if @email_address.nil?
233
+ invalid_properties.push('invalid value for "email_address", email_address cannot be nil.')
234
+ end
235
+
236
+ if @email_address_md5.nil?
237
+ invalid_properties.push('invalid value for "email_address_md5", email_address_md5 cannot be nil.')
238
+ end
239
+
240
+ if @has_password.nil?
241
+ invalid_properties.push('invalid value for "has_password", has_password cannot be nil.')
242
+ end
243
+
244
+ if @is_frozen.nil?
245
+ invalid_properties.push('invalid value for "is_frozen", is_frozen cannot be nil.')
246
+ end
247
+
248
+ invalid_properties
249
+ end
250
+
251
+ # Check to see if the all the properties in the model are valid
252
+ # @return true if the model is valid
253
+ def valid?
254
+ return false if @id.nil?
255
+ return false if @api_key.nil?
256
+ return false if @email_address.nil?
257
+ return false if @email_address_md5.nil?
258
+ user_type_validator = EnumAttributeValidator.new('String', ["SOLO", "CHILD_SOLO", "CHILD_TEAM"])
259
+ return false unless user_type_validator.valid?(@user_type)
260
+ verified_validator = EnumAttributeValidator.new('String', ["VERIFIED", "PENDING"])
261
+ return false unless verified_validator.valid?(@verified)
262
+ return false if @has_password.nil?
263
+ return false if @is_frozen.nil?
264
+ true
265
+ end
266
+
267
+ # Custom attribute writer method checking allowed values (enum).
268
+ # @param [Object] user_type Object to be assigned
269
+ def user_type=(user_type)
270
+ validator = EnumAttributeValidator.new('String', ["SOLO", "CHILD_SOLO", "CHILD_TEAM"])
271
+ unless validator.valid?(user_type)
272
+ fail ArgumentError, "invalid value for \"user_type\", must be one of #{validator.allowable_values}."
273
+ end
274
+ @user_type = user_type
275
+ end
276
+
277
+ # Custom attribute writer method checking allowed values (enum).
278
+ # @param [Object] verified Object to be assigned
279
+ def verified=(verified)
280
+ validator = EnumAttributeValidator.new('String', ["VERIFIED", "PENDING"])
281
+ unless validator.valid?(verified)
282
+ fail ArgumentError, "invalid value for \"verified\", must be one of #{validator.allowable_values}."
283
+ end
284
+ @verified = verified
285
+ end
286
+
287
+ # Checks equality by comparing each attribute.
288
+ # @param [Object] Object to be compared
289
+ def ==(o)
290
+ return true if self.equal?(o)
291
+ self.class == o.class &&
292
+ id == o.id &&
293
+ api_key == o.api_key &&
294
+ email_address == o.email_address &&
295
+ email_address_md5 == o.email_address_md5 &&
296
+ created == o.created &&
297
+ user_type == o.user_type &&
298
+ organization == o.organization &&
299
+ verified == o.verified &&
300
+ has_password == o.has_password &&
301
+ is_frozen == o.is_frozen &&
302
+ add_new_contacts == o.add_new_contacts &&
303
+ sso_provider == o.sso_provider &&
304
+ customer_id == o.customer_id &&
305
+ has_onboarded == o.has_onboarded &&
306
+ imap_username == o.imap_username &&
307
+ imap_password == o.imap_password &&
308
+ smtp_username == o.smtp_username &&
309
+ smtp_password == o.smtp_password
310
+ end
311
+
312
+ # @see the `==` method
313
+ # @param [Object] Object to be compared
314
+ def eql?(o)
315
+ self == o
316
+ end
317
+
318
+ # Calculates hash code according to all attributes.
319
+ # @return [Integer] Hash code
320
+ def hash
321
+ [id, api_key, email_address, email_address_md5, created, user_type, organization, verified, has_password, is_frozen, add_new_contacts, sso_provider, customer_id, has_onboarded, imap_username, imap_password, smtp_username, smtp_password].hash
322
+ end
323
+
324
+ # Builds the object from hash
325
+ # @param [Hash] attributes Model attributes in the form of hash
326
+ # @return [Object] Returns the model itself
327
+ def self.build_from_hash(attributes)
328
+ new.build_from_hash(attributes)
329
+ end
330
+
331
+ # Builds the object from hash
332
+ # @param [Hash] attributes Model attributes in the form of hash
333
+ # @return [Object] Returns the model itself
334
+ def build_from_hash(attributes)
335
+ return nil unless attributes.is_a?(Hash)
336
+ self.class.openapi_types.each_pair do |key, type|
337
+ if type =~ /\AArray<(.*)>/i
338
+ # check to ensure the input is an array given that the attribute
339
+ # is documented as an array but the input is not
340
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
341
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
342
+ end
343
+ elsif !attributes[self.class.attribute_map[key]].nil?
344
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
345
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
346
+ end
347
+
348
+ self
349
+ end
350
+
351
+ # Deserializes the data based on type
352
+ # @param string type Data type
353
+ # @param string value Value to be deserialized
354
+ # @return [Object] Deserialized data
355
+ def _deserialize(type, value)
356
+ case type.to_sym
357
+ when :DateTime
358
+ DateTime.parse(value)
359
+ when :Date
360
+ Date.parse(value)
361
+ when :String
362
+ value.to_s
363
+ when :Integer
364
+ value.to_i
365
+ when :Float
366
+ value.to_f
367
+ when :Boolean
368
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
369
+ true
370
+ else
371
+ false
372
+ end
373
+ when :Object
374
+ # generic object (usually a Hash), return directly
375
+ value
376
+ when /\AArray<(?<inner_type>.+)>\z/
377
+ inner_type = Regexp.last_match[:inner_type]
378
+ value.map { |v| _deserialize(inner_type, v) }
379
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
380
+ k_type = Regexp.last_match[:k_type]
381
+ v_type = Regexp.last_match[:v_type]
382
+ {}.tap do |hash|
383
+ value.each do |k, v|
384
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
385
+ end
386
+ end
387
+ else # model
388
+ MailSlurpClient.const_get(type).build_from_hash(value)
389
+ end
390
+ end
391
+
392
+ # Returns the string representation of the object
393
+ # @return [String] String presentation of the object
394
+ def to_s
395
+ to_hash.to_s
396
+ end
397
+
398
+ # to_body is an alias to to_hash (backward compatibility)
399
+ # @return [Hash] Returns the object in the form of hash
400
+ def to_body
401
+ to_hash
402
+ end
403
+
404
+ # Returns the object in the form of hash
405
+ # @return [Hash] Returns the object in the form of hash
406
+ def to_hash
407
+ hash = {}
408
+ self.class.attribute_map.each_pair do |attr, param|
409
+ value = self.send(attr)
410
+ if value.nil?
411
+ is_nullable = self.class.openapi_nullable.include?(attr)
412
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
413
+ end
414
+
415
+ hash[param] = _to_hash(value)
416
+ end
417
+ hash
418
+ end
419
+
420
+ # Outputs non-array value in the form of hash
421
+ # For object, use to_hash. Otherwise, just return the value
422
+ # @param [Object] value Any valid value
423
+ # @return [Hash] Returns the value in the form of hash
424
+ def _to_hash(value)
425
+ if value.is_a?(Array)
426
+ value.compact.map { |v| _to_hash(v) }
427
+ elsif value.is_a?(Hash)
428
+ {}.tap do |hash|
429
+ value.each { |k, v| hash[k] = _to_hash(v) }
430
+ end
431
+ elsif value.respond_to? :to_hash
432
+ value.to_hash
433
+ else
434
+ value
435
+ end
436
+ end
437
+ end
438
+ end