groupdocs_signature_cloud 21.5 → 21.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_signature_cloud/models/barcode_signature.rb +20 -2
  3. data/lib/groupdocs_signature_cloud/models/barcode_type.rb +18 -0
  4. data/lib/groupdocs_signature_cloud/models/barcodes_result.rb +18 -0
  5. data/lib/groupdocs_signature_cloud/models/base_settings.rb +18 -0
  6. data/lib/groupdocs_signature_cloud/models/border_line.rb +18 -0
  7. data/lib/groupdocs_signature_cloud/models/brush.rb +18 -0
  8. data/lib/groupdocs_signature_cloud/models/checkbox_form_field_signature.rb +460 -0
  9. data/lib/groupdocs_signature_cloud/models/color.rb +18 -0
  10. data/lib/groupdocs_signature_cloud/models/combobox_form_field_signature.rb +467 -0
  11. data/lib/groupdocs_signature_cloud/models/delete_options.rb +20 -2
  12. data/lib/groupdocs_signature_cloud/models/delete_result.rb +18 -0
  13. data/lib/groupdocs_signature_cloud/models/delete_settings.rb +18 -0
  14. data/lib/groupdocs_signature_cloud/models/digital_form_field_signature.rb +460 -0
  15. data/lib/groupdocs_signature_cloud/models/digital_signature.rb +20 -2
  16. data/lib/groupdocs_signature_cloud/models/digital_signature_appearance.rb +309 -0
  17. data/lib/groupdocs_signature_cloud/models/disc_usage.rb +18 -0
  18. data/lib/groupdocs_signature_cloud/models/error.rb +18 -0
  19. data/lib/groupdocs_signature_cloud/models/error_details.rb +18 -0
  20. data/lib/groupdocs_signature_cloud/models/file_info.rb +18 -0
  21. data/lib/groupdocs_signature_cloud/models/file_version.rb +18 -0
  22. data/lib/groupdocs_signature_cloud/models/file_versions.rb +18 -0
  23. data/lib/groupdocs_signature_cloud/models/files_list.rb +18 -0
  24. data/lib/groupdocs_signature_cloud/models/files_upload_result.rb +18 -0
  25. data/lib/groupdocs_signature_cloud/models/form_field_signature.rb +445 -0
  26. data/lib/groupdocs_signature_cloud/models/format.rb +18 -0
  27. data/lib/groupdocs_signature_cloud/models/formats_result.rb +18 -0
  28. data/lib/groupdocs_signature_cloud/models/image_appearance.rb +339 -0
  29. data/lib/groupdocs_signature_cloud/models/image_signature.rb +20 -2
  30. data/lib/groupdocs_signature_cloud/models/info_result.rb +34 -4
  31. data/lib/groupdocs_signature_cloud/models/info_settings.rb +37 -4
  32. data/lib/groupdocs_signature_cloud/models/linear_gradient_brush.rb +18 -0
  33. data/lib/groupdocs_signature_cloud/models/object_exist.rb +18 -0
  34. data/lib/groupdocs_signature_cloud/models/options_base.rb +20 -2
  35. data/lib/groupdocs_signature_cloud/models/padding.rb +18 -0
  36. data/lib/groupdocs_signature_cloud/models/page_info.rb +18 -0
  37. data/lib/groupdocs_signature_cloud/models/pages_setup.rb +18 -0
  38. data/lib/groupdocs_signature_cloud/models/pdf_digital_signature.rb +18 -0
  39. data/lib/groupdocs_signature_cloud/models/pdf_digital_signature_appearance.rb +359 -0
  40. data/lib/groupdocs_signature_cloud/models/pdf_text_annotation_appearance.rb +395 -0
  41. data/lib/groupdocs_signature_cloud/models/pdf_text_sticker_appearance.rb +355 -0
  42. data/lib/groupdocs_signature_cloud/models/preview_page.rb +18 -0
  43. data/lib/groupdocs_signature_cloud/models/preview_result.rb +18 -0
  44. data/lib/groupdocs_signature_cloud/models/preview_settings.rb +18 -0
  45. data/lib/groupdocs_signature_cloud/models/qr_code_signature.rb +20 -2
  46. data/lib/groupdocs_signature_cloud/models/qr_code_type.rb +18 -0
  47. data/lib/groupdocs_signature_cloud/models/qr_codes_result.rb +18 -0
  48. data/lib/groupdocs_signature_cloud/models/radial_gradient_brush.rb +18 -0
  49. data/lib/groupdocs_signature_cloud/models/radio_button_form_field_signature.rb +467 -0
  50. data/lib/groupdocs_signature_cloud/models/save_options.rb +18 -0
  51. data/lib/groupdocs_signature_cloud/models/search_barcode_options.rb +20 -2
  52. data/lib/groupdocs_signature_cloud/models/search_digital_options.rb +20 -2
  53. data/lib/groupdocs_signature_cloud/models/search_options.rb +20 -2
  54. data/lib/groupdocs_signature_cloud/models/search_qr_code_options.rb +20 -2
  55. data/lib/groupdocs_signature_cloud/models/search_result.rb +18 -0
  56. data/lib/groupdocs_signature_cloud/models/search_settings.rb +18 -0
  57. data/lib/groupdocs_signature_cloud/models/sign_barcode_options.rb +31 -3
  58. data/lib/groupdocs_signature_cloud/models/sign_digital_options.rb +31 -3
  59. data/lib/groupdocs_signature_cloud/models/sign_image_options.rb +31 -3
  60. data/lib/groupdocs_signature_cloud/models/sign_options.rb +34 -6
  61. data/lib/groupdocs_signature_cloud/models/sign_qr_code_options.rb +31 -3
  62. data/lib/groupdocs_signature_cloud/models/sign_result.rb +18 -0
  63. data/lib/groupdocs_signature_cloud/models/sign_settings.rb +18 -0
  64. data/lib/groupdocs_signature_cloud/models/sign_stamp_options.rb +31 -3
  65. data/lib/groupdocs_signature_cloud/models/sign_text_options.rb +31 -3
  66. data/lib/groupdocs_signature_cloud/models/signature.rb +20 -2
  67. data/lib/groupdocs_signature_cloud/models/signature_appearance.rb +279 -0
  68. data/lib/groupdocs_signature_cloud/models/signature_font.rb +18 -0
  69. data/lib/groupdocs_signature_cloud/models/solid_brush.rb +18 -0
  70. data/lib/groupdocs_signature_cloud/models/stamp_line.rb +18 -0
  71. data/lib/groupdocs_signature_cloud/models/storage_exist.rb +18 -0
  72. data/lib/groupdocs_signature_cloud/models/storage_file.rb +18 -0
  73. data/lib/groupdocs_signature_cloud/models/text_form_field_signature.rb +455 -0
  74. data/lib/groupdocs_signature_cloud/models/text_signature.rb +20 -2
  75. data/lib/groupdocs_signature_cloud/models/texture_brush.rb +18 -0
  76. data/lib/groupdocs_signature_cloud/models/time_stamp.rb +18 -0
  77. data/lib/groupdocs_signature_cloud/models/update_options.rb +20 -2
  78. data/lib/groupdocs_signature_cloud/models/update_result.rb +18 -0
  79. data/lib/groupdocs_signature_cloud/models/update_settings.rb +18 -0
  80. data/lib/groupdocs_signature_cloud/models/verify_barcode_options.rb +20 -2
  81. data/lib/groupdocs_signature_cloud/models/verify_digital_options.rb +20 -2
  82. data/lib/groupdocs_signature_cloud/models/verify_options.rb +20 -2
  83. data/lib/groupdocs_signature_cloud/models/verify_qr_code_options.rb +20 -2
  84. data/lib/groupdocs_signature_cloud/models/verify_result.rb +18 -0
  85. data/lib/groupdocs_signature_cloud/models/verify_settings.rb +18 -0
  86. data/lib/groupdocs_signature_cloud/models/verify_text_options.rb +20 -2
  87. data/lib/groupdocs_signature_cloud/version.rb +1 -1
  88. data/lib/groupdocs_signature_cloud.rb +12 -0
  89. metadata +14 -2
@@ -241,6 +241,24 @@ module GroupDocsSignatureCloud
241
241
  ttype = type
242
242
  if value.is_a?(Hash) and !value[:signatureType].nil?
243
243
  ttype = value[:signatureType] + 'Signature'
244
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
245
+ type = value[:type]
246
+ if type == 'Checkbox'
247
+ ttype = 'CheckboxFormFieldSignature'
248
+ end
249
+ if type == 'Text'
250
+ ttype = 'TextFormFieldSignature'
251
+ end
252
+ if type == 'Combobox'
253
+ ttype = 'ComboboxFormFieldSignature'
254
+ end
255
+ if type == 'DigitalSignature'
256
+ ttype = 'DigitalFormFieldSignature'
257
+ end
258
+ if type == 'Radio'
259
+ ttype = 'RadioButtonFormFieldSignature'
260
+ end
261
+ end
244
262
  end
245
263
  temp_model = GroupDocsSignatureCloud.const_get(ttype).new
246
264
  temp_model.build_from_hash(value)
@@ -228,6 +228,24 @@ module GroupDocsSignatureCloud
228
228
  ttype = type
229
229
  if value.is_a?(Hash) and !value[:signatureType].nil?
230
230
  ttype = value[:signatureType] + 'Signature'
231
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
232
+ type = value[:type]
233
+ if type == 'Checkbox'
234
+ ttype = 'CheckboxFormFieldSignature'
235
+ end
236
+ if type == 'Text'
237
+ ttype = 'TextFormFieldSignature'
238
+ end
239
+ if type == 'Combobox'
240
+ ttype = 'ComboboxFormFieldSignature'
241
+ end
242
+ if type == 'DigitalSignature'
243
+ ttype = 'DigitalFormFieldSignature'
244
+ end
245
+ if type == 'Radio'
246
+ ttype = 'RadioButtonFormFieldSignature'
247
+ end
248
+ end
231
249
  end
232
250
  temp_model = GroupDocsSignatureCloud.const_get(ttype).new
233
251
  temp_model.build_from_hash(value)
@@ -268,6 +268,24 @@ module GroupDocsSignatureCloud
268
268
  ttype = type
269
269
  if value.is_a?(Hash) and !value[:signatureType].nil?
270
270
  ttype = value[:signatureType] + 'Signature'
271
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
272
+ type = value[:type]
273
+ if type == 'Checkbox'
274
+ ttype = 'CheckboxFormFieldSignature'
275
+ end
276
+ if type == 'Text'
277
+ ttype = 'TextFormFieldSignature'
278
+ end
279
+ if type == 'Combobox'
280
+ ttype = 'ComboboxFormFieldSignature'
281
+ end
282
+ if type == 'DigitalSignature'
283
+ ttype = 'DigitalFormFieldSignature'
284
+ end
285
+ if type == 'Radio'
286
+ ttype = 'RadioButtonFormFieldSignature'
287
+ end
288
+ end
271
289
  end
272
290
  temp_model = GroupDocsSignatureCloud.const_get(ttype).new
273
291
  temp_model.build_from_hash(value)
@@ -0,0 +1,359 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="pdf_digital_signature_appearance.rb">
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsSignatureCloud
31
+ # Describes appearance of Digital Signature are on PDF documents.
32
+ class PdfDigitalSignatureAppearance
33
+
34
+ # Specifies the type of appearance
35
+ attr_accessor :appearance_type
36
+
37
+ # Get or set background color of signature appearance. By default the value is SystemColors.Windows
38
+ attr_accessor :background
39
+
40
+ # Gets or sets contact info label. Default value: \"Contact\". if this value is empty then no contact label will appear on digital signature area.
41
+ attr_accessor :contact_info_label
42
+
43
+ # Gets or sets date signed label. Default value: \"Date\".
44
+ attr_accessor :date_signed_at_label
45
+
46
+ # Gets or sets digital signed label. Default value: \"Digitally signed by\".
47
+ attr_accessor :digital_signed_label
48
+
49
+ # Gets or sets the Font family name to display the labels. Default value is \"Arial\".
50
+ attr_accessor :font_family_name
51
+
52
+ # Gets or sets the Font size to display the labels. Default value is 10.
53
+ attr_accessor :font_size
54
+
55
+ # Gets or sets location label. Default value: \"Location\". if this value is empty then no location label will appear on digital signature area.
56
+ attr_accessor :location_label
57
+
58
+ # Gets or sets reason label. Default value: \"Reason\". if this value is empty then no reason label will appear on digital signature area.
59
+ attr_accessor :reason_label
60
+ class EnumAttributeValidator
61
+ attr_reader :datatype
62
+ attr_reader :allowable_values
63
+
64
+ def initialize(datatype, allowable_values)
65
+ @allowable_values = allowable_values.map do |value|
66
+ case datatype.to_s
67
+ when /Integer/i
68
+ value.to_i
69
+ when /Float/i
70
+ value.to_f
71
+ else
72
+ value
73
+ end
74
+ end
75
+ end
76
+
77
+ def valid?(value)
78
+ !value || allowable_values.include?(value)
79
+ end
80
+ end
81
+
82
+ # Attribute mapping from ruby-style variable name to JSON key.
83
+ def self.attribute_map
84
+ {
85
+ :'appearance_type' => :'AppearanceType',
86
+ :'background' => :'Background',
87
+ :'contact_info_label' => :'ContactInfoLabel',
88
+ :'date_signed_at_label' => :'DateSignedAtLabel',
89
+ :'digital_signed_label' => :'DigitalSignedLabel',
90
+ :'font_family_name' => :'FontFamilyName',
91
+ :'font_size' => :'FontSize',
92
+ :'location_label' => :'LocationLabel',
93
+ :'reason_label' => :'ReasonLabel'
94
+ }
95
+ end
96
+
97
+ # Attribute type mapping.
98
+ def self.swagger_types
99
+ {
100
+ :'appearance_type' => :'String',
101
+ :'background' => :'Color',
102
+ :'contact_info_label' => :'String',
103
+ :'date_signed_at_label' => :'String',
104
+ :'digital_signed_label' => :'String',
105
+ :'font_family_name' => :'String',
106
+ :'font_size' => :'Float',
107
+ :'location_label' => :'String',
108
+ :'reason_label' => :'String'
109
+ }
110
+ end
111
+
112
+ # Initializes the object
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ def initialize(attributes = {})
115
+ return unless attributes.is_a?(Hash)
116
+
117
+ # convert string to symbol for hash key
118
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
119
+
120
+ if attributes.key?(:'AppearanceType')
121
+ self.appearance_type = attributes[:'AppearanceType']
122
+ end
123
+
124
+ if attributes.key?(:'Background')
125
+ self.background = attributes[:'Background']
126
+ end
127
+
128
+ if attributes.key?(:'ContactInfoLabel')
129
+ self.contact_info_label = attributes[:'ContactInfoLabel']
130
+ end
131
+
132
+ if attributes.key?(:'DateSignedAtLabel')
133
+ self.date_signed_at_label = attributes[:'DateSignedAtLabel']
134
+ end
135
+
136
+ if attributes.key?(:'DigitalSignedLabel')
137
+ self.digital_signed_label = attributes[:'DigitalSignedLabel']
138
+ end
139
+
140
+ if attributes.key?(:'FontFamilyName')
141
+ self.font_family_name = attributes[:'FontFamilyName']
142
+ end
143
+
144
+ if attributes.key?(:'FontSize')
145
+ self.font_size = attributes[:'FontSize']
146
+ end
147
+
148
+ if attributes.key?(:'LocationLabel')
149
+ self.location_label = attributes[:'LocationLabel']
150
+ end
151
+
152
+ if attributes.key?(:'ReasonLabel')
153
+ self.reason_label = attributes[:'ReasonLabel']
154
+ end
155
+
156
+ end
157
+
158
+ # Show invalid properties with the reasons. Usually used together with valid?
159
+ # @return Array for valid properies with the reasons
160
+ def list_invalid_properties
161
+ invalid_properties = []
162
+ if @appearance_type.nil?
163
+ invalid_properties.push("invalid value for 'appearance_type', appearance_type cannot be nil.")
164
+ end
165
+
166
+ return invalid_properties
167
+ end
168
+
169
+ # Check to see if the all the properties in the model are valid
170
+ # @return true if the model is valid
171
+ def valid?
172
+ return false if @appearance_type.nil?
173
+ appearance_type_validator = EnumAttributeValidator.new('String', ["Undefined", "PdfTextAnnotation", "PdfTextSticker", "Image", "DigitalSignature", "PdfDigitalSignature"])
174
+ return false unless appearance_type_validator.valid?(@appearance_type)
175
+ return true
176
+ end
177
+
178
+ # Custom attribute writer method checking allowed values (enum).
179
+ # @param [Object] appearance_type Object to be assigned
180
+ def appearance_type=(appearance_type)
181
+ validator = EnumAttributeValidator.new('String', ["Undefined", "PdfTextAnnotation", "PdfTextSticker", "Image", "DigitalSignature", "PdfDigitalSignature"])
182
+ if appearance_type.to_i == 0
183
+ unless validator.valid?(appearance_type)
184
+ raise ArgumentError, "invalid value for 'appearance_type', must be one of #{validator.allowable_values}."
185
+ end
186
+ @appearance_type = appearance_type
187
+ else
188
+ @appearance_type = validator.allowable_values[appearance_type.to_i]
189
+ end
190
+ end
191
+
192
+ # Checks equality by comparing each attribute.
193
+ # @param [Object] Object to be compared
194
+ def ==(other)
195
+ return true if self.equal?(other)
196
+ self.class == other.class &&
197
+ appearance_type == other.appearance_type &&
198
+ background == other.background &&
199
+ contact_info_label == other.contact_info_label &&
200
+ date_signed_at_label == other.date_signed_at_label &&
201
+ digital_signed_label == other.digital_signed_label &&
202
+ font_family_name == other.font_family_name &&
203
+ font_size == other.font_size &&
204
+ location_label == other.location_label &&
205
+ reason_label == other.reason_label
206
+ end
207
+
208
+ # @see the `==` method
209
+ # @param [Object] Object to be compared
210
+ def eql?(other)
211
+ self == other
212
+ end
213
+
214
+ # Calculates hash code according to all attributes.
215
+ # @return [Fixnum] Hash code
216
+ def hash
217
+ [appearance_type, background, contact_info_label, date_signed_at_label, digital_signed_label, font_family_name, font_size, location_label, reason_label].hash
218
+ end
219
+
220
+ # Downcases first letter.
221
+ # @return downcased string
222
+ def uncap(str)
223
+ str[0, 1].downcase + str[1..-1]
224
+ end
225
+
226
+ # Builds the object from hash
227
+ # @param [Hash] attributes Model attributes in the form of hash
228
+ # @return [Object] Returns the model itself
229
+ def build_from_hash(attributes)
230
+ return nil unless attributes.is_a?(Hash)
231
+ self.class.swagger_types.each_pair do |key, type|
232
+ pname = uncap(self.class.attribute_map[key]).intern
233
+ value = attributes[pname]
234
+ if type =~ /\AArray<(.*)>/i
235
+ # check to ensure the input is an array given that the the attribute
236
+ # is documented as an array but the input is not
237
+ if value.is_a?(Array)
238
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
239
+ end
240
+ elsif !value.nil?
241
+ self.send("#{key}=", _deserialize(type, value))
242
+ end
243
+ # or else data not found in attributes(hash), not an issue as the data can be optional
244
+ end
245
+
246
+ self
247
+ end
248
+
249
+ # Deserializes the data based on type
250
+ # @param string type Data type
251
+ # @param string value Value to be deserialized
252
+ # @return [Object] Deserialized data
253
+ def _deserialize(type, value)
254
+ case type.to_sym
255
+ when :DateTime
256
+ Date.parse value
257
+ when :Date
258
+ Date.parse value
259
+ when :String
260
+ value.to_s
261
+ when :Integer
262
+ value.to_i
263
+ when :Float
264
+ value.to_f
265
+ when :BOOLEAN
266
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
267
+ true
268
+ else
269
+ false
270
+ end
271
+ when :Object
272
+ # generic object (usually a Hash), return directly
273
+ value
274
+ when /\AArray<(?<inner_type>.+)>\z/
275
+ inner_type = Regexp.last_match[:inner_type]
276
+ value.map { |v| _deserialize(inner_type, v) }
277
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
278
+ k_type = Regexp.last_match[:k_type]
279
+ v_type = Regexp.last_match[:v_type]
280
+ {}.tap do |hash|
281
+ value.each do |k, v|
282
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
283
+ end
284
+ end
285
+ else
286
+ # model
287
+ # Signature type fix
288
+ ttype = type
289
+ if value.is_a?(Hash) and !value[:signatureType].nil?
290
+ ttype = value[:signatureType] + 'Signature'
291
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
292
+ type = value[:type]
293
+ if type == 'Checkbox'
294
+ ttype = 'CheckboxFormFieldSignature'
295
+ end
296
+ if type == 'Text'
297
+ ttype = 'TextFormFieldSignature'
298
+ end
299
+ if type == 'Combobox'
300
+ ttype = 'ComboboxFormFieldSignature'
301
+ end
302
+ if type == 'DigitalSignature'
303
+ ttype = 'DigitalFormFieldSignature'
304
+ end
305
+ if type == 'Radio'
306
+ ttype = 'RadioButtonFormFieldSignature'
307
+ end
308
+ end
309
+ end
310
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
311
+ temp_model.build_from_hash(value)
312
+ end
313
+ end
314
+
315
+ # Returns the string representation of the object
316
+ # @return [String] String presentation of the object
317
+ def to_s
318
+ to_hash.to_s
319
+ end
320
+
321
+ # to_body is an alias to to_hash (backward compatibility)
322
+ # @return [Hash] Returns the object in the form of hash
323
+ def to_body
324
+ to_hash
325
+ end
326
+
327
+ # Returns the object in the form of hash
328
+ # @return [Hash] Returns the object in the form of hash
329
+ def to_hash
330
+ hash = {}
331
+ self.class.attribute_map.each_pair do |attr, param|
332
+ value = self.send(attr)
333
+ next if value.nil?
334
+ hash[param] = _to_hash(value)
335
+ end
336
+ hash
337
+ end
338
+
339
+ # Outputs non-array value in the form of hash
340
+ # For object, use to_hash. Otherwise, just return the value
341
+ # @param [Object] value Any valid value
342
+ # @return [Hash] Returns the value in the form of hash
343
+ def _to_hash(value)
344
+ if value.is_a?(Array)
345
+ value.compact.map { |v| _to_hash(v) }
346
+ elsif value.is_a?(Hash)
347
+ {}.tap do |hash|
348
+ value.each { |k, v| hash[k] = _to_hash(v) }
349
+ end
350
+ elsif value.respond_to? :to_hash
351
+ value.to_hash
352
+ else
353
+ value
354
+ end
355
+ end
356
+
357
+ end
358
+
359
+ end