groupdocs_signature_cloud 21.5 → 21.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_signature_cloud/models/barcode_signature.rb +20 -2
  3. data/lib/groupdocs_signature_cloud/models/barcode_type.rb +18 -0
  4. data/lib/groupdocs_signature_cloud/models/barcodes_result.rb +18 -0
  5. data/lib/groupdocs_signature_cloud/models/base_settings.rb +18 -0
  6. data/lib/groupdocs_signature_cloud/models/border_line.rb +18 -0
  7. data/lib/groupdocs_signature_cloud/models/brush.rb +18 -0
  8. data/lib/groupdocs_signature_cloud/models/checkbox_form_field_signature.rb +460 -0
  9. data/lib/groupdocs_signature_cloud/models/color.rb +18 -0
  10. data/lib/groupdocs_signature_cloud/models/combobox_form_field_signature.rb +467 -0
  11. data/lib/groupdocs_signature_cloud/models/delete_options.rb +20 -2
  12. data/lib/groupdocs_signature_cloud/models/delete_result.rb +18 -0
  13. data/lib/groupdocs_signature_cloud/models/delete_settings.rb +18 -0
  14. data/lib/groupdocs_signature_cloud/models/digital_form_field_signature.rb +460 -0
  15. data/lib/groupdocs_signature_cloud/models/digital_signature.rb +20 -2
  16. data/lib/groupdocs_signature_cloud/models/digital_signature_appearance.rb +309 -0
  17. data/lib/groupdocs_signature_cloud/models/disc_usage.rb +18 -0
  18. data/lib/groupdocs_signature_cloud/models/error.rb +18 -0
  19. data/lib/groupdocs_signature_cloud/models/error_details.rb +18 -0
  20. data/lib/groupdocs_signature_cloud/models/file_info.rb +18 -0
  21. data/lib/groupdocs_signature_cloud/models/file_version.rb +18 -0
  22. data/lib/groupdocs_signature_cloud/models/file_versions.rb +18 -0
  23. data/lib/groupdocs_signature_cloud/models/files_list.rb +18 -0
  24. data/lib/groupdocs_signature_cloud/models/files_upload_result.rb +18 -0
  25. data/lib/groupdocs_signature_cloud/models/form_field_signature.rb +445 -0
  26. data/lib/groupdocs_signature_cloud/models/format.rb +18 -0
  27. data/lib/groupdocs_signature_cloud/models/formats_result.rb +18 -0
  28. data/lib/groupdocs_signature_cloud/models/image_appearance.rb +339 -0
  29. data/lib/groupdocs_signature_cloud/models/image_signature.rb +20 -2
  30. data/lib/groupdocs_signature_cloud/models/info_result.rb +34 -4
  31. data/lib/groupdocs_signature_cloud/models/info_settings.rb +37 -4
  32. data/lib/groupdocs_signature_cloud/models/linear_gradient_brush.rb +18 -0
  33. data/lib/groupdocs_signature_cloud/models/object_exist.rb +18 -0
  34. data/lib/groupdocs_signature_cloud/models/options_base.rb +20 -2
  35. data/lib/groupdocs_signature_cloud/models/padding.rb +18 -0
  36. data/lib/groupdocs_signature_cloud/models/page_info.rb +18 -0
  37. data/lib/groupdocs_signature_cloud/models/pages_setup.rb +18 -0
  38. data/lib/groupdocs_signature_cloud/models/pdf_digital_signature.rb +18 -0
  39. data/lib/groupdocs_signature_cloud/models/pdf_digital_signature_appearance.rb +359 -0
  40. data/lib/groupdocs_signature_cloud/models/pdf_text_annotation_appearance.rb +395 -0
  41. data/lib/groupdocs_signature_cloud/models/pdf_text_sticker_appearance.rb +355 -0
  42. data/lib/groupdocs_signature_cloud/models/preview_page.rb +18 -0
  43. data/lib/groupdocs_signature_cloud/models/preview_result.rb +18 -0
  44. data/lib/groupdocs_signature_cloud/models/preview_settings.rb +18 -0
  45. data/lib/groupdocs_signature_cloud/models/qr_code_signature.rb +20 -2
  46. data/lib/groupdocs_signature_cloud/models/qr_code_type.rb +18 -0
  47. data/lib/groupdocs_signature_cloud/models/qr_codes_result.rb +18 -0
  48. data/lib/groupdocs_signature_cloud/models/radial_gradient_brush.rb +18 -0
  49. data/lib/groupdocs_signature_cloud/models/radio_button_form_field_signature.rb +467 -0
  50. data/lib/groupdocs_signature_cloud/models/save_options.rb +18 -0
  51. data/lib/groupdocs_signature_cloud/models/search_barcode_options.rb +20 -2
  52. data/lib/groupdocs_signature_cloud/models/search_digital_options.rb +20 -2
  53. data/lib/groupdocs_signature_cloud/models/search_options.rb +20 -2
  54. data/lib/groupdocs_signature_cloud/models/search_qr_code_options.rb +20 -2
  55. data/lib/groupdocs_signature_cloud/models/search_result.rb +18 -0
  56. data/lib/groupdocs_signature_cloud/models/search_settings.rb +18 -0
  57. data/lib/groupdocs_signature_cloud/models/sign_barcode_options.rb +31 -3
  58. data/lib/groupdocs_signature_cloud/models/sign_digital_options.rb +31 -3
  59. data/lib/groupdocs_signature_cloud/models/sign_image_options.rb +31 -3
  60. data/lib/groupdocs_signature_cloud/models/sign_options.rb +34 -6
  61. data/lib/groupdocs_signature_cloud/models/sign_qr_code_options.rb +31 -3
  62. data/lib/groupdocs_signature_cloud/models/sign_result.rb +18 -0
  63. data/lib/groupdocs_signature_cloud/models/sign_settings.rb +18 -0
  64. data/lib/groupdocs_signature_cloud/models/sign_stamp_options.rb +31 -3
  65. data/lib/groupdocs_signature_cloud/models/sign_text_options.rb +31 -3
  66. data/lib/groupdocs_signature_cloud/models/signature.rb +20 -2
  67. data/lib/groupdocs_signature_cloud/models/signature_appearance.rb +279 -0
  68. data/lib/groupdocs_signature_cloud/models/signature_font.rb +18 -0
  69. data/lib/groupdocs_signature_cloud/models/solid_brush.rb +18 -0
  70. data/lib/groupdocs_signature_cloud/models/stamp_line.rb +18 -0
  71. data/lib/groupdocs_signature_cloud/models/storage_exist.rb +18 -0
  72. data/lib/groupdocs_signature_cloud/models/storage_file.rb +18 -0
  73. data/lib/groupdocs_signature_cloud/models/text_form_field_signature.rb +455 -0
  74. data/lib/groupdocs_signature_cloud/models/text_signature.rb +20 -2
  75. data/lib/groupdocs_signature_cloud/models/texture_brush.rb +18 -0
  76. data/lib/groupdocs_signature_cloud/models/time_stamp.rb +18 -0
  77. data/lib/groupdocs_signature_cloud/models/update_options.rb +20 -2
  78. data/lib/groupdocs_signature_cloud/models/update_result.rb +18 -0
  79. data/lib/groupdocs_signature_cloud/models/update_settings.rb +18 -0
  80. data/lib/groupdocs_signature_cloud/models/verify_barcode_options.rb +20 -2
  81. data/lib/groupdocs_signature_cloud/models/verify_digital_options.rb +20 -2
  82. data/lib/groupdocs_signature_cloud/models/verify_options.rb +20 -2
  83. data/lib/groupdocs_signature_cloud/models/verify_qr_code_options.rb +20 -2
  84. data/lib/groupdocs_signature_cloud/models/verify_result.rb +18 -0
  85. data/lib/groupdocs_signature_cloud/models/verify_settings.rb +18 -0
  86. data/lib/groupdocs_signature_cloud/models/verify_text_options.rb +20 -2
  87. data/lib/groupdocs_signature_cloud/version.rb +1 -1
  88. data/lib/groupdocs_signature_cloud.rb +12 -0
  89. metadata +14 -2
@@ -0,0 +1,395 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="pdf_text_annotation_appearance.rb">
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsSignatureCloud
31
+ # Describes appearance of PDF text annotation object (Title, Subject, Content).
32
+ class PdfTextAnnotationAppearance
33
+
34
+ # Specifies the type of appearance
35
+ attr_accessor :appearance_type
36
+
37
+ # Represents border appearance
38
+ attr_accessor :border
39
+
40
+ # Gets or sets border effect.
41
+ attr_accessor :border_effect
42
+
43
+ # Gets or sets border effect intensity. Valid range of value is [0..2].
44
+ attr_accessor :border_effect_intensity
45
+
46
+ # Gets or sets content of annotation object.
47
+ attr_accessor :contents
48
+
49
+ # Gets or sets horizontal corner radius.
50
+ attr_accessor :h_corner_radius
51
+
52
+ # Gets or sets Subject representing description of the object.
53
+ attr_accessor :subject
54
+
55
+ # Gets or sets a Title that will be displayed in title bar of annotation object.
56
+ attr_accessor :title
57
+
58
+ # Gets or sets vertical corner radius.
59
+ attr_accessor :v_corner_radius
60
+ class EnumAttributeValidator
61
+ attr_reader :datatype
62
+ attr_reader :allowable_values
63
+
64
+ def initialize(datatype, allowable_values)
65
+ @allowable_values = allowable_values.map do |value|
66
+ case datatype.to_s
67
+ when /Integer/i
68
+ value.to_i
69
+ when /Float/i
70
+ value.to_f
71
+ else
72
+ value
73
+ end
74
+ end
75
+ end
76
+
77
+ def valid?(value)
78
+ !value || allowable_values.include?(value)
79
+ end
80
+ end
81
+
82
+ # Attribute mapping from ruby-style variable name to JSON key.
83
+ def self.attribute_map
84
+ {
85
+ :'appearance_type' => :'AppearanceType',
86
+ :'border' => :'Border',
87
+ :'border_effect' => :'BorderEffect',
88
+ :'border_effect_intensity' => :'BorderEffectIntensity',
89
+ :'contents' => :'Contents',
90
+ :'h_corner_radius' => :'HCornerRadius',
91
+ :'subject' => :'Subject',
92
+ :'title' => :'Title',
93
+ :'v_corner_radius' => :'VCornerRadius'
94
+ }
95
+ end
96
+
97
+ # Attribute type mapping.
98
+ def self.swagger_types
99
+ {
100
+ :'appearance_type' => :'String',
101
+ :'border' => :'BorderLine',
102
+ :'border_effect' => :'String',
103
+ :'border_effect_intensity' => :'Integer',
104
+ :'contents' => :'String',
105
+ :'h_corner_radius' => :'Integer',
106
+ :'subject' => :'String',
107
+ :'title' => :'String',
108
+ :'v_corner_radius' => :'Integer'
109
+ }
110
+ end
111
+
112
+ # Initializes the object
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ def initialize(attributes = {})
115
+ return unless attributes.is_a?(Hash)
116
+
117
+ # convert string to symbol for hash key
118
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
119
+
120
+ if attributes.key?(:'AppearanceType')
121
+ self.appearance_type = attributes[:'AppearanceType']
122
+ end
123
+
124
+ if attributes.key?(:'Border')
125
+ self.border = attributes[:'Border']
126
+ end
127
+
128
+ if attributes.key?(:'BorderEffect')
129
+ self.border_effect = attributes[:'BorderEffect']
130
+ end
131
+
132
+ if attributes.key?(:'BorderEffectIntensity')
133
+ self.border_effect_intensity = attributes[:'BorderEffectIntensity']
134
+ end
135
+
136
+ if attributes.key?(:'Contents')
137
+ self.contents = attributes[:'Contents']
138
+ end
139
+
140
+ if attributes.key?(:'HCornerRadius')
141
+ self.h_corner_radius = attributes[:'HCornerRadius']
142
+ end
143
+
144
+ if attributes.key?(:'Subject')
145
+ self.subject = attributes[:'Subject']
146
+ end
147
+
148
+ if attributes.key?(:'Title')
149
+ self.title = attributes[:'Title']
150
+ end
151
+
152
+ if attributes.key?(:'VCornerRadius')
153
+ self.v_corner_radius = attributes[:'VCornerRadius']
154
+ end
155
+
156
+ end
157
+
158
+ # Show invalid properties with the reasons. Usually used together with valid?
159
+ # @return Array for valid properies with the reasons
160
+ def list_invalid_properties
161
+ invalid_properties = []
162
+ if @appearance_type.nil?
163
+ invalid_properties.push("invalid value for 'appearance_type', appearance_type cannot be nil.")
164
+ end
165
+
166
+ if @border_effect.nil?
167
+ invalid_properties.push("invalid value for 'border_effect', border_effect cannot be nil.")
168
+ end
169
+
170
+ if @border_effect_intensity.nil?
171
+ invalid_properties.push("invalid value for 'border_effect_intensity', border_effect_intensity cannot be nil.")
172
+ end
173
+
174
+ if @h_corner_radius.nil?
175
+ invalid_properties.push("invalid value for 'h_corner_radius', h_corner_radius cannot be nil.")
176
+ end
177
+
178
+ if @v_corner_radius.nil?
179
+ invalid_properties.push("invalid value for 'v_corner_radius', v_corner_radius cannot be nil.")
180
+ end
181
+
182
+ return invalid_properties
183
+ end
184
+
185
+ # Check to see if the all the properties in the model are valid
186
+ # @return true if the model is valid
187
+ def valid?
188
+ return false if @appearance_type.nil?
189
+ appearance_type_validator = EnumAttributeValidator.new('String', ["Undefined", "PdfTextAnnotation", "PdfTextSticker", "Image", "DigitalSignature", "PdfDigitalSignature"])
190
+ return false unless appearance_type_validator.valid?(@appearance_type)
191
+ return false if @border_effect.nil?
192
+ border_effect_validator = EnumAttributeValidator.new('String', ["None", "Cloudy"])
193
+ return false unless border_effect_validator.valid?(@border_effect)
194
+ return false if @border_effect_intensity.nil?
195
+ return false if @h_corner_radius.nil?
196
+ return false if @v_corner_radius.nil?
197
+ return true
198
+ end
199
+
200
+ # Custom attribute writer method checking allowed values (enum).
201
+ # @param [Object] appearance_type Object to be assigned
202
+ def appearance_type=(appearance_type)
203
+ validator = EnumAttributeValidator.new('String', ["Undefined", "PdfTextAnnotation", "PdfTextSticker", "Image", "DigitalSignature", "PdfDigitalSignature"])
204
+ if appearance_type.to_i == 0
205
+ unless validator.valid?(appearance_type)
206
+ raise ArgumentError, "invalid value for 'appearance_type', must be one of #{validator.allowable_values}."
207
+ end
208
+ @appearance_type = appearance_type
209
+ else
210
+ @appearance_type = validator.allowable_values[appearance_type.to_i]
211
+ end
212
+ end
213
+
214
+ # Custom attribute writer method checking allowed values (enum).
215
+ # @param [Object] border_effect Object to be assigned
216
+ def border_effect=(border_effect)
217
+ validator = EnumAttributeValidator.new('String', ["None", "Cloudy"])
218
+ if border_effect.to_i == 0
219
+ unless validator.valid?(border_effect)
220
+ raise ArgumentError, "invalid value for 'border_effect', must be one of #{validator.allowable_values}."
221
+ end
222
+ @border_effect = border_effect
223
+ else
224
+ @border_effect = validator.allowable_values[border_effect.to_i]
225
+ end
226
+ end
227
+
228
+ # Checks equality by comparing each attribute.
229
+ # @param [Object] Object to be compared
230
+ def ==(other)
231
+ return true if self.equal?(other)
232
+ self.class == other.class &&
233
+ appearance_type == other.appearance_type &&
234
+ border == other.border &&
235
+ border_effect == other.border_effect &&
236
+ border_effect_intensity == other.border_effect_intensity &&
237
+ contents == other.contents &&
238
+ h_corner_radius == other.h_corner_radius &&
239
+ subject == other.subject &&
240
+ title == other.title &&
241
+ v_corner_radius == other.v_corner_radius
242
+ end
243
+
244
+ # @see the `==` method
245
+ # @param [Object] Object to be compared
246
+ def eql?(other)
247
+ self == other
248
+ end
249
+
250
+ # Calculates hash code according to all attributes.
251
+ # @return [Fixnum] Hash code
252
+ def hash
253
+ [appearance_type, border, border_effect, border_effect_intensity, contents, h_corner_radius, subject, title, v_corner_radius].hash
254
+ end
255
+
256
+ # Downcases first letter.
257
+ # @return downcased string
258
+ def uncap(str)
259
+ str[0, 1].downcase + str[1..-1]
260
+ end
261
+
262
+ # Builds the object from hash
263
+ # @param [Hash] attributes Model attributes in the form of hash
264
+ # @return [Object] Returns the model itself
265
+ def build_from_hash(attributes)
266
+ return nil unless attributes.is_a?(Hash)
267
+ self.class.swagger_types.each_pair do |key, type|
268
+ pname = uncap(self.class.attribute_map[key]).intern
269
+ value = attributes[pname]
270
+ if type =~ /\AArray<(.*)>/i
271
+ # check to ensure the input is an array given that the the attribute
272
+ # is documented as an array but the input is not
273
+ if value.is_a?(Array)
274
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
275
+ end
276
+ elsif !value.nil?
277
+ self.send("#{key}=", _deserialize(type, value))
278
+ end
279
+ # or else data not found in attributes(hash), not an issue as the data can be optional
280
+ end
281
+
282
+ self
283
+ end
284
+
285
+ # Deserializes the data based on type
286
+ # @param string type Data type
287
+ # @param string value Value to be deserialized
288
+ # @return [Object] Deserialized data
289
+ def _deserialize(type, value)
290
+ case type.to_sym
291
+ when :DateTime
292
+ Date.parse value
293
+ when :Date
294
+ Date.parse value
295
+ when :String
296
+ value.to_s
297
+ when :Integer
298
+ value.to_i
299
+ when :Float
300
+ value.to_f
301
+ when :BOOLEAN
302
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
303
+ true
304
+ else
305
+ false
306
+ end
307
+ when :Object
308
+ # generic object (usually a Hash), return directly
309
+ value
310
+ when /\AArray<(?<inner_type>.+)>\z/
311
+ inner_type = Regexp.last_match[:inner_type]
312
+ value.map { |v| _deserialize(inner_type, v) }
313
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
314
+ k_type = Regexp.last_match[:k_type]
315
+ v_type = Regexp.last_match[:v_type]
316
+ {}.tap do |hash|
317
+ value.each do |k, v|
318
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
319
+ end
320
+ end
321
+ else
322
+ # model
323
+ # Signature type fix
324
+ ttype = type
325
+ if value.is_a?(Hash) and !value[:signatureType].nil?
326
+ ttype = value[:signatureType] + 'Signature'
327
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
328
+ type = value[:type]
329
+ if type == 'Checkbox'
330
+ ttype = 'CheckboxFormFieldSignature'
331
+ end
332
+ if type == 'Text'
333
+ ttype = 'TextFormFieldSignature'
334
+ end
335
+ if type == 'Combobox'
336
+ ttype = 'ComboboxFormFieldSignature'
337
+ end
338
+ if type == 'DigitalSignature'
339
+ ttype = 'DigitalFormFieldSignature'
340
+ end
341
+ if type == 'Radio'
342
+ ttype = 'RadioButtonFormFieldSignature'
343
+ end
344
+ end
345
+ end
346
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
347
+ temp_model.build_from_hash(value)
348
+ end
349
+ end
350
+
351
+ # Returns the string representation of the object
352
+ # @return [String] String presentation of the object
353
+ def to_s
354
+ to_hash.to_s
355
+ end
356
+
357
+ # to_body is an alias to to_hash (backward compatibility)
358
+ # @return [Hash] Returns the object in the form of hash
359
+ def to_body
360
+ to_hash
361
+ end
362
+
363
+ # Returns the object in the form of hash
364
+ # @return [Hash] Returns the object in the form of hash
365
+ def to_hash
366
+ hash = {}
367
+ self.class.attribute_map.each_pair do |attr, param|
368
+ value = self.send(attr)
369
+ next if value.nil?
370
+ hash[param] = _to_hash(value)
371
+ end
372
+ hash
373
+ end
374
+
375
+ # Outputs non-array value in the form of hash
376
+ # For object, use to_hash. Otherwise, just return the value
377
+ # @param [Object] value Any valid value
378
+ # @return [Hash] Returns the value in the form of hash
379
+ def _to_hash(value)
380
+ if value.is_a?(Array)
381
+ value.compact.map { |v| _to_hash(v) }
382
+ elsif value.is_a?(Hash)
383
+ {}.tap do |hash|
384
+ value.each { |k, v| hash[k] = _to_hash(v) }
385
+ end
386
+ elsif value.respond_to? :to_hash
387
+ value.to_hash
388
+ else
389
+ value
390
+ end
391
+ end
392
+
393
+ end
394
+
395
+ end