groupdocs_signature_cloud 20.7 → 22.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  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 +169 -0
  6. data/lib/groupdocs_signature_cloud/api/preview_api.rb +217 -0
  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 +1 -1
  10. data/lib/groupdocs_signature_cloud/api_error.rb +18 -5
  11. data/lib/groupdocs_signature_cloud/configuration.rb +1 -1
  12. data/lib/groupdocs_signature_cloud/models/barcode_signature.rb +21 -3
  13. data/lib/groupdocs_signature_cloud/models/barcode_type.rb +19 -1
  14. data/lib/groupdocs_signature_cloud/models/barcodes_result.rb +19 -1
  15. data/lib/groupdocs_signature_cloud/models/base_settings.rb +19 -1
  16. data/lib/groupdocs_signature_cloud/models/border_line.rb +19 -1
  17. data/lib/groupdocs_signature_cloud/models/brush.rb +19 -1
  18. data/lib/groupdocs_signature_cloud/models/checkbox_form_field_signature.rb +460 -0
  19. data/lib/groupdocs_signature_cloud/models/color.rb +38 -5
  20. data/lib/groupdocs_signature_cloud/models/combobox_form_field_signature.rb +467 -0
  21. data/lib/groupdocs_signature_cloud/models/consumption_result.rb +257 -0
  22. data/lib/groupdocs_signature_cloud/models/delete_options.rb +21 -3
  23. data/lib/groupdocs_signature_cloud/models/delete_result.rb +20 -2
  24. data/lib/groupdocs_signature_cloud/models/delete_settings.rb +19 -1
  25. data/lib/groupdocs_signature_cloud/models/digital_form_field_signature.rb +460 -0
  26. data/lib/groupdocs_signature_cloud/models/digital_signature.rb +35 -7
  27. data/lib/groupdocs_signature_cloud/models/digital_signature_appearance.rb +309 -0
  28. data/lib/groupdocs_signature_cloud/models/disc_usage.rb +19 -1
  29. data/lib/groupdocs_signature_cloud/models/error.rb +19 -1
  30. data/lib/groupdocs_signature_cloud/models/error_details.rb +19 -1
  31. data/lib/groupdocs_signature_cloud/models/file_info.rb +19 -1
  32. data/lib/groupdocs_signature_cloud/models/file_version.rb +19 -1
  33. data/lib/groupdocs_signature_cloud/models/file_versions.rb +19 -1
  34. data/lib/groupdocs_signature_cloud/models/files_list.rb +19 -1
  35. data/lib/groupdocs_signature_cloud/models/files_upload_result.rb +19 -1
  36. data/lib/groupdocs_signature_cloud/models/form_field_signature.rb +445 -0
  37. data/lib/groupdocs_signature_cloud/models/format.rb +19 -1
  38. data/lib/groupdocs_signature_cloud/models/formats_result.rb +19 -1
  39. data/lib/groupdocs_signature_cloud/models/image_appearance.rb +339 -0
  40. data/lib/groupdocs_signature_cloud/models/image_signature.rb +21 -3
  41. data/lib/groupdocs_signature_cloud/models/info_result.rb +36 -6
  42. data/lib/groupdocs_signature_cloud/models/info_settings.rb +38 -5
  43. data/lib/groupdocs_signature_cloud/models/linear_gradient_brush.rb +19 -1
  44. data/lib/groupdocs_signature_cloud/models/object_exist.rb +19 -1
  45. data/lib/groupdocs_signature_cloud/models/options_base.rb +21 -3
  46. data/lib/groupdocs_signature_cloud/models/padding.rb +19 -1
  47. data/lib/groupdocs_signature_cloud/models/page_info.rb +19 -1
  48. data/lib/groupdocs_signature_cloud/models/pages_setup.rb +19 -1
  49. data/lib/groupdocs_signature_cloud/models/pdf_digital_signature.rb +339 -0
  50. data/lib/groupdocs_signature_cloud/models/pdf_digital_signature_appearance.rb +359 -0
  51. data/lib/groupdocs_signature_cloud/models/pdf_text_annotation_appearance.rb +395 -0
  52. data/lib/groupdocs_signature_cloud/models/pdf_text_sticker_appearance.rb +355 -0
  53. data/lib/groupdocs_signature_cloud/models/preview_page.rb +277 -0
  54. data/lib/groupdocs_signature_cloud/models/preview_result.rb +279 -0
  55. data/lib/groupdocs_signature_cloud/models/preview_settings.rb +356 -0
  56. data/lib/groupdocs_signature_cloud/models/qr_code_signature.rb +21 -3
  57. data/lib/groupdocs_signature_cloud/models/qr_code_type.rb +19 -1
  58. data/lib/groupdocs_signature_cloud/models/qr_codes_result.rb +19 -1
  59. data/lib/groupdocs_signature_cloud/models/radial_gradient_brush.rb +19 -1
  60. data/lib/groupdocs_signature_cloud/models/radio_button_form_field_signature.rb +467 -0
  61. data/lib/groupdocs_signature_cloud/models/save_options.rb +19 -1
  62. data/lib/groupdocs_signature_cloud/models/search_barcode_options.rb +21 -3
  63. data/lib/groupdocs_signature_cloud/models/search_digital_options.rb +21 -3
  64. data/lib/groupdocs_signature_cloud/models/search_options.rb +21 -3
  65. data/lib/groupdocs_signature_cloud/models/search_qr_code_options.rb +21 -3
  66. data/lib/groupdocs_signature_cloud/models/search_result.rb +19 -1
  67. data/lib/groupdocs_signature_cloud/models/search_settings.rb +19 -1
  68. data/lib/groupdocs_signature_cloud/models/sign_barcode_options.rb +47 -4
  69. data/lib/groupdocs_signature_cloud/models/sign_digital_options.rb +32 -4
  70. data/lib/groupdocs_signature_cloud/models/sign_image_options.rb +32 -4
  71. data/lib/groupdocs_signature_cloud/models/sign_options.rb +35 -7
  72. data/lib/groupdocs_signature_cloud/models/sign_qr_code_options.rb +47 -4
  73. data/lib/groupdocs_signature_cloud/models/sign_result.rb +20 -2
  74. data/lib/groupdocs_signature_cloud/models/sign_settings.rb +19 -1
  75. data/lib/groupdocs_signature_cloud/models/sign_stamp_options.rb +32 -4
  76. data/lib/groupdocs_signature_cloud/models/sign_text_options.rb +50 -7
  77. data/lib/groupdocs_signature_cloud/models/signature.rb +21 -3
  78. data/lib/groupdocs_signature_cloud/models/signature_appearance.rb +279 -0
  79. data/lib/groupdocs_signature_cloud/models/signature_font.rb +19 -1
  80. data/lib/groupdocs_signature_cloud/models/solid_brush.rb +19 -1
  81. data/lib/groupdocs_signature_cloud/models/stamp_line.rb +19 -1
  82. data/lib/groupdocs_signature_cloud/models/storage_exist.rb +19 -1
  83. data/lib/groupdocs_signature_cloud/models/storage_file.rb +19 -1
  84. data/lib/groupdocs_signature_cloud/models/text_form_field_signature.rb +455 -0
  85. data/lib/groupdocs_signature_cloud/models/text_signature.rb +21 -3
  86. data/lib/groupdocs_signature_cloud/models/texture_brush.rb +19 -1
  87. data/lib/groupdocs_signature_cloud/models/time_stamp.rb +257 -0
  88. data/lib/groupdocs_signature_cloud/models/update_options.rb +21 -3
  89. data/lib/groupdocs_signature_cloud/models/update_result.rb +20 -2
  90. data/lib/groupdocs_signature_cloud/models/update_settings.rb +19 -1
  91. data/lib/groupdocs_signature_cloud/models/verify_barcode_options.rb +21 -3
  92. data/lib/groupdocs_signature_cloud/models/verify_digital_options.rb +21 -3
  93. data/lib/groupdocs_signature_cloud/models/verify_options.rb +21 -3
  94. data/lib/groupdocs_signature_cloud/models/verify_qr_code_options.rb +21 -3
  95. data/lib/groupdocs_signature_cloud/models/verify_result.rb +20 -2
  96. data/lib/groupdocs_signature_cloud/models/verify_settings.rb +19 -1
  97. data/lib/groupdocs_signature_cloud/models/verify_text_options.rb +21 -3
  98. data/lib/groupdocs_signature_cloud/version.rb +2 -2
  99. data/lib/groupdocs_signature_cloud.rb +21 -1
  100. metadata +26 -20
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="color.rb">
4
- # Copyright (c) 2003-2020 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2022 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -34,17 +34,22 @@ module GroupDocsSignatureCloud
34
34
  # HTML string color representation
35
35
  attr_accessor :web
36
36
 
37
+ # Alpha component of color structure
38
+ attr_accessor :alpha
39
+
37
40
  # Attribute mapping from ruby-style variable name to JSON key.
38
41
  def self.attribute_map
39
42
  {
40
- :'web' => :'Web'
43
+ :'web' => :'Web',
44
+ :'alpha' => :'Alpha'
41
45
  }
42
46
  end
43
47
 
44
48
  # Attribute type mapping.
45
49
  def self.swagger_types
46
50
  {
47
- :'web' => :'String'
51
+ :'web' => :'String',
52
+ :'alpha' => :'Integer'
48
53
  }
49
54
  end
50
55
 
@@ -60,18 +65,27 @@ module GroupDocsSignatureCloud
60
65
  self.web = attributes[:'Web']
61
66
  end
62
67
 
68
+ if attributes.key?(:'Alpha')
69
+ self.alpha = attributes[:'Alpha']
70
+ end
71
+
63
72
  end
64
73
 
65
74
  # Show invalid properties with the reasons. Usually used together with valid?
66
75
  # @return Array for valid properies with the reasons
67
76
  def list_invalid_properties
68
77
  invalid_properties = []
78
+ if @alpha.nil?
79
+ invalid_properties.push("invalid value for 'alpha', alpha cannot be nil.")
80
+ end
81
+
69
82
  return invalid_properties
70
83
  end
71
84
 
72
85
  # Check to see if the all the properties in the model are valid
73
86
  # @return true if the model is valid
74
87
  def valid?
88
+ return false if @alpha.nil?
75
89
  return true
76
90
  end
77
91
 
@@ -80,7 +94,8 @@ module GroupDocsSignatureCloud
80
94
  def ==(other)
81
95
  return true if self.equal?(other)
82
96
  self.class == other.class &&
83
- web == other.web
97
+ web == other.web &&
98
+ alpha == other.alpha
84
99
  end
85
100
 
86
101
  # @see the `==` method
@@ -92,7 +107,7 @@ module GroupDocsSignatureCloud
92
107
  # Calculates hash code according to all attributes.
93
108
  # @return [Fixnum] Hash code
94
109
  def hash
95
- [web].hash
110
+ [web, alpha].hash
96
111
  end
97
112
 
98
113
  # Downcases first letter.
@@ -166,6 +181,24 @@ module GroupDocsSignatureCloud
166
181
  ttype = type
167
182
  if value.is_a?(Hash) and !value[:signatureType].nil?
168
183
  ttype = value[:signatureType] + 'Signature'
184
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
185
+ type = value[:type]
186
+ if type == 'Checkbox'
187
+ ttype = 'CheckboxFormFieldSignature'
188
+ end
189
+ if type == 'Text'
190
+ ttype = 'TextFormFieldSignature'
191
+ end
192
+ if type == 'Combobox'
193
+ ttype = 'ComboboxFormFieldSignature'
194
+ end
195
+ if type == 'DigitalSignature'
196
+ ttype = 'DigitalFormFieldSignature'
197
+ end
198
+ if type == 'Radio'
199
+ ttype = 'RadioButtonFormFieldSignature'
200
+ end
201
+ end
169
202
  end
170
203
  temp_model = GroupDocsSignatureCloud.const_get(ttype).new
171
204
  temp_model.build_from_hash(value)
@@ -0,0 +1,467 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="combobox_form_field_signature.rb">
4
+ # Copyright (c) 2003-2022 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