ultracart_api 3.10.46 → 3.10.48

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,223 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ConversationMessagesResponse
17
+ attr_accessor :conversation_messages
18
+
19
+ attr_accessor :error
20
+
21
+ attr_accessor :metadata
22
+
23
+ # Indicates if API call was successful
24
+ attr_accessor :success
25
+
26
+ attr_accessor :warning
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'conversation_messages' => :'conversation_messages',
32
+ :'error' => :'error',
33
+ :'metadata' => :'metadata',
34
+ :'success' => :'success',
35
+ :'warning' => :'warning'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'conversation_messages' => :'Array<ConversationMessage>',
43
+ :'error' => :'Error',
44
+ :'metadata' => :'ResponseMetadata',
45
+ :'success' => :'BOOLEAN',
46
+ :'warning' => :'Warning'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'conversation_messages')
59
+ if (value = attributes[:'conversation_messages']).is_a?(Array)
60
+ self.conversation_messages = value
61
+ end
62
+ end
63
+
64
+ if attributes.has_key?(:'error')
65
+ self.error = attributes[:'error']
66
+ end
67
+
68
+ if attributes.has_key?(:'metadata')
69
+ self.metadata = attributes[:'metadata']
70
+ end
71
+
72
+ if attributes.has_key?(:'success')
73
+ self.success = attributes[:'success']
74
+ end
75
+
76
+ if attributes.has_key?(:'warning')
77
+ self.warning = attributes[:'warning']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ conversation_messages == o.conversation_messages &&
100
+ error == o.error &&
101
+ metadata == o.metadata &&
102
+ success == o.success &&
103
+ warning == o.warning
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [conversation_messages, error, metadata, success, warning].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.swagger_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BOOLEAN
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ temp_model = UltracartClient.const_get(type).new
176
+ temp_model.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+ end
@@ -14,40 +14,59 @@ require 'date'
14
14
 
15
15
  module UltracartClient
16
16
  class ItemDigitalItem
17
+ # Click wrap agreement is presented to the customer before they can purchase your product.
18
+ attr_accessor :click_wrap_agreement
19
+
17
20
  # File creation date
18
21
  attr_accessor :creation_dts
19
22
 
20
23
  # Description of the digital item
21
24
  attr_accessor :description
22
25
 
26
+ # The Digital item oid is a primary key used internally by UltraCart. You should not set or change this value. Doing so will have no effect.
27
+ attr_accessor :digital_item_oid
28
+
23
29
  # File size
24
30
  attr_accessor :file_size
25
31
 
32
+ # This url is sourced to create or update a digital file in your digital library. It is only considered during an insert or update operation.
33
+ attr_accessor :import_from_url
34
+
26
35
  # Mime type associated with the file
27
36
  attr_accessor :mime_type
28
37
 
29
38
  # Original filename
30
39
  attr_accessor :original_filename
31
40
 
41
+ attr_accessor :pdf_meta
42
+
32
43
  # Attribute mapping from ruby-style variable name to JSON key.
33
44
  def self.attribute_map
34
45
  {
46
+ :'click_wrap_agreement' => :'click_wrap_agreement',
35
47
  :'creation_dts' => :'creation_dts',
36
48
  :'description' => :'description',
49
+ :'digital_item_oid' => :'digital_item_oid',
37
50
  :'file_size' => :'file_size',
51
+ :'import_from_url' => :'import_from_url',
38
52
  :'mime_type' => :'mime_type',
39
- :'original_filename' => :'original_filename'
53
+ :'original_filename' => :'original_filename',
54
+ :'pdf_meta' => :'pdf_meta'
40
55
  }
41
56
  end
42
57
 
43
58
  # Attribute type mapping.
44
59
  def self.swagger_types
45
60
  {
61
+ :'click_wrap_agreement' => :'String',
46
62
  :'creation_dts' => :'String',
47
63
  :'description' => :'String',
64
+ :'digital_item_oid' => :'Integer',
48
65
  :'file_size' => :'Integer',
66
+ :'import_from_url' => :'String',
49
67
  :'mime_type' => :'String',
50
- :'original_filename' => :'String'
68
+ :'original_filename' => :'String',
69
+ :'pdf_meta' => :'ItemDigitalItemPdfMeta'
51
70
  }
52
71
  end
53
72
 
@@ -59,6 +78,10 @@ module UltracartClient
59
78
  # convert string to symbol for hash key
60
79
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
61
80
 
81
+ if attributes.has_key?(:'click_wrap_agreement')
82
+ self.click_wrap_agreement = attributes[:'click_wrap_agreement']
83
+ end
84
+
62
85
  if attributes.has_key?(:'creation_dts')
63
86
  self.creation_dts = attributes[:'creation_dts']
64
87
  end
@@ -67,10 +90,18 @@ module UltracartClient
67
90
  self.description = attributes[:'description']
68
91
  end
69
92
 
93
+ if attributes.has_key?(:'digital_item_oid')
94
+ self.digital_item_oid = attributes[:'digital_item_oid']
95
+ end
96
+
70
97
  if attributes.has_key?(:'file_size')
71
98
  self.file_size = attributes[:'file_size']
72
99
  end
73
100
 
101
+ if attributes.has_key?(:'import_from_url')
102
+ self.import_from_url = attributes[:'import_from_url']
103
+ end
104
+
74
105
  if attributes.has_key?(:'mime_type')
75
106
  self.mime_type = attributes[:'mime_type']
76
107
  end
@@ -78,6 +109,10 @@ module UltracartClient
78
109
  if attributes.has_key?(:'original_filename')
79
110
  self.original_filename = attributes[:'original_filename']
80
111
  end
112
+
113
+ if attributes.has_key?(:'pdf_meta')
114
+ self.pdf_meta = attributes[:'pdf_meta']
115
+ end
81
116
  end
82
117
 
83
118
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -143,11 +178,15 @@ module UltracartClient
143
178
  def ==(o)
144
179
  return true if self.equal?(o)
145
180
  self.class == o.class &&
181
+ click_wrap_agreement == o.click_wrap_agreement &&
146
182
  creation_dts == o.creation_dts &&
147
183
  description == o.description &&
184
+ digital_item_oid == o.digital_item_oid &&
148
185
  file_size == o.file_size &&
186
+ import_from_url == o.import_from_url &&
149
187
  mime_type == o.mime_type &&
150
- original_filename == o.original_filename
188
+ original_filename == o.original_filename &&
189
+ pdf_meta == o.pdf_meta
151
190
  end
152
191
 
153
192
  # @see the `==` method
@@ -159,7 +198,7 @@ module UltracartClient
159
198
  # Calculates hash code according to all attributes.
160
199
  # @return [Fixnum] Hash code
161
200
  def hash
162
- [creation_dts, description, file_size, mime_type, original_filename].hash
201
+ [click_wrap_agreement, creation_dts, description, digital_item_oid, file_size, import_from_url, mime_type, original_filename, pdf_meta].hash
163
202
  end
164
203
 
165
204
  # Builds the object from hash
@@ -0,0 +1,315 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ItemDigitalItemPdfMeta
17
+ # Assembly allowed
18
+ attr_accessor :assembly_allowed
19
+
20
+ # Copy/Paste is allowed
21
+ attr_accessor :copy_allowed
22
+
23
+ # A custom footer for each pdf page
24
+ attr_accessor :custom_footer
25
+
26
+ # A custom header for each pdf page
27
+ attr_accessor :custom_header
28
+
29
+ # Degraded printing allowed
30
+ attr_accessor :degraded_printing_allowed
31
+
32
+ # Fillin is allowed
33
+ attr_accessor :fillin_allowed
34
+
35
+ # Modifying annotations is allowed
36
+ attr_accessor :modify_annotations_allowed
37
+
38
+ # Modifying contents is allowed
39
+ attr_accessor :modify_contents_allowed
40
+
41
+ # Printing is allowed
42
+ attr_accessor :printing_allowed
43
+
44
+ # Screen readers are allowed
45
+ attr_accessor :screen_readers_allowed
46
+
47
+ # PDF is tagged
48
+ attr_accessor :tagged
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'assembly_allowed' => :'assembly_allowed',
54
+ :'copy_allowed' => :'copy_allowed',
55
+ :'custom_footer' => :'custom_footer',
56
+ :'custom_header' => :'custom_header',
57
+ :'degraded_printing_allowed' => :'degraded_printing_allowed',
58
+ :'fillin_allowed' => :'fillin_allowed',
59
+ :'modify_annotations_allowed' => :'modify_annotations_allowed',
60
+ :'modify_contents_allowed' => :'modify_contents_allowed',
61
+ :'printing_allowed' => :'printing_allowed',
62
+ :'screen_readers_allowed' => :'screen_readers_allowed',
63
+ :'tagged' => :'tagged'
64
+ }
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.swagger_types
69
+ {
70
+ :'assembly_allowed' => :'BOOLEAN',
71
+ :'copy_allowed' => :'BOOLEAN',
72
+ :'custom_footer' => :'String',
73
+ :'custom_header' => :'String',
74
+ :'degraded_printing_allowed' => :'BOOLEAN',
75
+ :'fillin_allowed' => :'BOOLEAN',
76
+ :'modify_annotations_allowed' => :'BOOLEAN',
77
+ :'modify_contents_allowed' => :'BOOLEAN',
78
+ :'printing_allowed' => :'BOOLEAN',
79
+ :'screen_readers_allowed' => :'BOOLEAN',
80
+ :'tagged' => :'BOOLEAN'
81
+ }
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ return unless attributes.is_a?(Hash)
88
+
89
+ # convert string to symbol for hash key
90
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
91
+
92
+ if attributes.has_key?(:'assembly_allowed')
93
+ self.assembly_allowed = attributes[:'assembly_allowed']
94
+ end
95
+
96
+ if attributes.has_key?(:'copy_allowed')
97
+ self.copy_allowed = attributes[:'copy_allowed']
98
+ end
99
+
100
+ if attributes.has_key?(:'custom_footer')
101
+ self.custom_footer = attributes[:'custom_footer']
102
+ end
103
+
104
+ if attributes.has_key?(:'custom_header')
105
+ self.custom_header = attributes[:'custom_header']
106
+ end
107
+
108
+ if attributes.has_key?(:'degraded_printing_allowed')
109
+ self.degraded_printing_allowed = attributes[:'degraded_printing_allowed']
110
+ end
111
+
112
+ if attributes.has_key?(:'fillin_allowed')
113
+ self.fillin_allowed = attributes[:'fillin_allowed']
114
+ end
115
+
116
+ if attributes.has_key?(:'modify_annotations_allowed')
117
+ self.modify_annotations_allowed = attributes[:'modify_annotations_allowed']
118
+ end
119
+
120
+ if attributes.has_key?(:'modify_contents_allowed')
121
+ self.modify_contents_allowed = attributes[:'modify_contents_allowed']
122
+ end
123
+
124
+ if attributes.has_key?(:'printing_allowed')
125
+ self.printing_allowed = attributes[:'printing_allowed']
126
+ end
127
+
128
+ if attributes.has_key?(:'screen_readers_allowed')
129
+ self.screen_readers_allowed = attributes[:'screen_readers_allowed']
130
+ end
131
+
132
+ if attributes.has_key?(:'tagged')
133
+ self.tagged = attributes[:'tagged']
134
+ end
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properties with the reasons
139
+ def list_invalid_properties
140
+ invalid_properties = Array.new
141
+ if !@custom_footer.nil? && @custom_footer.to_s.length > 8000
142
+ invalid_properties.push('invalid value for "custom_footer", the character length must be smaller than or equal to 8000.')
143
+ end
144
+
145
+ if !@custom_header.nil? && @custom_header.to_s.length > 8000
146
+ invalid_properties.push('invalid value for "custom_header", the character length must be smaller than or equal to 8000.')
147
+ end
148
+
149
+ invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ return false if !@custom_footer.nil? && @custom_footer.to_s.length > 8000
156
+ return false if !@custom_header.nil? && @custom_header.to_s.length > 8000
157
+ true
158
+ end
159
+
160
+ # Custom attribute writer method with validation
161
+ # @param [Object] custom_footer Value to be assigned
162
+ def custom_footer=(custom_footer)
163
+ if !custom_footer.nil? && custom_footer.to_s.length > 8000
164
+ fail ArgumentError, 'invalid value for "custom_footer", the character length must be smaller than or equal to 8000.'
165
+ end
166
+
167
+ @custom_footer = custom_footer
168
+ end
169
+
170
+ # Custom attribute writer method with validation
171
+ # @param [Object] custom_header Value to be assigned
172
+ def custom_header=(custom_header)
173
+ if !custom_header.nil? && custom_header.to_s.length > 8000
174
+ fail ArgumentError, 'invalid value for "custom_header", the character length must be smaller than or equal to 8000.'
175
+ end
176
+
177
+ @custom_header = custom_header
178
+ end
179
+
180
+ # Checks equality by comparing each attribute.
181
+ # @param [Object] Object to be compared
182
+ def ==(o)
183
+ return true if self.equal?(o)
184
+ self.class == o.class &&
185
+ assembly_allowed == o.assembly_allowed &&
186
+ copy_allowed == o.copy_allowed &&
187
+ custom_footer == o.custom_footer &&
188
+ custom_header == o.custom_header &&
189
+ degraded_printing_allowed == o.degraded_printing_allowed &&
190
+ fillin_allowed == o.fillin_allowed &&
191
+ modify_annotations_allowed == o.modify_annotations_allowed &&
192
+ modify_contents_allowed == o.modify_contents_allowed &&
193
+ printing_allowed == o.printing_allowed &&
194
+ screen_readers_allowed == o.screen_readers_allowed &&
195
+ tagged == o.tagged
196
+ end
197
+
198
+ # @see the `==` method
199
+ # @param [Object] Object to be compared
200
+ def eql?(o)
201
+ self == o
202
+ end
203
+
204
+ # Calculates hash code according to all attributes.
205
+ # @return [Fixnum] Hash code
206
+ def hash
207
+ [assembly_allowed, copy_allowed, custom_footer, custom_header, degraded_printing_allowed, fillin_allowed, modify_annotations_allowed, modify_contents_allowed, printing_allowed, screen_readers_allowed, tagged].hash
208
+ end
209
+
210
+ # Builds the object from hash
211
+ # @param [Hash] attributes Model attributes in the form of hash
212
+ # @return [Object] Returns the model itself
213
+ def build_from_hash(attributes)
214
+ return nil unless attributes.is_a?(Hash)
215
+ self.class.swagger_types.each_pair do |key, type|
216
+ if type =~ /\AArray<(.*)>/i
217
+ # check to ensure the input is an array given that the attribute
218
+ # is documented as an array but the input is not
219
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
220
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
221
+ end
222
+ elsif !attributes[self.class.attribute_map[key]].nil?
223
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
224
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
225
+ end
226
+
227
+ self
228
+ end
229
+
230
+ # Deserializes the data based on type
231
+ # @param string type Data type
232
+ # @param string value Value to be deserialized
233
+ # @return [Object] Deserialized data
234
+ def _deserialize(type, value)
235
+ case type.to_sym
236
+ when :DateTime
237
+ DateTime.parse(value)
238
+ when :Date
239
+ Date.parse(value)
240
+ when :String
241
+ value.to_s
242
+ when :Integer
243
+ value.to_i
244
+ when :Float
245
+ value.to_f
246
+ when :BOOLEAN
247
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
248
+ true
249
+ else
250
+ false
251
+ end
252
+ when :Object
253
+ # generic object (usually a Hash), return directly
254
+ value
255
+ when /\AArray<(?<inner_type>.+)>\z/
256
+ inner_type = Regexp.last_match[:inner_type]
257
+ value.map { |v| _deserialize(inner_type, v) }
258
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
259
+ k_type = Regexp.last_match[:k_type]
260
+ v_type = Regexp.last_match[:v_type]
261
+ {}.tap do |hash|
262
+ value.each do |k, v|
263
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
264
+ end
265
+ end
266
+ else # model
267
+ temp_model = UltracartClient.const_get(type).new
268
+ temp_model.build_from_hash(value)
269
+ end
270
+ end
271
+
272
+ # Returns the string representation of the object
273
+ # @return [String] String presentation of the object
274
+ def to_s
275
+ to_hash.to_s
276
+ end
277
+
278
+ # to_body is an alias to to_hash (backward compatibility)
279
+ # @return [Hash] Returns the object in the form of hash
280
+ def to_body
281
+ to_hash
282
+ end
283
+
284
+ # Returns the object in the form of hash
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_hash
287
+ hash = {}
288
+ self.class.attribute_map.each_pair do |attr, param|
289
+ value = self.send(attr)
290
+ next if value.nil?
291
+ hash[param] = _to_hash(value)
292
+ end
293
+ hash
294
+ end
295
+
296
+ # Outputs non-array value in the form of hash
297
+ # For object, use to_hash. Otherwise, just return the value
298
+ # @param [Object] value Any valid value
299
+ # @return [Hash] Returns the value in the form of hash
300
+ def _to_hash(value)
301
+ if value.is_a?(Array)
302
+ value.compact.map { |v| _to_hash(v) }
303
+ elsif value.is_a?(Hash)
304
+ {}.tap do |hash|
305
+ value.each { |k, v| hash[k] = _to_hash(v) }
306
+ end
307
+ elsif value.respond_to? :to_hash
308
+ value.to_hash
309
+ else
310
+ value
311
+ end
312
+ end
313
+
314
+ end
315
+ end