groupdocs_signature_cloud 19.5 → 20.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_signature_cloud.rb +9 -1
  3. data/lib/groupdocs_signature_cloud/api/file_api.rb +7 -7
  4. data/lib/groupdocs_signature_cloud/api/folder_api.rb +7 -7
  5. data/lib/groupdocs_signature_cloud/api/info_api.rb +2 -2
  6. data/lib/groupdocs_signature_cloud/api/sign_api.rb +198 -4
  7. data/lib/groupdocs_signature_cloud/api/storage_api.rb +5 -5
  8. data/lib/groupdocs_signature_cloud/api_client.rb +1 -1
  9. data/lib/groupdocs_signature_cloud/api_error.rb +1 -1
  10. data/lib/groupdocs_signature_cloud/configuration.rb +1 -1
  11. data/lib/groupdocs_signature_cloud/models/barcode_signature.rb +140 -36
  12. data/lib/groupdocs_signature_cloud/models/barcode_type.rb +1 -1
  13. data/lib/groupdocs_signature_cloud/models/barcodes_result.rb +1 -1
  14. data/lib/groupdocs_signature_cloud/models/base_settings.rb +1 -1
  15. data/lib/groupdocs_signature_cloud/models/border_line.rb +22 -7
  16. data/lib/groupdocs_signature_cloud/models/brush.rb +1 -1
  17. data/lib/groupdocs_signature_cloud/models/color.rb +1 -1
  18. data/lib/groupdocs_signature_cloud/models/delete_options.rb +271 -0
  19. data/lib/groupdocs_signature_cloud/models/delete_result.rb +258 -0
  20. data/lib/groupdocs_signature_cloud/models/delete_settings.rb +231 -0
  21. data/lib/groupdocs_signature_cloud/models/digital_signature.rb +127 -64
  22. data/lib/groupdocs_signature_cloud/models/disc_usage.rb +1 -1
  23. data/lib/groupdocs_signature_cloud/models/error.rb +1 -1
  24. data/lib/groupdocs_signature_cloud/models/error_details.rb +1 -1
  25. data/lib/groupdocs_signature_cloud/models/file_info.rb +1 -1
  26. data/lib/groupdocs_signature_cloud/models/file_version.rb +1 -1
  27. data/lib/groupdocs_signature_cloud/models/file_versions.rb +1 -1
  28. data/lib/groupdocs_signature_cloud/models/files_list.rb +1 -1
  29. data/lib/groupdocs_signature_cloud/models/files_upload_result.rb +1 -1
  30. data/lib/groupdocs_signature_cloud/models/format.rb +1 -1
  31. data/lib/groupdocs_signature_cloud/models/formats_result.rb +1 -1
  32. data/lib/groupdocs_signature_cloud/models/image_signature.rb +411 -0
  33. data/lib/groupdocs_signature_cloud/models/info_result.rb +1 -1
  34. data/lib/groupdocs_signature_cloud/models/info_settings.rb +1 -1
  35. data/lib/groupdocs_signature_cloud/models/linear_gradient_brush.rb +1 -1
  36. data/lib/groupdocs_signature_cloud/models/object_exist.rb +1 -1
  37. data/lib/groupdocs_signature_cloud/models/options_base.rb +2 -33
  38. data/lib/groupdocs_signature_cloud/models/padding.rb +1 -1
  39. data/lib/groupdocs_signature_cloud/models/page_info.rb +1 -1
  40. data/lib/groupdocs_signature_cloud/models/pages_setup.rb +1 -1
  41. data/lib/groupdocs_signature_cloud/models/qr_code_signature.rb +140 -36
  42. data/lib/groupdocs_signature_cloud/models/qr_code_type.rb +1 -1
  43. data/lib/groupdocs_signature_cloud/models/qr_codes_result.rb +1 -1
  44. data/lib/groupdocs_signature_cloud/models/radial_gradient_brush.rb +1 -1
  45. data/lib/groupdocs_signature_cloud/models/save_options.rb +1 -1
  46. data/lib/groupdocs_signature_cloud/models/search_barcode_options.rb +2 -33
  47. data/lib/groupdocs_signature_cloud/models/search_digital_options.rb +2 -33
  48. data/lib/groupdocs_signature_cloud/models/search_options.rb +2 -33
  49. data/lib/groupdocs_signature_cloud/models/search_qr_code_options.rb +2 -33
  50. data/lib/groupdocs_signature_cloud/models/search_result.rb +1 -1
  51. data/lib/groupdocs_signature_cloud/models/search_settings.rb +1 -1
  52. data/lib/groupdocs_signature_cloud/models/sign_barcode_options.rb +33 -125
  53. data/lib/groupdocs_signature_cloud/models/sign_digital_options.rb +114 -59
  54. data/lib/groupdocs_signature_cloud/models/sign_image_options.rb +32 -53
  55. data/lib/groupdocs_signature_cloud/models/sign_options.rb +2 -33
  56. data/lib/groupdocs_signature_cloud/models/sign_qr_code_options.rb +42 -134
  57. data/lib/groupdocs_signature_cloud/models/sign_result.rb +29 -5
  58. data/lib/groupdocs_signature_cloud/models/sign_settings.rb +1 -1
  59. data/lib/groupdocs_signature_cloud/models/sign_stamp_options.rb +32 -53
  60. data/lib/groupdocs_signature_cloud/models/sign_text_options.rb +31 -108
  61. data/lib/groupdocs_signature_cloud/models/signature.rb +130 -36
  62. data/lib/groupdocs_signature_cloud/models/signature_font.rb +1 -1
  63. data/lib/groupdocs_signature_cloud/models/solid_brush.rb +1 -1
  64. data/lib/groupdocs_signature_cloud/models/stamp_line.rb +1 -1
  65. data/lib/groupdocs_signature_cloud/models/storage_exist.rb +1 -1
  66. data/lib/groupdocs_signature_cloud/models/storage_file.rb +1 -1
  67. data/lib/groupdocs_signature_cloud/models/text_signature.rb +406 -0
  68. data/lib/groupdocs_signature_cloud/models/texture_brush.rb +9 -9
  69. data/lib/groupdocs_signature_cloud/models/update_options.rb +356 -0
  70. data/lib/groupdocs_signature_cloud/models/update_result.rb +258 -0
  71. data/lib/groupdocs_signature_cloud/models/update_settings.rb +231 -0
  72. data/lib/groupdocs_signature_cloud/models/verify_barcode_options.rb +2 -33
  73. data/lib/groupdocs_signature_cloud/models/verify_digital_options.rb +8 -39
  74. data/lib/groupdocs_signature_cloud/models/verify_options.rb +2 -33
  75. data/lib/groupdocs_signature_cloud/models/verify_qr_code_options.rb +2 -33
  76. data/lib/groupdocs_signature_cloud/models/verify_result.rb +1 -1
  77. data/lib/groupdocs_signature_cloud/models/verify_settings.rb +1 -1
  78. data/lib/groupdocs_signature_cloud/models/verify_text_options.rb +2 -33
  79. data/lib/groupdocs_signature_cloud/version.rb +2 -2
  80. metadata +10 -2
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="texture_brush.rb">
4
- # Copyright (c) 2003-2019 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2020 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,14 +34,14 @@ module GroupDocsSignatureCloud
34
34
  # Internal property that specify the current brush type
35
35
  attr_accessor :brush_type
36
36
 
37
- # Gets or sets the texture image file Guid
38
- attr_accessor :image_guid
37
+ # Gets or sets the texture image file path
38
+ attr_accessor :image_file_path
39
39
 
40
40
  # Attribute mapping from ruby-style variable name to JSON key.
41
41
  def self.attribute_map
42
42
  {
43
43
  :'brush_type' => :'BrushType',
44
- :'image_guid' => :'ImageGuid'
44
+ :'image_file_path' => :'ImageFilePath'
45
45
  }
46
46
  end
47
47
 
@@ -49,7 +49,7 @@ module GroupDocsSignatureCloud
49
49
  def self.swagger_types
50
50
  {
51
51
  :'brush_type' => :'String',
52
- :'image_guid' => :'String'
52
+ :'image_file_path' => :'String'
53
53
  }
54
54
  end
55
55
 
@@ -65,8 +65,8 @@ module GroupDocsSignatureCloud
65
65
  self.brush_type = attributes[:'BrushType']
66
66
  end
67
67
 
68
- if attributes.key?(:'ImageGuid')
69
- self.image_guid = attributes[:'ImageGuid']
68
+ if attributes.key?(:'ImageFilePath')
69
+ self.image_file_path = attributes[:'ImageFilePath']
70
70
  end
71
71
 
72
72
  end
@@ -90,7 +90,7 @@ module GroupDocsSignatureCloud
90
90
  return true if self.equal?(other)
91
91
  self.class == other.class &&
92
92
  brush_type == other.brush_type &&
93
- image_guid == other.image_guid
93
+ image_file_path == other.image_file_path
94
94
  end
95
95
 
96
96
  # @see the `==` method
@@ -102,7 +102,7 @@ module GroupDocsSignatureCloud
102
102
  # Calculates hash code according to all attributes.
103
103
  # @return [Fixnum] Hash code
104
104
  def hash
105
- [brush_type, image_guid].hash
105
+ [brush_type, image_file_path].hash
106
106
  end
107
107
 
108
108
  # Downcases first letter.
@@ -0,0 +1,356 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="update_options.rb">
4
+ # Copyright (c) 2003-2020 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
+ # Base container class for update signature options
32
+ class UpdateOptions
33
+
34
+ # Specifies the type of signature
35
+ attr_accessor :signature_type
36
+
37
+ # 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.
38
+ attr_accessor :signature_id
39
+
40
+ # Specifies left position of signature
41
+ attr_accessor :left
42
+
43
+ # Specifies top position of signature
44
+ attr_accessor :top
45
+
46
+ # Specifies width of signature
47
+ attr_accessor :width
48
+
49
+ # Specifies height of signature
50
+ attr_accessor :height
51
+
52
+ # 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).
53
+ attr_accessor :is_signature
54
+
55
+ # The text to update text signature
56
+ attr_accessor :text
57
+ class EnumAttributeValidator
58
+ attr_reader :datatype
59
+ attr_reader :allowable_values
60
+
61
+ def initialize(datatype, allowable_values)
62
+ @allowable_values = allowable_values.map do |value|
63
+ case datatype.to_s
64
+ when /Integer/i
65
+ value.to_i
66
+ when /Float/i
67
+ value.to_f
68
+ else
69
+ value
70
+ end
71
+ end
72
+ end
73
+
74
+ def valid?(value)
75
+ !value || allowable_values.include?(value)
76
+ end
77
+ end
78
+
79
+ # Attribute mapping from ruby-style variable name to JSON key.
80
+ def self.attribute_map
81
+ {
82
+ :'signature_type' => :'SignatureType',
83
+ :'signature_id' => :'SignatureId',
84
+ :'left' => :'Left',
85
+ :'top' => :'Top',
86
+ :'width' => :'Width',
87
+ :'height' => :'Height',
88
+ :'is_signature' => :'IsSignature',
89
+ :'text' => :'Text'
90
+ }
91
+ end
92
+
93
+ # Attribute type mapping.
94
+ def self.swagger_types
95
+ {
96
+ :'signature_type' => :'String',
97
+ :'signature_id' => :'String',
98
+ :'left' => :'Integer',
99
+ :'top' => :'Integer',
100
+ :'width' => :'Integer',
101
+ :'height' => :'Integer',
102
+ :'is_signature' => :'BOOLEAN',
103
+ :'text' => :'String'
104
+ }
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ return unless attributes.is_a?(Hash)
111
+
112
+ # convert string to symbol for hash key
113
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
114
+
115
+ if attributes.key?(:'SignatureType')
116
+ self.signature_type = attributes[:'SignatureType']
117
+ end
118
+
119
+ if attributes.key?(:'SignatureId')
120
+ self.signature_id = attributes[:'SignatureId']
121
+ end
122
+
123
+ if attributes.key?(:'Left')
124
+ self.left = attributes[:'Left']
125
+ end
126
+
127
+ if attributes.key?(:'Top')
128
+ self.top = attributes[:'Top']
129
+ end
130
+
131
+ if attributes.key?(:'Width')
132
+ self.width = attributes[:'Width']
133
+ end
134
+
135
+ if attributes.key?(:'Height')
136
+ self.height = attributes[:'Height']
137
+ end
138
+
139
+ if attributes.key?(:'IsSignature')
140
+ self.is_signature = attributes[:'IsSignature']
141
+ end
142
+
143
+ if attributes.key?(:'Text')
144
+ self.text = attributes[:'Text']
145
+ end
146
+
147
+ end
148
+
149
+ # Show invalid properties with the reasons. Usually used together with valid?
150
+ # @return Array for valid properies with the reasons
151
+ def list_invalid_properties
152
+ invalid_properties = []
153
+ if @signature_type.nil?
154
+ invalid_properties.push("invalid value for 'signature_type', signature_type cannot be nil.")
155
+ end
156
+
157
+ if @left.nil?
158
+ invalid_properties.push("invalid value for 'left', left cannot be nil.")
159
+ end
160
+
161
+ if @top.nil?
162
+ invalid_properties.push("invalid value for 'top', top cannot be nil.")
163
+ end
164
+
165
+ if @width.nil?
166
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
167
+ end
168
+
169
+ if @height.nil?
170
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
171
+ end
172
+
173
+ if @is_signature.nil?
174
+ invalid_properties.push("invalid value for 'is_signature', is_signature cannot be nil.")
175
+ end
176
+
177
+ return invalid_properties
178
+ end
179
+
180
+ # Check to see if the all the properties in the model are valid
181
+ # @return true if the model is valid
182
+ def valid?
183
+ return false if @signature_type.nil?
184
+ signature_type_validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp"])
185
+ return false unless signature_type_validator.valid?(@signature_type)
186
+ return false if @left.nil?
187
+ return false if @top.nil?
188
+ return false if @width.nil?
189
+ return false if @height.nil?
190
+ return false if @is_signature.nil?
191
+ return true
192
+ end
193
+
194
+ # Custom attribute writer method checking allowed values (enum).
195
+ # @param [Object] signature_type Object to be assigned
196
+ def signature_type=(signature_type)
197
+ validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp"])
198
+ if signature_type.to_i == 0
199
+ unless validator.valid?(signature_type)
200
+ raise ArgumentError, "invalid value for 'signature_type', must be one of #{validator.allowable_values}."
201
+ end
202
+ @signature_type = signature_type
203
+ else
204
+ @signature_type = validator.allowable_values[signature_type.to_i]
205
+ end
206
+ end
207
+
208
+ # Checks equality by comparing each attribute.
209
+ # @param [Object] Object to be compared
210
+ def ==(other)
211
+ return true if self.equal?(other)
212
+ self.class == other.class &&
213
+ signature_type == other.signature_type &&
214
+ signature_id == other.signature_id &&
215
+ left == other.left &&
216
+ top == other.top &&
217
+ width == other.width &&
218
+ height == other.height &&
219
+ is_signature == other.is_signature &&
220
+ text == other.text
221
+ end
222
+
223
+ # @see the `==` method
224
+ # @param [Object] Object to be compared
225
+ def eql?(other)
226
+ self == other
227
+ end
228
+
229
+ # Calculates hash code according to all attributes.
230
+ # @return [Fixnum] Hash code
231
+ def hash
232
+ [signature_type, signature_id, left, top, width, height, is_signature, text].hash
233
+ end
234
+
235
+ # Downcases first letter.
236
+ # @return downcased string
237
+ def uncap(str)
238
+ str[0, 1].downcase + str[1..-1]
239
+ end
240
+
241
+ # Builds the object from hash
242
+ # @param [Hash] attributes Model attributes in the form of hash
243
+ # @return [Object] Returns the model itself
244
+ def build_from_hash(attributes)
245
+ return nil unless attributes.is_a?(Hash)
246
+ self.class.swagger_types.each_pair do |key, type|
247
+ pname = uncap(self.class.attribute_map[key]).intern
248
+ value = attributes[pname]
249
+ if type =~ /\AArray<(.*)>/i
250
+ # check to ensure the input is an array given that the the attribute
251
+ # is documented as an array but the input is not
252
+ if value.is_a?(Array)
253
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
254
+ end
255
+ elsif !value.nil?
256
+ self.send("#{key}=", _deserialize(type, value))
257
+ end
258
+ # or else data not found in attributes(hash), not an issue as the data can be optional
259
+ end
260
+
261
+ self
262
+ end
263
+
264
+ # Deserializes the data based on type
265
+ # @param string type Data type
266
+ # @param string value Value to be deserialized
267
+ # @return [Object] Deserialized data
268
+ def _deserialize(type, value)
269
+ case type.to_sym
270
+ when :DateTime
271
+ Date.parse value
272
+ when :Date
273
+ Date.parse value
274
+ when :String
275
+ value.to_s
276
+ when :Integer
277
+ value.to_i
278
+ when :Float
279
+ value.to_f
280
+ when :BOOLEAN
281
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
282
+ true
283
+ else
284
+ false
285
+ end
286
+ when :Object
287
+ # generic object (usually a Hash), return directly
288
+ value
289
+ when /\AArray<(?<inner_type>.+)>\z/
290
+ inner_type = Regexp.last_match[:inner_type]
291
+ value.map { |v| _deserialize(inner_type, v) }
292
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
293
+ k_type = Regexp.last_match[:k_type]
294
+ v_type = Regexp.last_match[:v_type]
295
+ {}.tap do |hash|
296
+ value.each do |k, v|
297
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
298
+ end
299
+ end
300
+ else
301
+ # model
302
+ # Signature type fix
303
+ ttype = type
304
+ if value.is_a?(Hash) and !value[:signatureType].nil?
305
+ ttype = value[:signatureType] + 'Signature'
306
+ end
307
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
308
+ temp_model.build_from_hash(value)
309
+ end
310
+ end
311
+
312
+ # Returns the string representation of the object
313
+ # @return [String] String presentation of the object
314
+ def to_s
315
+ to_hash.to_s
316
+ end
317
+
318
+ # to_body is an alias to to_hash (backward compatibility)
319
+ # @return [Hash] Returns the object in the form of hash
320
+ def to_body
321
+ to_hash
322
+ end
323
+
324
+ # Returns the object in the form of hash
325
+ # @return [Hash] Returns the object in the form of hash
326
+ def to_hash
327
+ hash = {}
328
+ self.class.attribute_map.each_pair do |attr, param|
329
+ value = self.send(attr)
330
+ next if value.nil?
331
+ hash[param] = _to_hash(value)
332
+ end
333
+ hash
334
+ end
335
+
336
+ # Outputs non-array value in the form of hash
337
+ # For object, use to_hash. Otherwise, just return the value
338
+ # @param [Object] value Any valid value
339
+ # @return [Hash] Returns the value in the form of hash
340
+ def _to_hash(value)
341
+ if value.is_a?(Array)
342
+ value.compact.map { |v| _to_hash(v) }
343
+ elsif value.is_a?(Hash)
344
+ {}.tap do |hash|
345
+ value.each { |k, v| hash[k] = _to_hash(v) }
346
+ end
347
+ elsif value.respond_to? :to_hash
348
+ value.to_hash
349
+ else
350
+ value
351
+ end
352
+ end
353
+
354
+ end
355
+
356
+ end
@@ -0,0 +1,258 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="update_result.rb">
4
+ # Copyright (c) 2003-2020 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
+ # Update result information
32
+ class UpdateResult
33
+
34
+ # Source document basic info
35
+ attr_accessor :file_info
36
+
37
+ # Source document size in bytes
38
+ attr_accessor :size
39
+
40
+ # List of successfully modified signatures
41
+ attr_accessor :succeeded
42
+
43
+ # List of signatures that were not updated
44
+ attr_accessor :failed
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'file_info' => :'FileInfo',
50
+ :'size' => :'Size',
51
+ :'succeeded' => :'Succeeded',
52
+ :'failed' => :'Failed'
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+ :'file_info' => :'FileInfo',
60
+ :'size' => :'Integer',
61
+ :'succeeded' => :'Array<Signature>',
62
+ :'failed' => :'Array<Signature>'
63
+ }
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
+
74
+ if attributes.key?(:'FileInfo')
75
+ self.file_info = attributes[:'FileInfo']
76
+ end
77
+
78
+ if attributes.key?(:'Size')
79
+ self.size = attributes[:'Size']
80
+ end
81
+
82
+ if attributes.key?(:'Succeeded')
83
+ if (value = attributes[:'Succeeded']).is_a?(Array)
84
+ self.succeeded = value
85
+ end
86
+ end
87
+
88
+ if attributes.key?(:'Failed')
89
+ if (value = attributes[:'Failed']).is_a?(Array)
90
+ self.failed = value
91
+ end
92
+ end
93
+
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properies with the reasons
98
+ def list_invalid_properties
99
+ invalid_properties = []
100
+ if @size.nil?
101
+ invalid_properties.push("invalid value for 'size', size cannot be nil.")
102
+ end
103
+
104
+ return invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ return false if @size.nil?
111
+ return true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(other)
117
+ return true if self.equal?(other)
118
+ self.class == other.class &&
119
+ file_info == other.file_info &&
120
+ size == other.size &&
121
+ succeeded == other.succeeded &&
122
+ failed == other.failed
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(other)
128
+ self == other
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Fixnum] Hash code
133
+ def hash
134
+ [file_info, size, succeeded, failed].hash
135
+ end
136
+
137
+ # Downcases first letter.
138
+ # @return downcased string
139
+ def uncap(str)
140
+ str[0, 1].downcase + str[1..-1]
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ self.class.swagger_types.each_pair do |key, type|
149
+ pname = uncap(self.class.attribute_map[key]).intern
150
+ value = attributes[pname]
151
+ if type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the the attribute
153
+ # is documented as an array but the input is not
154
+ if value.is_a?(Array)
155
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
156
+ end
157
+ elsif !value.nil?
158
+ self.send("#{key}=", _deserialize(type, value))
159
+ end
160
+ # or else data not found in attributes(hash), not an issue as the data can be optional
161
+ end
162
+
163
+ self
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def _deserialize(type, value)
171
+ case type.to_sym
172
+ when :DateTime
173
+ Date.parse value
174
+ when :Date
175
+ Date.parse value
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :BOOLEAN
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else
203
+ # model
204
+ # Signature type fix
205
+ ttype = type
206
+ if value.is_a?(Hash) and !value[:signatureType].nil?
207
+ ttype = value[:signatureType] + 'Signature'
208
+ end
209
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
210
+ temp_model.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ next if value.nil?
233
+ hash[param] = _to_hash(value)
234
+ end
235
+ hash
236
+ end
237
+
238
+ # Outputs non-array value in the form of hash
239
+ # For object, use to_hash. Otherwise, just return the value
240
+ # @param [Object] value Any valid value
241
+ # @return [Hash] Returns the value in the form of hash
242
+ def _to_hash(value)
243
+ if value.is_a?(Array)
244
+ value.compact.map { |v| _to_hash(v) }
245
+ elsif value.is_a?(Hash)
246
+ {}.tap do |hash|
247
+ value.each { |k, v| hash[k] = _to_hash(v) }
248
+ end
249
+ elsif value.respond_to? :to_hash
250
+ value.to_hash
251
+ else
252
+ value
253
+ end
254
+ end
255
+
256
+ end
257
+
258
+ end