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