mailslurp_client 16.1.3 → 16.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/ai_controller_api.rb +813 -6
  3. data/lib/mailslurp_client/models/ai_tranform_create_options.rb +237 -0
  4. data/lib/mailslurp_client/models/ai_transform_dto.rb +251 -0
  5. data/lib/mailslurp_client/models/ai_transform_mapping_dto.rb +310 -0
  6. data/lib/mailslurp_client/models/ai_transform_mapping_projection.rb +352 -0
  7. data/lib/mailslurp_client/models/ai_transform_projection.rb +251 -0
  8. data/lib/mailslurp_client/models/ai_transform_result_dto.rb +353 -0
  9. data/lib/mailslurp_client/models/ai_transform_result_projection.rb +324 -0
  10. data/lib/mailslurp_client/models/alias_projection.rb +15 -15
  11. data/lib/mailslurp_client/models/alias_thread_projection.rb +16 -16
  12. data/lib/mailslurp_client/models/attachment_projection.rb +10 -10
  13. data/lib/mailslurp_client/models/connector_projection.rb +15 -15
  14. data/lib/mailslurp_client/models/create_ai_transformer_mapping_options.rb +338 -0
  15. data/lib/mailslurp_client/models/create_webhook_options.rb +12 -1
  16. data/lib/mailslurp_client/models/email_projection.rb +10 -10
  17. data/lib/mailslurp_client/models/email_thread_projection.rb +36 -36
  18. data/lib/mailslurp_client/models/generate_structured_content_attachment_options.rb +27 -9
  19. data/lib/mailslurp_client/models/generate_structured_content_email_options.rb +19 -11
  20. data/lib/mailslurp_client/models/generate_structured_content_sms_options.rb +244 -0
  21. data/lib/mailslurp_client/models/guest_portal_user_projection.rb +10 -10
  22. data/lib/mailslurp_client/models/inbox_forwarder_event_projection.rb +11 -11
  23. data/lib/mailslurp_client/models/inbox_replier_event_projection.rb +11 -11
  24. data/lib/mailslurp_client/models/page_ai_transform_mapping_projection.rb +309 -0
  25. data/lib/mailslurp_client/models/page_ai_transform_projection.rb +309 -0
  26. data/lib/mailslurp_client/models/page_ai_transform_result_projection.rb +309 -0
  27. data/lib/mailslurp_client/models/page_alias.rb +15 -15
  28. data/lib/mailslurp_client/models/page_alias_thread_projection.rb +15 -15
  29. data/lib/mailslurp_client/models/page_attachment_entity.rb +15 -15
  30. data/lib/mailslurp_client/models/page_bounced_email.rb +15 -15
  31. data/lib/mailslurp_client/models/page_bounced_recipients.rb +15 -15
  32. data/lib/mailslurp_client/models/page_complaint.rb +15 -15
  33. data/lib/mailslurp_client/models/page_connector.rb +15 -15
  34. data/lib/mailslurp_client/models/page_connector_events.rb +15 -15
  35. data/lib/mailslurp_client/models/page_contact_projection.rb +15 -15
  36. data/lib/mailslurp_client/models/page_delivery_status.rb +15 -15
  37. data/lib/mailslurp_client/models/page_email_preview.rb +15 -15
  38. data/lib/mailslurp_client/models/page_email_projection.rb +15 -15
  39. data/lib/mailslurp_client/models/page_email_thread_projection.rb +15 -15
  40. data/lib/mailslurp_client/models/page_email_validation_request.rb +15 -15
  41. data/lib/mailslurp_client/models/page_entity_automation_items.rb +15 -15
  42. data/lib/mailslurp_client/models/page_entity_event_items.rb +15 -15
  43. data/lib/mailslurp_client/models/page_entity_favourite_items.rb +15 -15
  44. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +15 -15
  45. data/lib/mailslurp_client/models/page_group_projection.rb +15 -15
  46. data/lib/mailslurp_client/models/page_guest_portal_users.rb +15 -15
  47. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +15 -15
  48. data/lib/mailslurp_client/models/page_inbox_forwarder_events.rb +15 -15
  49. data/lib/mailslurp_client/models/page_inbox_projection.rb +15 -15
  50. data/lib/mailslurp_client/models/page_inbox_replier_dto.rb +15 -15
  51. data/lib/mailslurp_client/models/page_inbox_replier_events.rb +15 -15
  52. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +15 -15
  53. data/lib/mailslurp_client/models/page_inbox_tags.rb +15 -15
  54. data/lib/mailslurp_client/models/page_list_unsubscribe_recipients.rb +15 -15
  55. data/lib/mailslurp_client/models/page_missed_email_projection.rb +15 -15
  56. data/lib/mailslurp_client/models/page_opt_in_identity_projection.rb +15 -15
  57. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +15 -15
  58. data/lib/mailslurp_client/models/page_phone_message_thread_item_projection.rb +15 -15
  59. data/lib/mailslurp_client/models/page_phone_message_thread_projection.rb +15 -15
  60. data/lib/mailslurp_client/models/page_phone_number_projection.rb +15 -15
  61. data/lib/mailslurp_client/models/page_plus_address_projection.rb +15 -15
  62. data/lib/mailslurp_client/models/page_reputation_items.rb +15 -15
  63. data/lib/mailslurp_client/models/page_scheduled_jobs.rb +15 -15
  64. data/lib/mailslurp_client/models/page_sent_email_projection.rb +15 -15
  65. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +15 -15
  66. data/lib/mailslurp_client/models/page_sent_sms_projection.rb +15 -15
  67. data/lib/mailslurp_client/models/page_sms_projection.rb +15 -15
  68. data/lib/mailslurp_client/models/page_template_projection.rb +15 -15
  69. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +15 -15
  70. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +15 -15
  71. data/lib/mailslurp_client/models/page_webhook_endpoint_projection.rb +15 -15
  72. data/lib/mailslurp_client/models/page_webhook_projection.rb +15 -15
  73. data/lib/mailslurp_client/models/page_webhook_result.rb +15 -15
  74. data/lib/mailslurp_client/models/plus_address_projection.rb +15 -15
  75. data/lib/mailslurp_client/models/sent_email_projection.rb +15 -15
  76. data/lib/mailslurp_client/models/sort_object.rb +10 -10
  77. data/lib/mailslurp_client/models/{structured_content_result.rb → structured_content_result_dto.rb} +3 -3
  78. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -10
  79. data/lib/mailslurp_client/models/webhook_dto.rb +12 -1
  80. data/lib/mailslurp_client/models/webhook_projection.rb +19 -10
  81. data/lib/mailslurp_client/version.rb +1 -1
  82. data/lib/mailslurp_client.rb +13 -1
  83. metadata +15 -3
@@ -0,0 +1,237 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. 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 AITranformCreateOptions
17
+ attr_accessor :name
18
+
19
+ attr_accessor :conditions
20
+
21
+ attr_accessor :instructions
22
+
23
+ attr_accessor :output_schema
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'name' => :'name',
29
+ :'conditions' => :'conditions',
30
+ :'instructions' => :'instructions',
31
+ :'output_schema' => :'outputSchema'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'name' => :'String',
39
+ :'conditions' => :'Array<String>',
40
+ :'instructions' => :'Array<String>',
41
+ :'output_schema' => :'StructuredOutputSchema'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::AITranformCreateOptions` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::AITranformCreateOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'name')
67
+ self.name = attributes[:'name']
68
+ end
69
+
70
+ if attributes.key?(:'conditions')
71
+ if (value = attributes[:'conditions']).is_a?(Array)
72
+ self.conditions = value
73
+ end
74
+ end
75
+
76
+ if attributes.key?(:'instructions')
77
+ if (value = attributes[:'instructions']).is_a?(Array)
78
+ self.instructions = value
79
+ end
80
+ end
81
+
82
+ if attributes.key?(:'output_schema')
83
+ self.output_schema = attributes[:'output_schema']
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = Array.new
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ true
98
+ end
99
+
100
+ # Checks equality by comparing each attribute.
101
+ # @param [Object] Object to be compared
102
+ def ==(o)
103
+ return true if self.equal?(o)
104
+ self.class == o.class &&
105
+ name == o.name &&
106
+ conditions == o.conditions &&
107
+ instructions == o.instructions &&
108
+ output_schema == o.output_schema
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [name, conditions, instructions, output_schema].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ new.build_from_hash(attributes)
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ self.class.openapi_types.each_pair do |key, type|
136
+ if type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
140
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ end
142
+ elsif !attributes[self.class.attribute_map[key]].nil?
143
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
145
+ end
146
+
147
+ self
148
+ end
149
+
150
+ # Deserializes the data based on type
151
+ # @param string type Data type
152
+ # @param string value Value to be deserialized
153
+ # @return [Object] Deserialized data
154
+ def _deserialize(type, value)
155
+ case type.to_sym
156
+ when :DateTime
157
+ DateTime.parse(value)
158
+ when :Date
159
+ Date.parse(value)
160
+ when :String
161
+ value.to_s
162
+ when :Integer
163
+ value.to_i
164
+ when :Float
165
+ value.to_f
166
+ when :Boolean
167
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
168
+ true
169
+ else
170
+ false
171
+ end
172
+ when :Object
173
+ # generic object (usually a Hash), return directly
174
+ value
175
+ when /\AArray<(?<inner_type>.+)>\z/
176
+ inner_type = Regexp.last_match[:inner_type]
177
+ value.map { |v| _deserialize(inner_type, v) }
178
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
179
+ k_type = Regexp.last_match[:k_type]
180
+ v_type = Regexp.last_match[:v_type]
181
+ {}.tap do |hash|
182
+ value.each do |k, v|
183
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
184
+ end
185
+ end
186
+ else # model
187
+ MailSlurpClient.const_get(type).build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+ end
237
+ end
@@ -0,0 +1,251 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. 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 AITransformDto
17
+ attr_accessor :id
18
+
19
+ attr_accessor :name
20
+
21
+ attr_accessor :conditions
22
+
23
+ attr_accessor :instructions
24
+
25
+ attr_accessor :output_schema
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'id' => :'id',
31
+ :'name' => :'name',
32
+ :'conditions' => :'conditions',
33
+ :'instructions' => :'instructions',
34
+ :'output_schema' => :'outputSchema'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'id' => :'String',
42
+ :'name' => :'String',
43
+ :'conditions' => :'Array<String>',
44
+ :'instructions' => :'Array<String>',
45
+ :'output_schema' => :'StructuredOutputSchema'
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::AITransformDto` 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::AITransformDto`. 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?(:'name')
75
+ self.name = attributes[:'name']
76
+ end
77
+
78
+ if attributes.key?(:'conditions')
79
+ if (value = attributes[:'conditions']).is_a?(Array)
80
+ self.conditions = value
81
+ end
82
+ end
83
+
84
+ if attributes.key?(:'instructions')
85
+ if (value = attributes[:'instructions']).is_a?(Array)
86
+ self.instructions = value
87
+ end
88
+ end
89
+
90
+ if attributes.key?(:'output_schema')
91
+ self.output_schema = attributes[:'output_schema']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ if @id.nil?
100
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
101
+ end
102
+
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ return false if @id.nil?
110
+ true
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ id == o.id &&
119
+ name == o.name &&
120
+ conditions == o.conditions &&
121
+ instructions == o.instructions &&
122
+ output_schema == o.output_schema
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [id, name, conditions, instructions, output_schema].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def self.build_from_hash(attributes)
141
+ new.build_from_hash(attributes)
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ self.class.openapi_types.each_pair do |key, type|
150
+ if type =~ /\AArray<(.*)>/i
151
+ # check to ensure the input is an array given that the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
154
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
155
+ end
156
+ elsif !attributes[self.class.attribute_map[key]].nil?
157
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
158
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
159
+ end
160
+
161
+ self
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def _deserialize(type, value)
169
+ case type.to_sym
170
+ when :DateTime
171
+ DateTime.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ MailSlurpClient.const_get(type).build_from_hash(value)
202
+ end
203
+ end
204
+
205
+ # Returns the string representation of the object
206
+ # @return [String] String presentation of the object
207
+ def to_s
208
+ to_hash.to_s
209
+ end
210
+
211
+ # to_body is an alias to to_hash (backward compatibility)
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_body
214
+ to_hash
215
+ end
216
+
217
+ # Returns the object in the form of hash
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_hash
220
+ hash = {}
221
+ self.class.attribute_map.each_pair do |attr, param|
222
+ value = self.send(attr)
223
+ if value.nil?
224
+ is_nullable = self.class.openapi_nullable.include?(attr)
225
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
226
+ end
227
+
228
+ hash[param] = _to_hash(value)
229
+ end
230
+ hash
231
+ end
232
+
233
+ # Outputs non-array value in the form of hash
234
+ # For object, use to_hash. Otherwise, just return the value
235
+ # @param [Object] value Any valid value
236
+ # @return [Hash] Returns the value in the form of hash
237
+ def _to_hash(value)
238
+ if value.is_a?(Array)
239
+ value.compact.map { |v| _to_hash(v) }
240
+ elsif value.is_a?(Hash)
241
+ {}.tap do |hash|
242
+ value.each { |k, v| hash[k] = _to_hash(v) }
243
+ end
244
+ elsif value.respond_to? :to_hash
245
+ value.to_hash
246
+ else
247
+ value
248
+ end
249
+ end
250
+ end
251
+ end