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