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
@@ -0,0 +1,467 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="combobox_form_field_signature.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
+ # Contains combo-box input form field signature properties
32
+ class ComboboxFormFieldSignature
33
+
34
+ # Specifies the signature type (Text, Image, Digital, Barcode, QRCode, Stamp)
35
+ attr_accessor :signature_type
36
+
37
+ # Specifies the page signature was found on
38
+ attr_accessor :page_number
39
+
40
+ # Unique signature identifier to modify signature in the document over Update or Delete methods. This property will be set automatically after Sign or Search method being called. If this property was saved before it can be set manually to manipulate the signature.
41
+ attr_accessor :signature_id
42
+
43
+ # Get or set flag to indicate if this component is Signature or document content. This property is being used with Update method to set element as signature (true) or document element (false).
44
+ attr_accessor :is_signature
45
+
46
+ # Get or set the signature creation date
47
+ attr_accessor :created_on
48
+
49
+ # Get or set the signature modification date
50
+ attr_accessor :modified_on
51
+
52
+ # Specifies top position of signature
53
+ attr_accessor :top
54
+
55
+ # Specifies left position of signature
56
+ attr_accessor :left
57
+
58
+ # Specifies width of signature
59
+ attr_accessor :width
60
+
61
+ # Specifies height of signature
62
+ attr_accessor :height
63
+
64
+ # Specifies unique form field name
65
+ attr_accessor :name
66
+
67
+ # Specifies Form field type
68
+ attr_accessor :type
69
+
70
+ # Get or set selected value
71
+ attr_accessor :selected
72
+
73
+ # Get or set combo-box options list
74
+ attr_accessor :items
75
+ class EnumAttributeValidator
76
+ attr_reader :datatype
77
+ attr_reader :allowable_values
78
+
79
+ def initialize(datatype, allowable_values)
80
+ @allowable_values = allowable_values.map do |value|
81
+ case datatype.to_s
82
+ when /Integer/i
83
+ value.to_i
84
+ when /Float/i
85
+ value.to_f
86
+ else
87
+ value
88
+ end
89
+ end
90
+ end
91
+
92
+ def valid?(value)
93
+ !value || allowable_values.include?(value)
94
+ end
95
+ end
96
+
97
+ # Attribute mapping from ruby-style variable name to JSON key.
98
+ def self.attribute_map
99
+ {
100
+ :'signature_type' => :'SignatureType',
101
+ :'page_number' => :'PageNumber',
102
+ :'signature_id' => :'SignatureId',
103
+ :'is_signature' => :'IsSignature',
104
+ :'created_on' => :'CreatedOn',
105
+ :'modified_on' => :'ModifiedOn',
106
+ :'top' => :'Top',
107
+ :'left' => :'Left',
108
+ :'width' => :'Width',
109
+ :'height' => :'Height',
110
+ :'name' => :'Name',
111
+ :'type' => :'Type',
112
+ :'selected' => :'Selected',
113
+ :'items' => :'Items'
114
+ }
115
+ end
116
+
117
+ # Attribute type mapping.
118
+ def self.swagger_types
119
+ {
120
+ :'signature_type' => :'String',
121
+ :'page_number' => :'Integer',
122
+ :'signature_id' => :'String',
123
+ :'is_signature' => :'BOOLEAN',
124
+ :'created_on' => :'DateTime',
125
+ :'modified_on' => :'DateTime',
126
+ :'top' => :'Integer',
127
+ :'left' => :'Integer',
128
+ :'width' => :'Integer',
129
+ :'height' => :'Integer',
130
+ :'name' => :'String',
131
+ :'type' => :'String',
132
+ :'selected' => :'String',
133
+ :'items' => :'Array<String>'
134
+ }
135
+ end
136
+
137
+ # Initializes the object
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ def initialize(attributes = {})
140
+ return unless attributes.is_a?(Hash)
141
+
142
+ # convert string to symbol for hash key
143
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
144
+
145
+ if attributes.key?(:'SignatureType')
146
+ self.signature_type = attributes[:'SignatureType']
147
+ end
148
+
149
+ if attributes.key?(:'PageNumber')
150
+ self.page_number = attributes[:'PageNumber']
151
+ end
152
+
153
+ if attributes.key?(:'SignatureId')
154
+ self.signature_id = attributes[:'SignatureId']
155
+ end
156
+
157
+ if attributes.key?(:'IsSignature')
158
+ self.is_signature = attributes[:'IsSignature']
159
+ end
160
+
161
+ if attributes.key?(:'CreatedOn')
162
+ self.created_on = attributes[:'CreatedOn']
163
+ end
164
+
165
+ if attributes.key?(:'ModifiedOn')
166
+ self.modified_on = attributes[:'ModifiedOn']
167
+ end
168
+
169
+ if attributes.key?(:'Top')
170
+ self.top = attributes[:'Top']
171
+ end
172
+
173
+ if attributes.key?(:'Left')
174
+ self.left = attributes[:'Left']
175
+ end
176
+
177
+ if attributes.key?(:'Width')
178
+ self.width = attributes[:'Width']
179
+ end
180
+
181
+ if attributes.key?(:'Height')
182
+ self.height = attributes[:'Height']
183
+ end
184
+
185
+ if attributes.key?(:'Name')
186
+ self.name = attributes[:'Name']
187
+ end
188
+
189
+ if attributes.key?(:'Type')
190
+ self.type = attributes[:'Type']
191
+ end
192
+
193
+ if attributes.key?(:'Selected')
194
+ self.selected = attributes[:'Selected']
195
+ end
196
+
197
+ if attributes.key?(:'Items')
198
+ if (value = attributes[:'Items']).is_a?(Array)
199
+ self.items = value
200
+ end
201
+ end
202
+
203
+ end
204
+
205
+ # Show invalid properties with the reasons. Usually used together with valid?
206
+ # @return Array for valid properies with the reasons
207
+ def list_invalid_properties
208
+ invalid_properties = []
209
+ if @signature_type.nil?
210
+ invalid_properties.push("invalid value for 'signature_type', signature_type cannot be nil.")
211
+ end
212
+
213
+ if @is_signature.nil?
214
+ invalid_properties.push("invalid value for 'is_signature', is_signature cannot be nil.")
215
+ end
216
+
217
+ if @created_on.nil?
218
+ invalid_properties.push("invalid value for 'created_on', created_on cannot be nil.")
219
+ end
220
+
221
+ if @modified_on.nil?
222
+ invalid_properties.push("invalid value for 'modified_on', modified_on cannot be nil.")
223
+ end
224
+
225
+ if @top.nil?
226
+ invalid_properties.push("invalid value for 'top', top cannot be nil.")
227
+ end
228
+
229
+ if @left.nil?
230
+ invalid_properties.push("invalid value for 'left', left cannot be nil.")
231
+ end
232
+
233
+ if @width.nil?
234
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
235
+ end
236
+
237
+ if @height.nil?
238
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
239
+ end
240
+
241
+ if @type.nil?
242
+ invalid_properties.push("invalid value for 'type', type cannot be nil.")
243
+ end
244
+
245
+ return invalid_properties
246
+ end
247
+
248
+ # Check to see if the all the properties in the model are valid
249
+ # @return true if the model is valid
250
+ def valid?
251
+ return false if @signature_type.nil?
252
+ signature_type_validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp", "FormField", "Metadata"])
253
+ return false unless signature_type_validator.valid?(@signature_type)
254
+ return false if @is_signature.nil?
255
+ return false if @created_on.nil?
256
+ return false if @modified_on.nil?
257
+ return false if @top.nil?
258
+ return false if @left.nil?
259
+ return false if @width.nil?
260
+ return false if @height.nil?
261
+ return false if @type.nil?
262
+ type_validator = EnumAttributeValidator.new('String', ["Text", "Checkbox", "Combobox", "DigitalSignature", "Radio", "None"])
263
+ return false unless type_validator.valid?(@type)
264
+ return true
265
+ end
266
+
267
+ # Custom attribute writer method checking allowed values (enum).
268
+ # @param [Object] signature_type Object to be assigned
269
+ def signature_type=(signature_type)
270
+ validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp", "FormField", "Metadata"])
271
+ if signature_type.to_i == 0
272
+ unless validator.valid?(signature_type)
273
+ raise ArgumentError, "invalid value for 'signature_type', must be one of #{validator.allowable_values}."
274
+ end
275
+ @signature_type = signature_type
276
+ else
277
+ @signature_type = validator.allowable_values[signature_type.to_i]
278
+ end
279
+ end
280
+
281
+ # Custom attribute writer method checking allowed values (enum).
282
+ # @param [Object] type Object to be assigned
283
+ def type=(type)
284
+ validator = EnumAttributeValidator.new('String', ["Text", "Checkbox", "Combobox", "DigitalSignature", "Radio", "None"])
285
+ if type.to_i == 0
286
+ unless validator.valid?(type)
287
+ raise ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
288
+ end
289
+ @type = type
290
+ else
291
+ @type = validator.allowable_values[type.to_i]
292
+ end
293
+ end
294
+
295
+ # Checks equality by comparing each attribute.
296
+ # @param [Object] Object to be compared
297
+ def ==(other)
298
+ return true if self.equal?(other)
299
+ self.class == other.class &&
300
+ signature_type == other.signature_type &&
301
+ page_number == other.page_number &&
302
+ signature_id == other.signature_id &&
303
+ is_signature == other.is_signature &&
304
+ created_on == other.created_on &&
305
+ modified_on == other.modified_on &&
306
+ top == other.top &&
307
+ left == other.left &&
308
+ width == other.width &&
309
+ height == other.height &&
310
+ name == other.name &&
311
+ type == other.type &&
312
+ selected == other.selected &&
313
+ items == other.items
314
+ end
315
+
316
+ # @see the `==` method
317
+ # @param [Object] Object to be compared
318
+ def eql?(other)
319
+ self == other
320
+ end
321
+
322
+ # Calculates hash code according to all attributes.
323
+ # @return [Fixnum] Hash code
324
+ def hash
325
+ [signature_type, page_number, signature_id, is_signature, created_on, modified_on, top, left, width, height, name, type, selected, items].hash
326
+ end
327
+
328
+ # Downcases first letter.
329
+ # @return downcased string
330
+ def uncap(str)
331
+ str[0, 1].downcase + str[1..-1]
332
+ end
333
+
334
+ # Builds the object from hash
335
+ # @param [Hash] attributes Model attributes in the form of hash
336
+ # @return [Object] Returns the model itself
337
+ def build_from_hash(attributes)
338
+ return nil unless attributes.is_a?(Hash)
339
+ self.class.swagger_types.each_pair do |key, type|
340
+ pname = uncap(self.class.attribute_map[key]).intern
341
+ value = attributes[pname]
342
+ if type =~ /\AArray<(.*)>/i
343
+ # check to ensure the input is an array given that the the attribute
344
+ # is documented as an array but the input is not
345
+ if value.is_a?(Array)
346
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
347
+ end
348
+ elsif !value.nil?
349
+ self.send("#{key}=", _deserialize(type, value))
350
+ end
351
+ # or else data not found in attributes(hash), not an issue as the data can be optional
352
+ end
353
+
354
+ self
355
+ end
356
+
357
+ # Deserializes the data based on type
358
+ # @param string type Data type
359
+ # @param string value Value to be deserialized
360
+ # @return [Object] Deserialized data
361
+ def _deserialize(type, value)
362
+ case type.to_sym
363
+ when :DateTime
364
+ Date.parse value
365
+ when :Date
366
+ Date.parse value
367
+ when :String
368
+ value.to_s
369
+ when :Integer
370
+ value.to_i
371
+ when :Float
372
+ value.to_f
373
+ when :BOOLEAN
374
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
375
+ true
376
+ else
377
+ false
378
+ end
379
+ when :Object
380
+ # generic object (usually a Hash), return directly
381
+ value
382
+ when /\AArray<(?<inner_type>.+)>\z/
383
+ inner_type = Regexp.last_match[:inner_type]
384
+ value.map { |v| _deserialize(inner_type, v) }
385
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
386
+ k_type = Regexp.last_match[:k_type]
387
+ v_type = Regexp.last_match[:v_type]
388
+ {}.tap do |hash|
389
+ value.each do |k, v|
390
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
391
+ end
392
+ end
393
+ else
394
+ # model
395
+ # Signature type fix
396
+ ttype = type
397
+ if value.is_a?(Hash) and !value[:signatureType].nil?
398
+ ttype = value[:signatureType] + 'Signature'
399
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
400
+ type = value[:type]
401
+ if type == 'Checkbox'
402
+ ttype = 'CheckboxFormFieldSignature'
403
+ end
404
+ if type == 'Text'
405
+ ttype = 'TextFormFieldSignature'
406
+ end
407
+ if type == 'Combobox'
408
+ ttype = 'ComboboxFormFieldSignature'
409
+ end
410
+ if type == 'DigitalSignature'
411
+ ttype = 'DigitalFormFieldSignature'
412
+ end
413
+ if type == 'Radio'
414
+ ttype = 'RadioButtonFormFieldSignature'
415
+ end
416
+ end
417
+ end
418
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
419
+ temp_model.build_from_hash(value)
420
+ end
421
+ end
422
+
423
+ # Returns the string representation of the object
424
+ # @return [String] String presentation of the object
425
+ def to_s
426
+ to_hash.to_s
427
+ end
428
+
429
+ # to_body is an alias to to_hash (backward compatibility)
430
+ # @return [Hash] Returns the object in the form of hash
431
+ def to_body
432
+ to_hash
433
+ end
434
+
435
+ # Returns the object in the form of hash
436
+ # @return [Hash] Returns the object in the form of hash
437
+ def to_hash
438
+ hash = {}
439
+ self.class.attribute_map.each_pair do |attr, param|
440
+ value = self.send(attr)
441
+ next if value.nil?
442
+ hash[param] = _to_hash(value)
443
+ end
444
+ hash
445
+ end
446
+
447
+ # Outputs non-array value in the form of hash
448
+ # For object, use to_hash. Otherwise, just return the value
449
+ # @param [Object] value Any valid value
450
+ # @return [Hash] Returns the value in the form of hash
451
+ def _to_hash(value)
452
+ if value.is_a?(Array)
453
+ value.compact.map { |v| _to_hash(v) }
454
+ elsif value.is_a?(Hash)
455
+ {}.tap do |hash|
456
+ value.each { |k, v| hash[k] = _to_hash(v) }
457
+ end
458
+ elsif value.respond_to? :to_hash
459
+ value.to_hash
460
+ else
461
+ value
462
+ end
463
+ end
464
+
465
+ end
466
+
467
+ end
@@ -107,7 +107,7 @@ module GroupDocsSignatureCloud
107
107
  # @return true if the model is valid
108
108
  def valid?
109
109
  return false if @signature_type.nil?
110
- signature_type_validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp"])
110
+ signature_type_validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp", "FormField", "Metadata"])
111
111
  return false unless signature_type_validator.valid?(@signature_type)
112
112
  return true
113
113
  end
@@ -115,7 +115,7 @@ module GroupDocsSignatureCloud
115
115
  # Custom attribute writer method checking allowed values (enum).
116
116
  # @param [Object] signature_type Object to be assigned
117
117
  def signature_type=(signature_type)
118
- validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp"])
118
+ validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp", "FormField", "Metadata"])
119
119
  if signature_type.to_i == 0
120
120
  unless validator.valid?(signature_type)
121
121
  raise ArgumentError, "invalid value for 'signature_type', must be one of #{validator.allowable_values}."
@@ -218,6 +218,24 @@ module GroupDocsSignatureCloud
218
218
  ttype = type
219
219
  if value.is_a?(Hash) and !value[:signatureType].nil?
220
220
  ttype = value[:signatureType] + 'Signature'
221
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
222
+ type = value[:type]
223
+ if type == 'Checkbox'
224
+ ttype = 'CheckboxFormFieldSignature'
225
+ end
226
+ if type == 'Text'
227
+ ttype = 'TextFormFieldSignature'
228
+ end
229
+ if type == 'Combobox'
230
+ ttype = 'ComboboxFormFieldSignature'
231
+ end
232
+ if type == 'DigitalSignature'
233
+ ttype = 'DigitalFormFieldSignature'
234
+ end
235
+ if type == 'Radio'
236
+ ttype = 'RadioButtonFormFieldSignature'
237
+ end
238
+ end
221
239
  end
222
240
  temp_model = GroupDocsSignatureCloud.const_get(ttype).new
223
241
  temp_model.build_from_hash(value)
@@ -205,6 +205,24 @@ module GroupDocsSignatureCloud
205
205
  ttype = type
206
206
  if value.is_a?(Hash) and !value[:signatureType].nil?
207
207
  ttype = value[:signatureType] + 'Signature'
208
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
209
+ type = value[:type]
210
+ if type == 'Checkbox'
211
+ ttype = 'CheckboxFormFieldSignature'
212
+ end
213
+ if type == 'Text'
214
+ ttype = 'TextFormFieldSignature'
215
+ end
216
+ if type == 'Combobox'
217
+ ttype = 'ComboboxFormFieldSignature'
218
+ end
219
+ if type == 'DigitalSignature'
220
+ ttype = 'DigitalFormFieldSignature'
221
+ end
222
+ if type == 'Radio'
223
+ ttype = 'RadioButtonFormFieldSignature'
224
+ end
225
+ end
208
226
  end
209
227
  temp_model = GroupDocsSignatureCloud.const_get(ttype).new
210
228
  temp_model.build_from_hash(value)
@@ -178,6 +178,24 @@ module GroupDocsSignatureCloud
178
178
  ttype = type
179
179
  if value.is_a?(Hash) and !value[:signatureType].nil?
180
180
  ttype = value[:signatureType] + 'Signature'
181
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
182
+ type = value[:type]
183
+ if type == 'Checkbox'
184
+ ttype = 'CheckboxFormFieldSignature'
185
+ end
186
+ if type == 'Text'
187
+ ttype = 'TextFormFieldSignature'
188
+ end
189
+ if type == 'Combobox'
190
+ ttype = 'ComboboxFormFieldSignature'
191
+ end
192
+ if type == 'DigitalSignature'
193
+ ttype = 'DigitalFormFieldSignature'
194
+ end
195
+ if type == 'Radio'
196
+ ttype = 'RadioButtonFormFieldSignature'
197
+ end
198
+ end
181
199
  end
182
200
  temp_model = GroupDocsSignatureCloud.const_get(ttype).new
183
201
  temp_model.build_from_hash(value)