dropbox-sign 1.1.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +9 -4
  4. data/VERSION +1 -1
  5. data/docs/OAuthApi.md +0 -16
  6. data/docs/SignatureRequestApi.md +5 -4
  7. data/docs/SignatureRequestSendRequest.md +1 -0
  8. data/docs/SignatureRequestSendWithTemplateRequest.md +1 -0
  9. data/docs/SignatureRequestUpdateRequest.md +1 -1
  10. data/docs/SubFormFieldsPerDocumentBase.md +1 -1
  11. data/docs/SubFormFieldsPerDocumentDateSigned.md +2 -0
  12. data/docs/SubFormFieldsPerDocumentDropdown.md +2 -0
  13. data/docs/SubFormFieldsPerDocumentFontEnum.md +9 -0
  14. data/docs/SubFormFieldsPerDocumentHyperlink.md +2 -0
  15. data/docs/SubFormFieldsPerDocumentText.md +3 -0
  16. data/docs/SubFormFieldsPerDocumentTextMerge.md +2 -0
  17. data/docs/SubWhiteLabelingOptions.md +1 -1
  18. data/docs/TemplateApi.md +106 -3
  19. data/docs/TemplateCreateRequest.md +27 -0
  20. data/docs/TemplateCreateResponse.md +11 -0
  21. data/docs/TemplateCreateResponseTemplate.md +10 -0
  22. data/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md +1 -0
  23. data/examples/OauthTokenGenerate.rb +0 -8
  24. data/examples/OauthTokenRefresh.rb +0 -8
  25. data/examples/TemplateCreate.rb +49 -0
  26. data/lib/dropbox-sign/api/signature_request_api.rb +5 -2
  27. data/lib/dropbox-sign/api/template_api.rb +112 -0
  28. data/lib/dropbox-sign/models/signature_request_send_request.rb +14 -1
  29. data/lib/dropbox-sign/models/signature_request_send_with_template_request.rb +14 -1
  30. data/lib/dropbox-sign/models/signature_request_update_request.rb +1 -1
  31. data/lib/dropbox-sign/models/sub_form_fields_per_document_base.rb +1 -1
  32. data/lib/dropbox-sign/models/sub_form_fields_per_document_date_signed.rb +60 -4
  33. data/lib/dropbox-sign/models/sub_form_fields_per_document_dropdown.rb +60 -4
  34. data/lib/dropbox-sign/models/sub_form_fields_per_document_font_enum.rb +54 -0
  35. data/lib/dropbox-sign/models/sub_form_fields_per_document_hyperlink.rb +60 -4
  36. data/lib/dropbox-sign/models/sub_form_fields_per_document_text.rb +49 -4
  37. data/lib/dropbox-sign/models/sub_form_fields_per_document_text_merge.rb +60 -4
  38. data/lib/dropbox-sign/models/sub_white_labeling_options.rb +1 -1
  39. data/lib/dropbox-sign/models/template_create_request.rb +509 -0
  40. data/lib/dropbox-sign/models/template_create_response.rb +263 -0
  41. data/lib/dropbox-sign/models/template_create_response_template.rb +252 -0
  42. data/lib/dropbox-sign/models/unclaimed_draft_create_embedded_with_template_request.rb +17 -4
  43. data/lib/dropbox-sign/version.rb +1 -1
  44. data/lib/dropbox-sign.rb +4 -0
  45. data/openapi-config.yaml +1 -1
  46. data/openapi-sdk.yaml +912 -434
  47. data/test_fixtures/SignatureRequestCreateEmbeddedRequest.json +6 -2
  48. data/test_fixtures/SignatureRequestSendRequest.json +8 -2
  49. data/test_fixtures/SignatureRequestSendWithTemplateRequest.json +1 -0
  50. data/test_fixtures/TemplateCreateEmbeddedDraftRequest.json +3 -1
  51. data/test_fixtures/TemplateCreateRequest.json +120 -0
  52. data/test_fixtures/TemplateCreateResponse.json +7 -0
  53. data/test_fixtures/UnclaimedDraftCreateEmbeddedRequest.json +3 -1
  54. data/test_fixtures/UnclaimedDraftCreateEmbeddedWithTemplateRequest.json +2 -1
  55. data/test_fixtures/UnclaimedDraftCreateRequest.json +3 -1
  56. metadata +20 -9
@@ -0,0 +1,509 @@
1
+ =begin
2
+ #Dropbox Sign API
3
+
4
+ #Dropbox Sign v3 API
5
+
6
+ The version of the OpenAPI document: 3.0.0
7
+ Contact: apisupport@hellosign.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Dropbox
17
+ end
18
+
19
+ module Dropbox::Sign
20
+ class TemplateCreateRequest
21
+ # The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE**: Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`
22
+ # @return [Array<SubFormFieldsPerDocumentBase>]
23
+ attr_accessor :form_fields_per_document
24
+
25
+ # An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.
26
+ # @return [Array<SubTemplateRole>]
27
+ attr_accessor :signer_roles
28
+
29
+ # Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.
30
+ # @return [Array<File>]
31
+ attr_accessor :files
32
+
33
+ # Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.
34
+ # @return [Array<String>]
35
+ attr_accessor :file_urls
36
+
37
+ # Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **Note**: Only available for Premium plan and higher.
38
+ # @return [Boolean]
39
+ attr_accessor :allow_reassign
40
+
41
+ # A list describing the attachments
42
+ # @return [Array<SubAttachment>]
43
+ attr_accessor :attachments
44
+
45
+ # The CC roles that must be assigned when using the template to send a signature request
46
+ # @return [Array<String>]
47
+ attr_accessor :cc_roles
48
+
49
+ # Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.
50
+ # @return [String]
51
+ attr_accessor :client_id
52
+
53
+ # @return [SubFieldOptions]
54
+ attr_accessor :field_options
55
+
56
+ # Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.
57
+ # @return [Array<SubFormFieldGroup>]
58
+ attr_accessor :form_field_groups
59
+
60
+ # Conditional Logic rules for fields defined in `form_fields_per_document`.
61
+ # @return [Array<SubFormFieldRule>]
62
+ attr_accessor :form_field_rules
63
+
64
+ # Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.
65
+ # @return [Array<SubMergeField>]
66
+ attr_accessor :merge_fields
67
+
68
+ # The default template email message.
69
+ # @return [String]
70
+ attr_accessor :message
71
+
72
+ # Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.
73
+ # @return [Hash<String, Object>]
74
+ attr_accessor :metadata
75
+
76
+ # The template title (alias).
77
+ # @return [String]
78
+ attr_accessor :subject
79
+
80
+ # Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.
81
+ # @return [Boolean]
82
+ attr_accessor :test_mode
83
+
84
+ # The title you want to assign to the SignatureRequest.
85
+ # @return [String]
86
+ attr_accessor :title
87
+
88
+ # Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).
89
+ # @return [Boolean]
90
+ attr_accessor :use_preexisting_fields
91
+
92
+ # Attribute mapping from ruby-style variable name to JSON key.
93
+ def self.attribute_map
94
+ {
95
+ :'form_fields_per_document' => :'form_fields_per_document',
96
+ :'signer_roles' => :'signer_roles',
97
+ :'files' => :'files',
98
+ :'file_urls' => :'file_urls',
99
+ :'allow_reassign' => :'allow_reassign',
100
+ :'attachments' => :'attachments',
101
+ :'cc_roles' => :'cc_roles',
102
+ :'client_id' => :'client_id',
103
+ :'field_options' => :'field_options',
104
+ :'form_field_groups' => :'form_field_groups',
105
+ :'form_field_rules' => :'form_field_rules',
106
+ :'merge_fields' => :'merge_fields',
107
+ :'message' => :'message',
108
+ :'metadata' => :'metadata',
109
+ :'subject' => :'subject',
110
+ :'test_mode' => :'test_mode',
111
+ :'title' => :'title',
112
+ :'use_preexisting_fields' => :'use_preexisting_fields'
113
+ }
114
+ end
115
+
116
+ # Returns all the JSON keys this model knows about
117
+ def self.acceptable_attributes
118
+ attribute_map.values
119
+ end
120
+
121
+ # Returns attribute map of this model + parent
122
+ def self.merged_attributes
123
+ self.attribute_map
124
+ end
125
+
126
+ # Attribute type mapping.
127
+ def self.openapi_types
128
+ {
129
+ :'form_fields_per_document' => :'Array<SubFormFieldsPerDocumentBase>',
130
+ :'signer_roles' => :'Array<SubTemplateRole>',
131
+ :'files' => :'Array<File>',
132
+ :'file_urls' => :'Array<String>',
133
+ :'allow_reassign' => :'Boolean',
134
+ :'attachments' => :'Array<SubAttachment>',
135
+ :'cc_roles' => :'Array<String>',
136
+ :'client_id' => :'String',
137
+ :'field_options' => :'SubFieldOptions',
138
+ :'form_field_groups' => :'Array<SubFormFieldGroup>',
139
+ :'form_field_rules' => :'Array<SubFormFieldRule>',
140
+ :'merge_fields' => :'Array<SubMergeField>',
141
+ :'message' => :'String',
142
+ :'metadata' => :'Hash<String, Object>',
143
+ :'subject' => :'String',
144
+ :'test_mode' => :'Boolean',
145
+ :'title' => :'String',
146
+ :'use_preexisting_fields' => :'Boolean'
147
+ }
148
+ end
149
+
150
+ # Attribute type mapping of this model + parent
151
+ def self.merged_types
152
+ self.openapi_types
153
+ end
154
+
155
+ # List of attributes with nullable: true
156
+ def self.openapi_nullable
157
+ Set.new([
158
+ ])
159
+ end
160
+
161
+ # Returns list of attributes with nullable: true of this model + parent
162
+ def self.merged_nullable
163
+ self.openapi_nullable
164
+ end
165
+
166
+ # Attempt to instantiate and hydrate a new instance of this class
167
+ # @param [Object] data Data to be converted
168
+ # @return [TemplateCreateRequest]
169
+ def self.init(data)
170
+ return ApiClient.default.convert_to_type(
171
+ data,
172
+ "TemplateCreateRequest"
173
+ ) || TemplateCreateRequest.new
174
+ end
175
+
176
+ # Initializes the object
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ def initialize(attributes = {})
179
+ if (!attributes.is_a?(Hash))
180
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::TemplateCreateRequest` initialize method"
181
+ end
182
+
183
+ # check to see if the attribute exists and convert string to symbol for hash key
184
+ attributes = attributes.each_with_object({}) { |(k, v), h|
185
+ if (!self.class.merged_attributes.key?(k.to_sym))
186
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::TemplateCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
187
+ end
188
+ h[k.to_sym] = v
189
+ }
190
+
191
+ if attributes.key?(:'form_fields_per_document')
192
+ if (value = attributes[:'form_fields_per_document']).is_a?(Array)
193
+ self.form_fields_per_document = value
194
+ end
195
+ end
196
+
197
+ if attributes.key?(:'signer_roles')
198
+ if (value = attributes[:'signer_roles']).is_a?(Array)
199
+ self.signer_roles = value
200
+ end
201
+ end
202
+
203
+ if attributes.key?(:'files')
204
+ if (value = attributes[:'files']).is_a?(Array)
205
+ self.files = value
206
+ end
207
+ end
208
+
209
+ if attributes.key?(:'file_urls')
210
+ if (value = attributes[:'file_urls']).is_a?(Array)
211
+ self.file_urls = value
212
+ end
213
+ end
214
+
215
+ if attributes.key?(:'allow_reassign')
216
+ self.allow_reassign = attributes[:'allow_reassign']
217
+ else
218
+ self.allow_reassign = false
219
+ end
220
+
221
+ if attributes.key?(:'attachments')
222
+ if (value = attributes[:'attachments']).is_a?(Array)
223
+ self.attachments = value
224
+ end
225
+ end
226
+
227
+ if attributes.key?(:'cc_roles')
228
+ if (value = attributes[:'cc_roles']).is_a?(Array)
229
+ self.cc_roles = value
230
+ end
231
+ end
232
+
233
+ if attributes.key?(:'client_id')
234
+ self.client_id = attributes[:'client_id']
235
+ end
236
+
237
+ if attributes.key?(:'field_options')
238
+ self.field_options = attributes[:'field_options']
239
+ end
240
+
241
+ if attributes.key?(:'form_field_groups')
242
+ if (value = attributes[:'form_field_groups']).is_a?(Array)
243
+ self.form_field_groups = value
244
+ end
245
+ end
246
+
247
+ if attributes.key?(:'form_field_rules')
248
+ if (value = attributes[:'form_field_rules']).is_a?(Array)
249
+ self.form_field_rules = value
250
+ end
251
+ end
252
+
253
+ if attributes.key?(:'merge_fields')
254
+ if (value = attributes[:'merge_fields']).is_a?(Array)
255
+ self.merge_fields = value
256
+ end
257
+ end
258
+
259
+ if attributes.key?(:'message')
260
+ self.message = attributes[:'message']
261
+ end
262
+
263
+ if attributes.key?(:'metadata')
264
+ if (value = attributes[:'metadata']).is_a?(Hash)
265
+ self.metadata = value
266
+ end
267
+ end
268
+
269
+ if attributes.key?(:'subject')
270
+ self.subject = attributes[:'subject']
271
+ end
272
+
273
+ if attributes.key?(:'test_mode')
274
+ self.test_mode = attributes[:'test_mode']
275
+ else
276
+ self.test_mode = false
277
+ end
278
+
279
+ if attributes.key?(:'title')
280
+ self.title = attributes[:'title']
281
+ end
282
+
283
+ if attributes.key?(:'use_preexisting_fields')
284
+ self.use_preexisting_fields = attributes[:'use_preexisting_fields']
285
+ else
286
+ self.use_preexisting_fields = false
287
+ end
288
+ end
289
+
290
+ # Show invalid properties with the reasons. Usually used together with valid?
291
+ # @return Array for valid properties with the reasons
292
+ def list_invalid_properties
293
+ invalid_properties = Array.new
294
+ if @form_fields_per_document.nil?
295
+ invalid_properties.push('invalid value for "form_fields_per_document", form_fields_per_document cannot be nil.')
296
+ end
297
+
298
+ if @signer_roles.nil?
299
+ invalid_properties.push('invalid value for "signer_roles", signer_roles cannot be nil.')
300
+ end
301
+
302
+ if !@message.nil? && @message.to_s.length > 5000
303
+ invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 5000.')
304
+ end
305
+
306
+ if !@subject.nil? && @subject.to_s.length > 200
307
+ invalid_properties.push('invalid value for "subject", the character length must be smaller than or equal to 200.')
308
+ end
309
+
310
+ invalid_properties
311
+ end
312
+
313
+ # Check to see if the all the properties in the model are valid
314
+ # @return true if the model is valid
315
+ def valid?
316
+ return false if @form_fields_per_document.nil?
317
+ return false if @signer_roles.nil?
318
+ return false if !@message.nil? && @message.to_s.length > 5000
319
+ return false if !@subject.nil? && @subject.to_s.length > 200
320
+ true
321
+ end
322
+
323
+ # Custom attribute writer method with validation
324
+ # @param [Object] message Value to be assigned
325
+ def message=(message)
326
+ if !message.nil? && message.to_s.length > 5000
327
+ fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 5000.'
328
+ end
329
+
330
+ @message = message
331
+ end
332
+
333
+ # Custom attribute writer method with validation
334
+ # @param [Object] metadata Value to be assigned
335
+ def metadata=(metadata)
336
+ @metadata = metadata
337
+ end
338
+
339
+ # Custom attribute writer method with validation
340
+ # @param [Object] subject Value to be assigned
341
+ def subject=(subject)
342
+ if !subject.nil? && subject.to_s.length > 200
343
+ fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 200.'
344
+ end
345
+
346
+ @subject = subject
347
+ end
348
+
349
+ # Checks equality by comparing each attribute.
350
+ # @param [Object] Object to be compared
351
+ def ==(o)
352
+ return true if self.equal?(o)
353
+ self.class == o.class &&
354
+ form_fields_per_document == o.form_fields_per_document &&
355
+ signer_roles == o.signer_roles &&
356
+ files == o.files &&
357
+ file_urls == o.file_urls &&
358
+ allow_reassign == o.allow_reassign &&
359
+ attachments == o.attachments &&
360
+ cc_roles == o.cc_roles &&
361
+ client_id == o.client_id &&
362
+ field_options == o.field_options &&
363
+ form_field_groups == o.form_field_groups &&
364
+ form_field_rules == o.form_field_rules &&
365
+ merge_fields == o.merge_fields &&
366
+ message == o.message &&
367
+ metadata == o.metadata &&
368
+ subject == o.subject &&
369
+ test_mode == o.test_mode &&
370
+ title == o.title &&
371
+ use_preexisting_fields == o.use_preexisting_fields
372
+ end
373
+
374
+ # @see the `==` method
375
+ # @param [Object] Object to be compared
376
+ def eql?(o)
377
+ self == o
378
+ end
379
+
380
+ # Calculates hash code according to all attributes.
381
+ # @return [Integer] Hash code
382
+ def hash
383
+ [form_fields_per_document, signer_roles, files, file_urls, allow_reassign, attachments, cc_roles, client_id, field_options, form_field_groups, form_field_rules, merge_fields, message, metadata, subject, test_mode, title, use_preexisting_fields].hash
384
+ end
385
+
386
+ # Builds the object from hash
387
+ # @param [Hash] attributes Model attributes in the form of hash
388
+ # @return [Object] Returns the model itself
389
+ def self.build_from_hash(attributes)
390
+ new.build_from_hash(attributes)
391
+ end
392
+
393
+ # Builds the object from hash
394
+ # @param [Hash] attributes Model attributes in the form of hash
395
+ # @return [Object] Returns the model itself
396
+ def build_from_hash(attributes)
397
+ return nil unless attributes.is_a?(Hash)
398
+ attribute_map = self.class.merged_attributes
399
+
400
+ self.class.merged_types.each_pair do |key, type|
401
+ if type =~ /\AArray<(.*)>/i
402
+ # check to ensure the input is an array given that the attribute
403
+ # is documented as an array but the input is not
404
+ if attributes[attribute_map[key]].is_a?(Array)
405
+ self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) })
406
+ end
407
+ elsif !attributes[attribute_map[key]].nil?
408
+ self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]]))
409
+ end
410
+ end
411
+
412
+ self
413
+ end
414
+
415
+ # Deserializes the data based on type
416
+ # @param string type Data type
417
+ # @param string value Value to be deserialized
418
+ # @return [Object] Deserialized data
419
+ def _deserialize(type, value)
420
+ case type.to_sym
421
+ when :Time
422
+ Time.parse(value)
423
+ when :Date
424
+ Date.parse(value)
425
+ when :String
426
+ value.to_s
427
+ when :Integer
428
+ value.to_i
429
+ when :Float
430
+ value.to_f
431
+ when :Boolean
432
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
433
+ true
434
+ else
435
+ false
436
+ end
437
+ when :File
438
+ value
439
+ when :Object
440
+ # generic object (usually a Hash), return directly
441
+ value
442
+ when /\AArray<(?<inner_type>.+)>\z/
443
+ inner_type = Regexp.last_match[:inner_type]
444
+ value.map { |v| _deserialize(inner_type, v) }
445
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
446
+ k_type = Regexp.last_match[:k_type]
447
+ v_type = Regexp.last_match[:v_type]
448
+ {}.tap do |hash|
449
+ value.each do |k, v|
450
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
451
+ end
452
+ end
453
+ else # model
454
+ # models (e.g. Pet)
455
+ klass = Dropbox::Sign.const_get(type)
456
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
457
+ end
458
+ end
459
+
460
+ # Returns the string representation of the object
461
+ # @return [String] String presentation of the object
462
+ def to_s
463
+ to_hash.to_s
464
+ end
465
+
466
+ # to_body is an alias to to_hash (backward compatibility)
467
+ # @return [Hash] Returns the object in the form of hash
468
+ def to_body
469
+ to_hash
470
+ end
471
+
472
+ # Returns the object in the form of hash
473
+ # @return [Hash] Returns the object in the form of hash
474
+ def to_hash(include_nil = true)
475
+ hash = {}
476
+ self.class.merged_attributes.each_pair do |attr, param|
477
+ value = self.send(attr)
478
+ if value.nil?
479
+ next unless include_nil
480
+ is_nullable = self.class.merged_nullable.include?(attr)
481
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
482
+ end
483
+
484
+ hash[param] = _to_hash(value, include_nil)
485
+ end
486
+ hash
487
+ end
488
+
489
+ # Outputs non-array value in the form of hash
490
+ # For object, use to_hash. Otherwise, just return the value
491
+ # @param [Object] value Any valid value
492
+ # @return [Hash] Returns the value in the form of hash
493
+ def _to_hash(value, include_nil = true)
494
+ if value.is_a?(Array)
495
+ value.compact.map { |v| _to_hash(v, include_nil) }
496
+ elsif value.is_a?(Hash)
497
+ {}.tap do |hash|
498
+ value.each { |k, v| hash[k] = _to_hash(v, include_nil) }
499
+ end
500
+ elsif value.respond_to? :to_hash
501
+ value.to_hash(include_nil)
502
+ else
503
+ value
504
+ end
505
+ end
506
+
507
+ end
508
+
509
+ end