groupdocs_signature_cloud 22.6 → 23.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +5 -5
  2. data/lib/groupdocs_signature_cloud/api/file_api.rb +6 -6
  3. data/lib/groupdocs_signature_cloud/api/folder_api.rb +6 -6
  4. data/lib/groupdocs_signature_cloud/api/info_api.rb +2 -2
  5. data/lib/groupdocs_signature_cloud/api/license_api.rb +1 -1
  6. data/lib/groupdocs_signature_cloud/api/preview_api.rb +2 -2
  7. data/lib/groupdocs_signature_cloud/api/sign_api.rb +6 -6
  8. data/lib/groupdocs_signature_cloud/api/storage_api.rb +5 -5
  9. data/lib/groupdocs_signature_cloud/api_client.rb +5 -6
  10. data/lib/groupdocs_signature_cloud/{api_error.rb → api_client_error.rb} +5 -5
  11. data/lib/groupdocs_signature_cloud/configuration.rb +1 -1
  12. data/lib/groupdocs_signature_cloud/models/barcode_signature.rb +1 -1
  13. data/lib/groupdocs_signature_cloud/models/barcode_type.rb +1 -1
  14. data/lib/groupdocs_signature_cloud/models/barcodes_result.rb +1 -1
  15. data/lib/groupdocs_signature_cloud/models/base_settings.rb +1 -1
  16. data/lib/groupdocs_signature_cloud/models/border_line.rb +1 -1
  17. data/lib/groupdocs_signature_cloud/models/brush.rb +1 -1
  18. data/lib/groupdocs_signature_cloud/models/checkbox_form_field_signature.rb +1 -1
  19. data/lib/groupdocs_signature_cloud/models/color.rb +5 -20
  20. data/lib/groupdocs_signature_cloud/models/combobox_form_field_signature.rb +1 -1
  21. data/lib/groupdocs_signature_cloud/models/consumption_result.rb +1 -1
  22. data/lib/groupdocs_signature_cloud/models/delete_options.rb +1 -1
  23. data/lib/groupdocs_signature_cloud/models/delete_result.rb +1 -1
  24. data/lib/groupdocs_signature_cloud/models/delete_settings.rb +1 -1
  25. data/lib/groupdocs_signature_cloud/models/digital_form_field_signature.rb +1 -1
  26. data/lib/groupdocs_signature_cloud/models/digital_signature.rb +1 -1
  27. data/lib/groupdocs_signature_cloud/models/digital_signature_appearance.rb +1 -1
  28. data/lib/groupdocs_signature_cloud/models/digital_vba.rb +272 -0
  29. data/lib/groupdocs_signature_cloud/models/disc_usage.rb +1 -1
  30. data/lib/groupdocs_signature_cloud/models/error.rb +1 -1
  31. data/lib/groupdocs_signature_cloud/models/error_details.rb +1 -1
  32. data/lib/groupdocs_signature_cloud/models/file_info.rb +1 -1
  33. data/lib/groupdocs_signature_cloud/models/file_version.rb +1 -1
  34. data/lib/groupdocs_signature_cloud/models/file_versions.rb +1 -1
  35. data/lib/groupdocs_signature_cloud/models/files_list.rb +1 -1
  36. data/lib/groupdocs_signature_cloud/models/files_upload_result.rb +1 -1
  37. data/lib/groupdocs_signature_cloud/models/form_field_signature.rb +1 -1
  38. data/lib/groupdocs_signature_cloud/models/format.rb +1 -1
  39. data/lib/groupdocs_signature_cloud/models/formats_result.rb +1 -1
  40. data/lib/groupdocs_signature_cloud/models/image_appearance.rb +1 -1
  41. data/lib/groupdocs_signature_cloud/models/image_signature.rb +1 -1
  42. data/lib/groupdocs_signature_cloud/models/info_result.rb +1 -1
  43. data/lib/groupdocs_signature_cloud/models/info_settings.rb +1 -1
  44. data/lib/groupdocs_signature_cloud/models/linear_gradient_brush.rb +1 -1
  45. data/lib/groupdocs_signature_cloud/models/metadata_signature.rb +536 -0
  46. data/lib/groupdocs_signature_cloud/models/object_exist.rb +1 -1
  47. data/lib/groupdocs_signature_cloud/models/options_base.rb +1 -1
  48. data/lib/groupdocs_signature_cloud/models/padding.rb +1 -1
  49. data/lib/groupdocs_signature_cloud/models/page_info.rb +1 -1
  50. data/lib/groupdocs_signature_cloud/models/pages_setup.rb +1 -1
  51. data/lib/groupdocs_signature_cloud/models/pdf_digital_signature.rb +1 -1
  52. data/lib/groupdocs_signature_cloud/models/pdf_digital_signature_appearance.rb +1 -1
  53. data/lib/groupdocs_signature_cloud/models/pdf_text_annotation_appearance.rb +1 -1
  54. data/lib/groupdocs_signature_cloud/models/pdf_text_sticker_appearance.rb +1 -1
  55. data/lib/groupdocs_signature_cloud/models/preview_page.rb +1 -1
  56. data/lib/groupdocs_signature_cloud/models/preview_result.rb +1 -1
  57. data/lib/groupdocs_signature_cloud/models/preview_settings.rb +1 -1
  58. data/lib/groupdocs_signature_cloud/models/qr_code_signature.rb +1 -1
  59. data/lib/groupdocs_signature_cloud/models/qr_code_type.rb +1 -1
  60. data/lib/groupdocs_signature_cloud/models/qr_codes_result.rb +1 -1
  61. data/lib/groupdocs_signature_cloud/models/radial_gradient_brush.rb +1 -1
  62. data/lib/groupdocs_signature_cloud/models/radio_button_form_field_signature.rb +1 -1
  63. data/lib/groupdocs_signature_cloud/models/save_options.rb +1 -1
  64. data/lib/groupdocs_signature_cloud/models/search_barcode_options.rb +1 -1
  65. data/lib/groupdocs_signature_cloud/models/search_digital_options.rb +1 -1
  66. data/lib/groupdocs_signature_cloud/models/search_options.rb +1 -1
  67. data/lib/groupdocs_signature_cloud/models/search_qr_code_options.rb +1 -1
  68. data/lib/groupdocs_signature_cloud/models/search_result.rb +1 -1
  69. data/lib/groupdocs_signature_cloud/models/search_settings.rb +1 -1
  70. data/lib/groupdocs_signature_cloud/models/sign_barcode_options.rb +1 -1
  71. data/lib/groupdocs_signature_cloud/models/sign_digital_options.rb +15 -5
  72. data/lib/groupdocs_signature_cloud/models/sign_image_options.rb +1 -1
  73. data/lib/groupdocs_signature_cloud/models/sign_options.rb +1 -1
  74. data/lib/groupdocs_signature_cloud/models/sign_qr_code_options.rb +1 -1
  75. data/lib/groupdocs_signature_cloud/models/sign_result.rb +1 -1
  76. data/lib/groupdocs_signature_cloud/models/sign_settings.rb +1 -1
  77. data/lib/groupdocs_signature_cloud/models/sign_stamp_options.rb +1 -1
  78. data/lib/groupdocs_signature_cloud/models/sign_text_options.rb +1 -1
  79. data/lib/groupdocs_signature_cloud/models/signature.rb +1 -1
  80. data/lib/groupdocs_signature_cloud/models/signature_appearance.rb +1 -1
  81. data/lib/groupdocs_signature_cloud/models/signature_font.rb +1 -1
  82. data/lib/groupdocs_signature_cloud/models/solid_brush.rb +1 -1
  83. data/lib/groupdocs_signature_cloud/models/stamp_line.rb +1 -1
  84. data/lib/groupdocs_signature_cloud/models/storage_exist.rb +1 -1
  85. data/lib/groupdocs_signature_cloud/models/storage_file.rb +1 -1
  86. data/lib/groupdocs_signature_cloud/models/text_form_field_signature.rb +1 -1
  87. data/lib/groupdocs_signature_cloud/models/text_signature.rb +1 -1
  88. data/lib/groupdocs_signature_cloud/models/texture_brush.rb +1 -1
  89. data/lib/groupdocs_signature_cloud/models/time_stamp.rb +1 -1
  90. data/lib/groupdocs_signature_cloud/models/update_options.rb +1 -1
  91. data/lib/groupdocs_signature_cloud/models/update_result.rb +1 -1
  92. data/lib/groupdocs_signature_cloud/models/update_settings.rb +1 -1
  93. data/lib/groupdocs_signature_cloud/models/verify_barcode_options.rb +1 -1
  94. data/lib/groupdocs_signature_cloud/models/verify_digital_options.rb +1 -1
  95. data/lib/groupdocs_signature_cloud/models/verify_options.rb +1 -1
  96. data/lib/groupdocs_signature_cloud/models/verify_qr_code_options.rb +1 -1
  97. data/lib/groupdocs_signature_cloud/models/verify_result.rb +1 -1
  98. data/lib/groupdocs_signature_cloud/models/verify_settings.rb +1 -1
  99. data/lib/groupdocs_signature_cloud/models/verify_text_options.rb +1 -1
  100. data/lib/groupdocs_signature_cloud/version.rb +2 -2
  101. data/lib/groupdocs_signature_cloud.rb +4 -2
  102. metadata +13 -12
@@ -0,0 +1,536 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="metadata_signature.rb">
4
+ # Copyright (c) 2003-2023 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 Metadata signature properties.
32
+ class MetadataSignature
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 metadata type.
65
+ attr_accessor :type
66
+
67
+ # Specifies metadata value type.
68
+ attr_accessor :data_type
69
+
70
+ # Specifies metadata object value
71
+ attr_accessor :value
72
+
73
+ # Specifies unique metadata name
74
+ attr_accessor :name
75
+
76
+ # The identifier of Image Metadata signature. See GroupDocs.Signature.Domain.ImageMetadataSignatures class that contains standard Signature with predefined Id value.
77
+ attr_accessor :id
78
+
79
+ # Size of Image Metadata value
80
+ attr_accessor :size
81
+
82
+ # Description for standard Image Metadata signature
83
+ attr_accessor :description
84
+
85
+ # The prefix tag of Pdf Metadata signature name. By default this property is set to \"xmp\". Possible values are
86
+ attr_accessor :tag_prefix
87
+ class EnumAttributeValidator
88
+ attr_reader :datatype
89
+ attr_reader :allowable_values
90
+
91
+ def initialize(datatype, allowable_values)
92
+ @allowable_values = allowable_values.map do |value|
93
+ case datatype.to_s
94
+ when /Integer/i
95
+ value.to_i
96
+ when /Float/i
97
+ value.to_f
98
+ else
99
+ value
100
+ end
101
+ end
102
+ end
103
+
104
+ def valid?(value)
105
+ !value || allowable_values.include?(value)
106
+ end
107
+ end
108
+
109
+ # Attribute mapping from ruby-style variable name to JSON key.
110
+ def self.attribute_map
111
+ {
112
+ :'signature_type' => :'SignatureType',
113
+ :'page_number' => :'PageNumber',
114
+ :'signature_id' => :'SignatureId',
115
+ :'is_signature' => :'IsSignature',
116
+ :'created_on' => :'CreatedOn',
117
+ :'modified_on' => :'ModifiedOn',
118
+ :'top' => :'Top',
119
+ :'left' => :'Left',
120
+ :'width' => :'Width',
121
+ :'height' => :'Height',
122
+ :'type' => :'Type',
123
+ :'data_type' => :'DataType',
124
+ :'value' => :'Value',
125
+ :'name' => :'Name',
126
+ :'id' => :'Id',
127
+ :'size' => :'Size',
128
+ :'description' => :'Description',
129
+ :'tag_prefix' => :'TagPrefix'
130
+ }
131
+ end
132
+
133
+ # Attribute type mapping.
134
+ def self.swagger_types
135
+ {
136
+ :'signature_type' => :'String',
137
+ :'page_number' => :'Integer',
138
+ :'signature_id' => :'String',
139
+ :'is_signature' => :'BOOLEAN',
140
+ :'created_on' => :'DateTime',
141
+ :'modified_on' => :'DateTime',
142
+ :'top' => :'Integer',
143
+ :'left' => :'Integer',
144
+ :'width' => :'Integer',
145
+ :'height' => :'Integer',
146
+ :'type' => :'String',
147
+ :'data_type' => :'String',
148
+ :'value' => :'String',
149
+ :'name' => :'String',
150
+ :'id' => :'Integer',
151
+ :'size' => :'Integer',
152
+ :'description' => :'String',
153
+ :'tag_prefix' => :'String'
154
+ }
155
+ end
156
+
157
+ # Initializes the object
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ def initialize(attributes = {})
160
+ return unless attributes.is_a?(Hash)
161
+
162
+ # convert string to symbol for hash key
163
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
164
+
165
+ if attributes.key?(:'SignatureType')
166
+ self.signature_type = attributes[:'SignatureType']
167
+ end
168
+
169
+ if attributes.key?(:'PageNumber')
170
+ self.page_number = attributes[:'PageNumber']
171
+ end
172
+
173
+ if attributes.key?(:'SignatureId')
174
+ self.signature_id = attributes[:'SignatureId']
175
+ end
176
+
177
+ if attributes.key?(:'IsSignature')
178
+ self.is_signature = attributes[:'IsSignature']
179
+ end
180
+
181
+ if attributes.key?(:'CreatedOn')
182
+ self.created_on = attributes[:'CreatedOn']
183
+ end
184
+
185
+ if attributes.key?(:'ModifiedOn')
186
+ self.modified_on = attributes[:'ModifiedOn']
187
+ end
188
+
189
+ if attributes.key?(:'Top')
190
+ self.top = attributes[:'Top']
191
+ end
192
+
193
+ if attributes.key?(:'Left')
194
+ self.left = attributes[:'Left']
195
+ end
196
+
197
+ if attributes.key?(:'Width')
198
+ self.width = attributes[:'Width']
199
+ end
200
+
201
+ if attributes.key?(:'Height')
202
+ self.height = attributes[:'Height']
203
+ end
204
+
205
+ if attributes.key?(:'Type')
206
+ self.type = attributes[:'Type']
207
+ end
208
+
209
+ if attributes.key?(:'DataType')
210
+ self.data_type = attributes[:'DataType']
211
+ end
212
+
213
+ if attributes.key?(:'Value')
214
+ self.value = attributes[:'Value']
215
+ end
216
+
217
+ if attributes.key?(:'Name')
218
+ self.name = attributes[:'Name']
219
+ end
220
+
221
+ if attributes.key?(:'Id')
222
+ self.id = attributes[:'Id']
223
+ end
224
+
225
+ if attributes.key?(:'Size')
226
+ self.size = attributes[:'Size']
227
+ end
228
+
229
+ if attributes.key?(:'Description')
230
+ self.description = attributes[:'Description']
231
+ end
232
+
233
+ if attributes.key?(:'TagPrefix')
234
+ self.tag_prefix = attributes[:'TagPrefix']
235
+ end
236
+
237
+ end
238
+
239
+ # Show invalid properties with the reasons. Usually used together with valid?
240
+ # @return Array for valid properies with the reasons
241
+ def list_invalid_properties
242
+ invalid_properties = []
243
+ if @signature_type.nil?
244
+ invalid_properties.push("invalid value for 'signature_type', signature_type cannot be nil.")
245
+ end
246
+
247
+ if @is_signature.nil?
248
+ invalid_properties.push("invalid value for 'is_signature', is_signature cannot be nil.")
249
+ end
250
+
251
+ if @created_on.nil?
252
+ invalid_properties.push("invalid value for 'created_on', created_on cannot be nil.")
253
+ end
254
+
255
+ if @modified_on.nil?
256
+ invalid_properties.push("invalid value for 'modified_on', modified_on cannot be nil.")
257
+ end
258
+
259
+ if @top.nil?
260
+ invalid_properties.push("invalid value for 'top', top cannot be nil.")
261
+ end
262
+
263
+ if @left.nil?
264
+ invalid_properties.push("invalid value for 'left', left cannot be nil.")
265
+ end
266
+
267
+ if @width.nil?
268
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
269
+ end
270
+
271
+ if @height.nil?
272
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
273
+ end
274
+
275
+ if @type.nil?
276
+ invalid_properties.push("invalid value for 'type', type cannot be nil.")
277
+ end
278
+
279
+ if @data_type.nil?
280
+ invalid_properties.push("invalid value for 'data_type', data_type cannot be nil.")
281
+ end
282
+
283
+ if @id.nil?
284
+ invalid_properties.push("invalid value for 'id', id cannot be nil.")
285
+ end
286
+
287
+ if @size.nil?
288
+ invalid_properties.push("invalid value for 'size', size cannot be nil.")
289
+ end
290
+
291
+ return invalid_properties
292
+ end
293
+
294
+ # Check to see if the all the properties in the model are valid
295
+ # @return true if the model is valid
296
+ def valid?
297
+ return false if @signature_type.nil?
298
+ signature_type_validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp", "FormField", "Metadata"])
299
+ return false unless signature_type_validator.valid?(@signature_type)
300
+ return false if @is_signature.nil?
301
+ return false if @created_on.nil?
302
+ return false if @modified_on.nil?
303
+ return false if @top.nil?
304
+ return false if @left.nil?
305
+ return false if @width.nil?
306
+ return false if @height.nil?
307
+ return false if @type.nil?
308
+ type_validator = EnumAttributeValidator.new('String', ["None", "Certificate", "Image", "Pdf", "Presentation", "Spreadsheet", "WordProcessing"])
309
+ return false unless type_validator.valid?(@type)
310
+ return false if @data_type.nil?
311
+ data_type_validator = EnumAttributeValidator.new('String', ["Undefined", "Boolean", "Integer", "Double", "DateTime", "String"])
312
+ return false unless data_type_validator.valid?(@data_type)
313
+ return false if @id.nil?
314
+ return false if @size.nil?
315
+ return true
316
+ end
317
+
318
+ # Custom attribute writer method checking allowed values (enum).
319
+ # @param [Object] signature_type Object to be assigned
320
+ def signature_type=(signature_type)
321
+ validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp", "FormField", "Metadata"])
322
+ if signature_type.to_i == 0
323
+ unless validator.valid?(signature_type)
324
+ raise ArgumentError, "invalid value for 'signature_type', must be one of #{validator.allowable_values}."
325
+ end
326
+ @signature_type = signature_type
327
+ else
328
+ @signature_type = validator.allowable_values[signature_type.to_i]
329
+ end
330
+ end
331
+
332
+ # Custom attribute writer method checking allowed values (enum).
333
+ # @param [Object] type Object to be assigned
334
+ def type=(type)
335
+ validator = EnumAttributeValidator.new('String', ["None", "Certificate", "Image", "Pdf", "Presentation", "Spreadsheet", "WordProcessing"])
336
+ if type.to_i == 0
337
+ unless validator.valid?(type)
338
+ raise ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
339
+ end
340
+ @type = type
341
+ else
342
+ @type = validator.allowable_values[type.to_i]
343
+ end
344
+ end
345
+
346
+ # Custom attribute writer method checking allowed values (enum).
347
+ # @param [Object] data_type Object to be assigned
348
+ def data_type=(data_type)
349
+ validator = EnumAttributeValidator.new('String', ["Undefined", "Boolean", "Integer", "Double", "DateTime", "String"])
350
+ if data_type.to_i == 0
351
+ unless validator.valid?(data_type)
352
+ raise ArgumentError, "invalid value for 'data_type', must be one of #{validator.allowable_values}."
353
+ end
354
+ @data_type = data_type
355
+ else
356
+ @data_type = validator.allowable_values[data_type.to_i]
357
+ end
358
+ end
359
+
360
+ # Checks equality by comparing each attribute.
361
+ # @param [Object] Object to be compared
362
+ def ==(other)
363
+ return true if self.equal?(other)
364
+ self.class == other.class &&
365
+ signature_type == other.signature_type &&
366
+ page_number == other.page_number &&
367
+ signature_id == other.signature_id &&
368
+ is_signature == other.is_signature &&
369
+ created_on == other.created_on &&
370
+ modified_on == other.modified_on &&
371
+ top == other.top &&
372
+ left == other.left &&
373
+ width == other.width &&
374
+ height == other.height &&
375
+ type == other.type &&
376
+ data_type == other.data_type &&
377
+ value == other.value &&
378
+ name == other.name &&
379
+ id == other.id &&
380
+ size == other.size &&
381
+ description == other.description &&
382
+ tag_prefix == other.tag_prefix
383
+ end
384
+
385
+ # @see the `==` method
386
+ # @param [Object] Object to be compared
387
+ def eql?(other)
388
+ self == other
389
+ end
390
+
391
+ # Calculates hash code according to all attributes.
392
+ # @return [Fixnum] Hash code
393
+ def hash
394
+ [signature_type, page_number, signature_id, is_signature, created_on, modified_on, top, left, width, height, type, data_type, value, name, id, size, description, tag_prefix].hash
395
+ end
396
+
397
+ # Downcases first letter.
398
+ # @return downcased string
399
+ def uncap(str)
400
+ str[0, 1].downcase + str[1..-1]
401
+ end
402
+
403
+ # Builds the object from hash
404
+ # @param [Hash] attributes Model attributes in the form of hash
405
+ # @return [Object] Returns the model itself
406
+ def build_from_hash(attributes)
407
+ return nil unless attributes.is_a?(Hash)
408
+ self.class.swagger_types.each_pair do |key, type|
409
+ pname = uncap(self.class.attribute_map[key]).intern
410
+ value = attributes[pname]
411
+ if type =~ /\AArray<(.*)>/i
412
+ # check to ensure the input is an array given that the the attribute
413
+ # is documented as an array but the input is not
414
+ if value.is_a?(Array)
415
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
416
+ end
417
+ elsif !value.nil?
418
+ self.send("#{key}=", _deserialize(type, value))
419
+ end
420
+ # or else data not found in attributes(hash), not an issue as the data can be optional
421
+ end
422
+
423
+ self
424
+ end
425
+
426
+ # Deserializes the data based on type
427
+ # @param string type Data type
428
+ # @param string value Value to be deserialized
429
+ # @return [Object] Deserialized data
430
+ def _deserialize(type, value)
431
+ case type.to_sym
432
+ when :DateTime
433
+ Date.parse value
434
+ when :Date
435
+ Date.parse value
436
+ when :String
437
+ value.to_s
438
+ when :Integer
439
+ value.to_i
440
+ when :Float
441
+ value.to_f
442
+ when :BOOLEAN
443
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
444
+ true
445
+ else
446
+ false
447
+ end
448
+ when :Object
449
+ # generic object (usually a Hash), return directly
450
+ value
451
+ when /\AArray<(?<inner_type>.+)>\z/
452
+ inner_type = Regexp.last_match[:inner_type]
453
+ value.map { |v| _deserialize(inner_type, v) }
454
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
455
+ k_type = Regexp.last_match[:k_type]
456
+ v_type = Regexp.last_match[:v_type]
457
+ {}.tap do |hash|
458
+ value.each do |k, v|
459
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
460
+ end
461
+ end
462
+ else
463
+ # model
464
+ # Signature type fix
465
+ ttype = type
466
+ if value.is_a?(Hash) and !value[:signatureType].nil?
467
+ ttype = value[:signatureType] + 'Signature'
468
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
469
+ type = value[:type]
470
+ if type == 'Checkbox'
471
+ ttype = 'CheckboxFormFieldSignature'
472
+ end
473
+ if type == 'Text'
474
+ ttype = 'TextFormFieldSignature'
475
+ end
476
+ if type == 'Combobox'
477
+ ttype = 'ComboboxFormFieldSignature'
478
+ end
479
+ if type == 'DigitalSignature'
480
+ ttype = 'DigitalFormFieldSignature'
481
+ end
482
+ if type == 'Radio'
483
+ ttype = 'RadioButtonFormFieldSignature'
484
+ end
485
+ end
486
+ end
487
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
488
+ temp_model.build_from_hash(value)
489
+ end
490
+ end
491
+
492
+ # Returns the string representation of the object
493
+ # @return [String] String presentation of the object
494
+ def to_s
495
+ to_hash.to_s
496
+ end
497
+
498
+ # to_body is an alias to to_hash (backward compatibility)
499
+ # @return [Hash] Returns the object in the form of hash
500
+ def to_body
501
+ to_hash
502
+ end
503
+
504
+ # Returns the object in the form of hash
505
+ # @return [Hash] Returns the object in the form of hash
506
+ def to_hash
507
+ hash = {}
508
+ self.class.attribute_map.each_pair do |attr, param|
509
+ value = self.send(attr)
510
+ next if value.nil?
511
+ hash[param] = _to_hash(value)
512
+ end
513
+ hash
514
+ end
515
+
516
+ # Outputs non-array value in the form of hash
517
+ # For object, use to_hash. Otherwise, just return the value
518
+ # @param [Object] value Any valid value
519
+ # @return [Hash] Returns the value in the form of hash
520
+ def _to_hash(value)
521
+ if value.is_a?(Array)
522
+ value.compact.map { |v| _to_hash(v) }
523
+ elsif value.is_a?(Hash)
524
+ {}.tap do |hash|
525
+ value.each { |k, v| hash[k] = _to_hash(v) }
526
+ end
527
+ elsif value.respond_to? :to_hash
528
+ value.to_hash
529
+ else
530
+ value
531
+ end
532
+ end
533
+
534
+ end
535
+
536
+ end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="object_exist.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="options_base.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="padding.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="page_info.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="pages_setup.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="pdf_digital_signature.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="pdf_digital_signature_appearance.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="pdf_text_annotation_appearance.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="pdf_text_sticker_appearance.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="preview_page.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="preview_result.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="preview_settings.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="qr_code_signature.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="qr_code_type.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="qr_codes_result.rb">
4
- # Copyright (c) 2003-2022 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy