groupdocs_signature_cloud 18.8.1 → 21.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +5 -5
  2. data/lib/groupdocs_signature_cloud/api/file_api.rb +734 -0
  3. data/lib/groupdocs_signature_cloud/api/folder_api.rb +699 -0
  4. data/lib/groupdocs_signature_cloud/api/info_api.rb +364 -0
  5. data/lib/groupdocs_signature_cloud/api/preview_api.rb +217 -0
  6. data/lib/groupdocs_signature_cloud/api/sign_api.rb +605 -0
  7. data/lib/groupdocs_signature_cloud/api/storage_api.rb +544 -0
  8. data/lib/groupdocs_signature_cloud/api_client.rb +382 -380
  9. data/lib/groupdocs_signature_cloud/api_error.rb +71 -58
  10. data/lib/groupdocs_signature_cloud/configuration.rb +95 -110
  11. data/lib/groupdocs_signature_cloud/models/barcode_signature.rb +434 -0
  12. data/lib/groupdocs_signature_cloud/models/barcode_type.rb +237 -230
  13. data/lib/groupdocs_signature_cloud/models/{barcode_collection.rb → barcodes_result.rb} +239 -232
  14. data/lib/groupdocs_signature_cloud/models/{base_signature_data.rb → base_settings.rb} +237 -230
  15. data/lib/groupdocs_signature_cloud/models/{border_line_data.rb → border_line.rb} +334 -312
  16. data/lib/groupdocs_signature_cloud/models/{brush_data.rb → brush.rb} +237 -230
  17. data/lib/groupdocs_signature_cloud/models/checkbox_form_field_signature.rb +460 -0
  18. data/lib/groupdocs_signature_cloud/models/color.rb +237 -245
  19. data/lib/groupdocs_signature_cloud/models/combobox_form_field_signature.rb +467 -0
  20. data/lib/groupdocs_signature_cloud/models/delete_options.rb +289 -0
  21. data/lib/groupdocs_signature_cloud/models/{sign_options_data.rb → delete_result.rb} +276 -255
  22. data/lib/groupdocs_signature_cloud/models/delete_settings.rb +249 -0
  23. data/lib/groupdocs_signature_cloud/models/digital_form_field_signature.rb +460 -0
  24. data/lib/groupdocs_signature_cloud/models/digital_signature.rb +454 -0
  25. data/lib/groupdocs_signature_cloud/models/digital_signature_appearance.rb +309 -0
  26. data/lib/groupdocs_signature_cloud/models/disc_usage.rb +257 -0
  27. data/lib/groupdocs_signature_cloud/models/{cells_qr_code_signature_data.rb → error.rb} +267 -250
  28. data/lib/groupdocs_signature_cloud/models/error_details.rb +252 -0
  29. data/lib/groupdocs_signature_cloud/models/{barcode_signature_data.rb → file_info.rb} +267 -250
  30. data/lib/groupdocs_signature_cloud/models/file_version.rb +312 -0
  31. data/lib/groupdocs_signature_cloud/models/file_versions.rb +239 -0
  32. data/lib/groupdocs_signature_cloud/models/files_list.rb +239 -0
  33. data/lib/groupdocs_signature_cloud/models/files_upload_result.rb +251 -0
  34. data/lib/groupdocs_signature_cloud/models/form_field_signature.rb +445 -0
  35. data/lib/groupdocs_signature_cloud/models/format.rb +247 -240
  36. data/lib/groupdocs_signature_cloud/models/{format_collection.rb → formats_result.rb} +239 -232
  37. data/lib/groupdocs_signature_cloud/models/image_appearance.rb +339 -0
  38. data/lib/groupdocs_signature_cloud/models/image_signature.rb +429 -0
  39. data/lib/groupdocs_signature_cloud/models/info_result.rb +371 -0
  40. data/lib/groupdocs_signature_cloud/models/{cells_barcode_signature_data.rb → info_settings.rb} +252 -250
  41. data/lib/groupdocs_signature_cloud/models/{linear_gradient_brush_data.rb → linear_gradient_brush.rb} +272 -260
  42. data/lib/groupdocs_signature_cloud/models/{pages_info.rb → object_exist.rb} +257 -247
  43. data/lib/groupdocs_signature_cloud/models/{pdf_digital_signature_data.rb → options_base.rb} +314 -307
  44. data/lib/groupdocs_signature_cloud/models/{padding_data.rb → padding.rb} +302 -295
  45. data/lib/groupdocs_signature_cloud/models/page_info.rb +312 -305
  46. data/lib/groupdocs_signature_cloud/models/{pages_setup_data.rb → pages_setup.rb} +299 -292
  47. data/lib/groupdocs_signature_cloud/models/pdf_digital_signature.rb +339 -0
  48. data/lib/groupdocs_signature_cloud/models/pdf_digital_signature_appearance.rb +359 -0
  49. data/lib/groupdocs_signature_cloud/models/pdf_text_annotation_appearance.rb +395 -0
  50. data/lib/groupdocs_signature_cloud/models/{document_response.rb → pdf_text_sticker_appearance.rb} +355 -302
  51. data/lib/groupdocs_signature_cloud/models/preview_page.rb +277 -0
  52. data/lib/groupdocs_signature_cloud/models/preview_result.rb +279 -0
  53. data/lib/groupdocs_signature_cloud/models/{cells_verify_qr_code_options_data.rb → preview_settings.rb} +356 -342
  54. data/lib/groupdocs_signature_cloud/models/qr_code_signature.rb +434 -0
  55. data/lib/groupdocs_signature_cloud/models/qr_code_type.rb +237 -230
  56. data/lib/groupdocs_signature_cloud/models/{qr_code_collection.rb → qr_codes_result.rb} +239 -232
  57. data/lib/groupdocs_signature_cloud/models/{radial_gradient_brush_data.rb → radial_gradient_brush.rb} +257 -250
  58. data/lib/groupdocs_signature_cloud/models/radio_button_form_field_signature.rb +467 -0
  59. data/lib/groupdocs_signature_cloud/models/save_options.rb +262 -0
  60. data/lib/groupdocs_signature_cloud/models/{search_barcode_options_data.rb → search_barcode_options.rb} +365 -332
  61. data/lib/groupdocs_signature_cloud/models/{cells_digital_signature_data.rb → search_digital_options.rb} +314 -307
  62. data/lib/groupdocs_signature_cloud/models/{words_digital_signature_data.rb → search_options.rb} +314 -307
  63. data/lib/groupdocs_signature_cloud/models/{pdf_search_barcode_options_data.rb → search_qr_code_options.rb} +365 -332
  64. data/lib/groupdocs_signature_cloud/models/{verify_options_collection_data.rb → search_result.rb} +264 -247
  65. data/lib/groupdocs_signature_cloud/models/search_settings.rb +249 -0
  66. data/lib/groupdocs_signature_cloud/models/{pdf_sign_text_options_data.rb → sign_barcode_options.rb} +808 -696
  67. data/lib/groupdocs_signature_cloud/models/{pdf_sign_digital_options_data.rb → sign_digital_options.rb} +695 -556
  68. data/lib/groupdocs_signature_cloud/models/{sign_stamp_options_data.rb → sign_image_options.rb} +599 -592
  69. data/lib/groupdocs_signature_cloud/models/sign_options.rb +324 -0
  70. data/lib/groupdocs_signature_cloud/models/{words_sign_text_options_data.rb → sign_qr_code_options.rb} +823 -696
  71. data/lib/groupdocs_signature_cloud/models/{verify_options_data.rb → sign_result.rb} +286 -265
  72. data/lib/groupdocs_signature_cloud/models/{qr_code_signature_data.rb → sign_settings.rb} +259 -250
  73. data/lib/groupdocs_signature_cloud/models/{slides_sign_stamp_options_data.rb → sign_stamp_options.rb} +705 -592
  74. data/lib/groupdocs_signature_cloud/models/{images_sign_text_options_data.rb → sign_text_options.rb} +747 -706
  75. data/lib/groupdocs_signature_cloud/models/signature.rb +404 -0
  76. data/lib/groupdocs_signature_cloud/models/{signature_document_response.rb → signature_appearance.rb} +278 -289
  77. data/lib/groupdocs_signature_cloud/models/{signature_font_data.rb → signature_font.rb} +297 -290
  78. data/lib/groupdocs_signature_cloud/models/{solid_brush_data.rb → solid_brush.rb} +247 -240
  79. data/lib/groupdocs_signature_cloud/models/{stamp_line_data.rb → stamp_line.rb} +384 -377
  80. data/lib/groupdocs_signature_cloud/models/storage_exist.rb +242 -0
  81. data/lib/groupdocs_signature_cloud/models/{document_info.rb → storage_file.rb} +287 -300
  82. data/lib/groupdocs_signature_cloud/models/text_form_field_signature.rb +455 -0
  83. data/lib/groupdocs_signature_cloud/models/text_signature.rb +424 -0
  84. data/lib/groupdocs_signature_cloud/models/{texture_brush_data.rb → texture_brush.rb} +247 -240
  85. data/lib/groupdocs_signature_cloud/models/time_stamp.rb +257 -0
  86. data/lib/groupdocs_signature_cloud/models/update_options.rb +374 -0
  87. data/lib/groupdocs_signature_cloud/models/update_result.rb +276 -0
  88. data/lib/groupdocs_signature_cloud/models/update_settings.rb +249 -0
  89. data/lib/groupdocs_signature_cloud/models/{verify_barcode_options_data.rb → verify_barcode_options.rb} +365 -342
  90. data/lib/groupdocs_signature_cloud/models/{cells_verify_digital_options_data.rb → verify_digital_options.rb} +394 -315
  91. data/lib/groupdocs_signature_cloud/models/{digital_signature_data.rb → verify_options.rb} +314 -307
  92. data/lib/groupdocs_signature_cloud/models/{verify_qr_code_options_data.rb → verify_qr_code_options.rb} +365 -342
  93. data/lib/groupdocs_signature_cloud/models/{images_barcode_signature_data.rb → verify_result.rb} +267 -250
  94. data/lib/groupdocs_signature_cloud/models/{search_options_collection_data.rb → verify_settings.rb} +249 -232
  95. data/lib/groupdocs_signature_cloud/models/{cells_verify_barcode_options_data.rb → verify_text_options.rb} +355 -342
  96. data/lib/groupdocs_signature_cloud/version.rb +2 -2
  97. data/lib/groupdocs_signature_cloud.rb +125 -191
  98. metadata +89 -185
  99. data/lib/groupdocs_signature_cloud/api/signature_api.rb +0 -2590
  100. data/lib/groupdocs_signature_cloud/models/cells_search_barcode_options_data.rb +0 -332
  101. data/lib/groupdocs_signature_cloud/models/cells_search_digital_options_data.rb +0 -265
  102. data/lib/groupdocs_signature_cloud/models/cells_search_qr_code_options_data.rb +0 -332
  103. data/lib/groupdocs_signature_cloud/models/cells_sign_barcode_options_data.rb +0 -694
  104. data/lib/groupdocs_signature_cloud/models/cells_sign_digital_options_data.rb +0 -546
  105. data/lib/groupdocs_signature_cloud/models/cells_sign_image_options_data.rb +0 -526
  106. data/lib/groupdocs_signature_cloud/models/cells_sign_qr_code_options_data.rb +0 -704
  107. data/lib/groupdocs_signature_cloud/models/cells_sign_stamp_options_data.rb +0 -622
  108. data/lib/groupdocs_signature_cloud/models/cells_sign_text_options_data.rb +0 -736
  109. data/lib/groupdocs_signature_cloud/models/cells_verify_text_options_data.rb +0 -285
  110. data/lib/groupdocs_signature_cloud/models/images_qr_code_signature_data.rb +0 -250
  111. data/lib/groupdocs_signature_cloud/models/images_search_barcode_options_data.rb +0 -332
  112. data/lib/groupdocs_signature_cloud/models/images_search_qr_code_options_data.rb +0 -332
  113. data/lib/groupdocs_signature_cloud/models/images_sign_barcode_options_data.rb +0 -664
  114. data/lib/groupdocs_signature_cloud/models/images_sign_image_options_data.rb +0 -496
  115. data/lib/groupdocs_signature_cloud/models/images_sign_qr_code_options_data.rb +0 -674
  116. data/lib/groupdocs_signature_cloud/models/images_sign_stamp_options_data.rb +0 -592
  117. data/lib/groupdocs_signature_cloud/models/images_verify_barcode_options_data.rb +0 -342
  118. data/lib/groupdocs_signature_cloud/models/images_verify_qr_code_options_data.rb +0 -342
  119. data/lib/groupdocs_signature_cloud/models/pdf_barcode_signature_data.rb +0 -250
  120. data/lib/groupdocs_signature_cloud/models/pdf_qr_code_signature_data.rb +0 -250
  121. data/lib/groupdocs_signature_cloud/models/pdf_search_digital_options_data.rb +0 -265
  122. data/lib/groupdocs_signature_cloud/models/pdf_search_qr_code_options_data.rb +0 -332
  123. data/lib/groupdocs_signature_cloud/models/pdf_sign_barcode_options_data.rb +0 -664
  124. data/lib/groupdocs_signature_cloud/models/pdf_sign_image_options_data.rb +0 -496
  125. data/lib/groupdocs_signature_cloud/models/pdf_sign_qr_code_options_data.rb +0 -674
  126. data/lib/groupdocs_signature_cloud/models/pdf_sign_stamp_options_data.rb +0 -592
  127. data/lib/groupdocs_signature_cloud/models/pdf_verify_barcode_options_data.rb +0 -342
  128. data/lib/groupdocs_signature_cloud/models/pdf_verify_digital_options_data.rb +0 -315
  129. data/lib/groupdocs_signature_cloud/models/pdf_verify_qr_code_options_data.rb +0 -342
  130. data/lib/groupdocs_signature_cloud/models/pdf_verify_text_options_data.rb +0 -342
  131. data/lib/groupdocs_signature_cloud/models/requests/get_document_info_from_url_request.rb +0 -55
  132. data/lib/groupdocs_signature_cloud/models/requests/get_document_info_request.rb +0 -59
  133. data/lib/groupdocs_signature_cloud/models/requests/post_barcode_from_url_request.rb +0 -59
  134. data/lib/groupdocs_signature_cloud/models/requests/post_barcode_request.rb +0 -63
  135. data/lib/groupdocs_signature_cloud/models/requests/post_collection_from_url_request.rb +0 -59
  136. data/lib/groupdocs_signature_cloud/models/requests/post_collection_request.rb +0 -63
  137. data/lib/groupdocs_signature_cloud/models/requests/post_digital_from_url_request.rb +0 -67
  138. data/lib/groupdocs_signature_cloud/models/requests/post_digital_request.rb +0 -71
  139. data/lib/groupdocs_signature_cloud/models/requests/post_image_from_url_request.rb +0 -63
  140. data/lib/groupdocs_signature_cloud/models/requests/post_image_request.rb +0 -67
  141. data/lib/groupdocs_signature_cloud/models/requests/post_qr_code_from_url_request.rb +0 -59
  142. data/lib/groupdocs_signature_cloud/models/requests/post_qr_code_request.rb +0 -63
  143. data/lib/groupdocs_signature_cloud/models/requests/post_search_barcode_from_url_request.rb +0 -59
  144. data/lib/groupdocs_signature_cloud/models/requests/post_search_barcode_request.rb +0 -63
  145. data/lib/groupdocs_signature_cloud/models/requests/post_search_collection_from_url_request.rb +0 -59
  146. data/lib/groupdocs_signature_cloud/models/requests/post_search_collection_request.rb +0 -63
  147. data/lib/groupdocs_signature_cloud/models/requests/post_search_digital_from_url_request.rb +0 -59
  148. data/lib/groupdocs_signature_cloud/models/requests/post_search_digital_request.rb +0 -63
  149. data/lib/groupdocs_signature_cloud/models/requests/post_search_qr_code_from_url_request.rb +0 -59
  150. data/lib/groupdocs_signature_cloud/models/requests/post_search_qr_code_request.rb +0 -63
  151. data/lib/groupdocs_signature_cloud/models/requests/post_stamp_from_url_request.rb +0 -59
  152. data/lib/groupdocs_signature_cloud/models/requests/post_stamp_request.rb +0 -63
  153. data/lib/groupdocs_signature_cloud/models/requests/post_text_from_url_request.rb +0 -59
  154. data/lib/groupdocs_signature_cloud/models/requests/post_text_request.rb +0 -63
  155. data/lib/groupdocs_signature_cloud/models/requests/post_verification_barcode_from_url_request.rb +0 -59
  156. data/lib/groupdocs_signature_cloud/models/requests/post_verification_barcode_request.rb +0 -63
  157. data/lib/groupdocs_signature_cloud/models/requests/post_verification_collection_from_url_request.rb +0 -59
  158. data/lib/groupdocs_signature_cloud/models/requests/post_verification_collection_request.rb +0 -63
  159. data/lib/groupdocs_signature_cloud/models/requests/post_verification_digital_from_url_request.rb +0 -63
  160. data/lib/groupdocs_signature_cloud/models/requests/post_verification_digital_request.rb +0 -67
  161. data/lib/groupdocs_signature_cloud/models/requests/post_verification_qr_code_from_url_request.rb +0 -59
  162. data/lib/groupdocs_signature_cloud/models/requests/post_verification_qr_code_request.rb +0 -63
  163. data/lib/groupdocs_signature_cloud/models/requests/post_verification_text_from_url_request.rb +0 -57
  164. data/lib/groupdocs_signature_cloud/models/requests/post_verification_text_request.rb +0 -63
  165. data/lib/groupdocs_signature_cloud/models/search_digital_options_data.rb +0 -265
  166. data/lib/groupdocs_signature_cloud/models/search_document_response.rb +0 -305
  167. data/lib/groupdocs_signature_cloud/models/search_options_data.rb +0 -265
  168. data/lib/groupdocs_signature_cloud/models/search_qr_code_options_data.rb +0 -332
  169. data/lib/groupdocs_signature_cloud/models/sign_barcode_options_data.rb +0 -664
  170. data/lib/groupdocs_signature_cloud/models/sign_digital_options_data.rb +0 -516
  171. data/lib/groupdocs_signature_cloud/models/sign_image_options_data.rb +0 -496
  172. data/lib/groupdocs_signature_cloud/models/sign_options_collection_data.rb +0 -232
  173. data/lib/groupdocs_signature_cloud/models/sign_qr_code_options_data.rb +0 -674
  174. data/lib/groupdocs_signature_cloud/models/sign_text_options_data.rb +0 -562
  175. data/lib/groupdocs_signature_cloud/models/slides_barcode_signature_data.rb +0 -250
  176. data/lib/groupdocs_signature_cloud/models/slides_qr_code_signature_data.rb +0 -250
  177. data/lib/groupdocs_signature_cloud/models/slides_search_barcode_options_data.rb +0 -332
  178. data/lib/groupdocs_signature_cloud/models/slides_search_qr_code_options_data.rb +0 -332
  179. data/lib/groupdocs_signature_cloud/models/slides_sign_barcode_options_data.rb +0 -664
  180. data/lib/groupdocs_signature_cloud/models/slides_sign_image_options_data.rb +0 -496
  181. data/lib/groupdocs_signature_cloud/models/slides_sign_qr_code_options_data.rb +0 -674
  182. data/lib/groupdocs_signature_cloud/models/slides_sign_text_options_data.rb +0 -670
  183. data/lib/groupdocs_signature_cloud/models/slides_verify_barcode_options_data.rb +0 -342
  184. data/lib/groupdocs_signature_cloud/models/slides_verify_qr_code_options_data.rb +0 -342
  185. data/lib/groupdocs_signature_cloud/models/slides_verify_text_options_data.rb +0 -285
  186. data/lib/groupdocs_signature_cloud/models/verified_document_response.rb +0 -300
  187. data/lib/groupdocs_signature_cloud/models/verify_digital_options_data.rb +0 -285
  188. data/lib/groupdocs_signature_cloud/models/verify_text_options_data.rb +0 -285
  189. data/lib/groupdocs_signature_cloud/models/words_barcode_signature_data.rb +0 -250
  190. data/lib/groupdocs_signature_cloud/models/words_qr_code_signature_data.rb +0 -250
  191. data/lib/groupdocs_signature_cloud/models/words_search_barcode_options_data.rb +0 -332
  192. data/lib/groupdocs_signature_cloud/models/words_search_digital_options_data.rb +0 -265
  193. data/lib/groupdocs_signature_cloud/models/words_search_qr_code_options_data.rb +0 -332
  194. data/lib/groupdocs_signature_cloud/models/words_sign_barcode_options_data.rb +0 -664
  195. data/lib/groupdocs_signature_cloud/models/words_sign_digital_options_data.rb +0 -516
  196. data/lib/groupdocs_signature_cloud/models/words_sign_image_options_data.rb +0 -496
  197. data/lib/groupdocs_signature_cloud/models/words_sign_qr_code_options_data.rb +0 -674
  198. data/lib/groupdocs_signature_cloud/models/words_sign_stamp_options_data.rb +0 -592
  199. data/lib/groupdocs_signature_cloud/models/words_verify_barcode_options_data.rb +0 -342
  200. data/lib/groupdocs_signature_cloud/models/words_verify_digital_options_data.rb +0 -315
  201. data/lib/groupdocs_signature_cloud/models/words_verify_qr_code_options_data.rb +0 -342
  202. data/lib/groupdocs_signature_cloud/models/words_verify_text_options_data.rb +0 -285
@@ -1,556 +1,695 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="pdf_sign_digital_options_data.rb">
4
- # Copyright (c) 2003-2018 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
- # Represents the Digital Sign Options for PDF Documents.
32
- class PdfSignDigitalOptionsData
33
-
34
- # Gets or sets a document page number to put signature Value starts from 1
35
- attr_accessor :document_page_number
36
-
37
- # Page Options to specify pages to be verified.
38
- attr_accessor :pages_setup
39
-
40
- # Internal property that specify the name of Options.
41
- attr_accessor :options_type
42
-
43
- # Gets or sets the signature image file name. This property is used only if ImageStream is not specified.
44
- attr_accessor :image_guid
45
-
46
- # Left X position of Signature on Document Page in Measure values (pixels or percent see LocationMeasureType). (works if horizontal alignment is not specified).
47
- attr_accessor :left
48
-
49
- # Top Y Position of Signature on Document Page in Measure values (pixels or percent see LocationMeasureType). (works if vertical alignment is not specified).
50
- attr_accessor :top
51
-
52
- # Width of Signature on Document Page in Measure values (pixels or percent see SizeMeasureType).
53
- attr_accessor :width
54
-
55
- # Height of Signature on Document Page in Measure values (pixels or percent see SizeMeasureType).
56
- attr_accessor :height
57
-
58
- # Measure type (pixels or percent) for Left and Top properties.
59
- attr_accessor :location_measure_type
60
-
61
- # Measure type (pixels or percent) for Width and Height properties.
62
- attr_accessor :size_measure_type
63
-
64
- # Rotation angle of signature on document page (clockwise).
65
- attr_accessor :rotation_angle
66
-
67
- # Horizontal alignment of signature on document page.
68
- attr_accessor :horizontal_alignment
69
-
70
- # Vertical alignment of signature on document page.
71
- attr_accessor :vertical_alignment
72
-
73
- # Gets or sets the space between Sign and Document edges. (works ONLY if horizontal or vertical alignment are specified).
74
- attr_accessor :margin
75
-
76
- # Gets or sets the measure type (pixels or percent) for Margin.
77
- attr_accessor :margin_measure_type
78
-
79
- # Gets or sets the additional opacity for sign image (value from 0.0 (clear) through 1.0 (opaque)). By default the value is 1.0.
80
- attr_accessor :opacity
81
-
82
- # Put signature on all document pages.
83
- attr_accessor :sign_all_pages
84
-
85
- # Gets or sets the password of digital certificate.
86
- attr_accessor :password
87
-
88
- # Gets or sets the digital certificate file GUID.
89
- attr_accessor :certificate_guid
90
-
91
- # Gets or sets the reason of signature.
92
- attr_accessor :reason
93
-
94
- # Gets or sets the signature contact.
95
- attr_accessor :contact
96
-
97
- # Gets or sets the signature location.
98
- attr_accessor :location
99
-
100
- # Gets or sets the visibility of signature.
101
- attr_accessor :visible
102
- class EnumAttributeValidator
103
- attr_reader :datatype
104
- attr_reader :allowable_values
105
-
106
- def initialize(datatype, allowable_values)
107
- @allowable_values = allowable_values.map do |value|
108
- case datatype.to_s
109
- when /Integer/i
110
- value.to_i
111
- when /Float/i
112
- value.to_f
113
- else
114
- value
115
- end
116
- end
117
- end
118
-
119
- def valid?(value)
120
- !value || allowable_values.include?(value)
121
- end
122
- end
123
-
124
- # Attribute mapping from ruby-style variable name to JSON key.
125
- def self.attribute_map
126
- {
127
- :'document_page_number' => :'DocumentPageNumber',
128
- :'pages_setup' => :'PagesSetup',
129
- :'options_type' => :'OptionsType',
130
- :'image_guid' => :'ImageGuid',
131
- :'left' => :'Left',
132
- :'top' => :'Top',
133
- :'width' => :'Width',
134
- :'height' => :'Height',
135
- :'location_measure_type' => :'LocationMeasureType',
136
- :'size_measure_type' => :'SizeMeasureType',
137
- :'rotation_angle' => :'RotationAngle',
138
- :'horizontal_alignment' => :'HorizontalAlignment',
139
- :'vertical_alignment' => :'VerticalAlignment',
140
- :'margin' => :'Margin',
141
- :'margin_measure_type' => :'MarginMeasureType',
142
- :'opacity' => :'Opacity',
143
- :'sign_all_pages' => :'SignAllPages',
144
- :'password' => :'Password',
145
- :'certificate_guid' => :'CertificateGuid',
146
- :'reason' => :'Reason',
147
- :'contact' => :'Contact',
148
- :'location' => :'Location',
149
- :'visible' => :'Visible'
150
- }
151
- end
152
-
153
- # Attribute type mapping.
154
- def self.swagger_types
155
- {
156
- :'document_page_number' => :'Integer',
157
- :'pages_setup' => :'PagesSetupData',
158
- :'options_type' => :'String',
159
- :'image_guid' => :'String',
160
- :'left' => :'Integer',
161
- :'top' => :'Integer',
162
- :'width' => :'Integer',
163
- :'height' => :'Integer',
164
- :'location_measure_type' => :'String',
165
- :'size_measure_type' => :'String',
166
- :'rotation_angle' => :'Integer',
167
- :'horizontal_alignment' => :'String',
168
- :'vertical_alignment' => :'String',
169
- :'margin' => :'PaddingData',
170
- :'margin_measure_type' => :'String',
171
- :'opacity' => :'Float',
172
- :'sign_all_pages' => :'BOOLEAN',
173
- :'password' => :'String',
174
- :'certificate_guid' => :'String',
175
- :'reason' => :'String',
176
- :'contact' => :'String',
177
- :'location' => :'String',
178
- :'visible' => :'BOOLEAN'
179
- }
180
- end
181
-
182
- # Initializes the object
183
- # @param [Hash] attributes Model attributes in the form of hash
184
- def initialize(attributes = {})
185
- return unless attributes.is_a?(Hash)
186
-
187
- # convert string to symbol for hash key
188
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
189
-
190
- if attributes.key?(:'DocumentPageNumber')
191
- self.document_page_number = attributes[:'DocumentPageNumber']
192
- end
193
-
194
- if attributes.key?(:'PagesSetup')
195
- self.pages_setup = attributes[:'PagesSetup']
196
- end
197
-
198
- if attributes.key?(:'OptionsType')
199
- self.options_type = attributes[:'OptionsType']
200
- end
201
-
202
- if attributes.key?(:'ImageGuid')
203
- self.image_guid = attributes[:'ImageGuid']
204
- end
205
-
206
- if attributes.key?(:'Left')
207
- self.left = attributes[:'Left']
208
- end
209
-
210
- if attributes.key?(:'Top')
211
- self.top = attributes[:'Top']
212
- end
213
-
214
- if attributes.key?(:'Width')
215
- self.width = attributes[:'Width']
216
- end
217
-
218
- if attributes.key?(:'Height')
219
- self.height = attributes[:'Height']
220
- end
221
-
222
- if attributes.key?(:'LocationMeasureType')
223
- self.location_measure_type = attributes[:'LocationMeasureType']
224
- end
225
-
226
- if attributes.key?(:'SizeMeasureType')
227
- self.size_measure_type = attributes[:'SizeMeasureType']
228
- end
229
-
230
- if attributes.key?(:'RotationAngle')
231
- self.rotation_angle = attributes[:'RotationAngle']
232
- end
233
-
234
- if attributes.key?(:'HorizontalAlignment')
235
- self.horizontal_alignment = attributes[:'HorizontalAlignment']
236
- end
237
-
238
- if attributes.key?(:'VerticalAlignment')
239
- self.vertical_alignment = attributes[:'VerticalAlignment']
240
- end
241
-
242
- if attributes.key?(:'Margin')
243
- self.margin = attributes[:'Margin']
244
- end
245
-
246
- if attributes.key?(:'MarginMeasureType')
247
- self.margin_measure_type = attributes[:'MarginMeasureType']
248
- end
249
-
250
- if attributes.key?(:'Opacity')
251
- self.opacity = attributes[:'Opacity']
252
- end
253
-
254
- if attributes.key?(:'SignAllPages')
255
- self.sign_all_pages = attributes[:'SignAllPages']
256
- end
257
-
258
- if attributes.key?(:'Password')
259
- self.password = attributes[:'Password']
260
- end
261
-
262
- if attributes.key?(:'CertificateGuid')
263
- self.certificate_guid = attributes[:'CertificateGuid']
264
- end
265
-
266
- if attributes.key?(:'Reason')
267
- self.reason = attributes[:'Reason']
268
- end
269
-
270
- if attributes.key?(:'Contact')
271
- self.contact = attributes[:'Contact']
272
- end
273
-
274
- if attributes.key?(:'Location')
275
- self.location = attributes[:'Location']
276
- end
277
-
278
- if attributes.key?(:'Visible')
279
- self.visible = attributes[:'Visible']
280
- end
281
-
282
-
283
- if !((defined? options_type) == nil)
284
- self.options_type = "PdfSignDigitalOptionsData"
285
- end
286
-
287
- end
288
-
289
- # Show invalid properties with the reasons. Usually used together with valid?
290
- # @return Array for valid properies with the reasons
291
- def list_invalid_properties
292
- invalid_properties = []
293
- if @document_page_number.nil?
294
- invalid_properties.push("invalid value for 'document_page_number', document_page_number cannot be nil.")
295
- end
296
-
297
- return invalid_properties
298
- end
299
-
300
- # Check to see if the all the properties in the model are valid
301
- # @return true if the model is valid
302
- def valid?
303
- return false if @document_page_number.nil?
304
- location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
305
- return false unless location_measure_type_validator.valid?(@location_measure_type)
306
- size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
307
- return false unless size_measure_type_validator.valid?(@size_measure_type)
308
- horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
309
- return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
310
- vertical_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
311
- return false unless vertical_alignment_validator.valid?(@vertical_alignment)
312
- margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
313
- return false unless margin_measure_type_validator.valid?(@margin_measure_type)
314
- return true
315
- end
316
-
317
- # Custom attribute writer method checking allowed values (enum).
318
- # @param [Object] location_measure_type Object to be assigned
319
- def location_measure_type=(location_measure_type)
320
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
321
- if location_measure_type.to_i == 0
322
- unless validator.valid?(location_measure_type)
323
- raise ArgumentError, "invalid value for 'location_measure_type', must be one of #{validator.allowable_values}."
324
- end
325
- @location_measure_type = location_measure_type
326
- else
327
- @location_measure_type = validator.allowable_values[location_measure_type.to_i]
328
- end
329
- end
330
-
331
- # Custom attribute writer method checking allowed values (enum).
332
- # @param [Object] size_measure_type Object to be assigned
333
- def size_measure_type=(size_measure_type)
334
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
335
- if size_measure_type.to_i == 0
336
- unless validator.valid?(size_measure_type)
337
- raise ArgumentError, "invalid value for 'size_measure_type', must be one of #{validator.allowable_values}."
338
- end
339
- @size_measure_type = size_measure_type
340
- else
341
- @size_measure_type = validator.allowable_values[size_measure_type.to_i]
342
- end
343
- end
344
-
345
- # Custom attribute writer method checking allowed values (enum).
346
- # @param [Object] horizontal_alignment Object to be assigned
347
- def horizontal_alignment=(horizontal_alignment)
348
- validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
349
- if horizontal_alignment.to_i == 0
350
- unless validator.valid?(horizontal_alignment)
351
- raise ArgumentError, "invalid value for 'horizontal_alignment', must be one of #{validator.allowable_values}."
352
- end
353
- @horizontal_alignment = horizontal_alignment
354
- else
355
- @horizontal_alignment = validator.allowable_values[horizontal_alignment.to_i]
356
- end
357
- end
358
-
359
- # Custom attribute writer method checking allowed values (enum).
360
- # @param [Object] vertical_alignment Object to be assigned
361
- def vertical_alignment=(vertical_alignment)
362
- validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
363
- if vertical_alignment.to_i == 0
364
- unless validator.valid?(vertical_alignment)
365
- raise ArgumentError, "invalid value for 'vertical_alignment', must be one of #{validator.allowable_values}."
366
- end
367
- @vertical_alignment = vertical_alignment
368
- else
369
- @vertical_alignment = validator.allowable_values[vertical_alignment.to_i]
370
- end
371
- end
372
-
373
- # Custom attribute writer method checking allowed values (enum).
374
- # @param [Object] margin_measure_type Object to be assigned
375
- def margin_measure_type=(margin_measure_type)
376
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
377
- if margin_measure_type.to_i == 0
378
- unless validator.valid?(margin_measure_type)
379
- raise ArgumentError, "invalid value for 'margin_measure_type', must be one of #{validator.allowable_values}."
380
- end
381
- @margin_measure_type = margin_measure_type
382
- else
383
- @margin_measure_type = validator.allowable_values[margin_measure_type.to_i]
384
- end
385
- end
386
-
387
- # Checks equality by comparing each attribute.
388
- # @param [Object] Object to be compared
389
- def ==(other)
390
- return true if self.equal?(other)
391
- self.class == other.class &&
392
- document_page_number == other.document_page_number &&
393
- pages_setup == other.pages_setup &&
394
- options_type == other.options_type &&
395
- image_guid == other.image_guid &&
396
- left == other.left &&
397
- top == other.top &&
398
- width == other.width &&
399
- height == other.height &&
400
- location_measure_type == other.location_measure_type &&
401
- size_measure_type == other.size_measure_type &&
402
- rotation_angle == other.rotation_angle &&
403
- horizontal_alignment == other.horizontal_alignment &&
404
- vertical_alignment == other.vertical_alignment &&
405
- margin == other.margin &&
406
- margin_measure_type == other.margin_measure_type &&
407
- opacity == other.opacity &&
408
- sign_all_pages == other.sign_all_pages &&
409
- password == other.password &&
410
- certificate_guid == other.certificate_guid &&
411
- reason == other.reason &&
412
- contact == other.contact &&
413
- location == other.location &&
414
- visible == other.visible
415
- end
416
-
417
- # @see the `==` method
418
- # @param [Object] Object to be compared
419
- def eql?(other)
420
- self == other
421
- end
422
-
423
- # Calculates hash code according to all attributes.
424
- # @return [Fixnum] Hash code
425
- def hash
426
- [document_page_number, pages_setup, options_type, image_guid, left, top, width, height, location_measure_type, size_measure_type, rotation_angle, horizontal_alignment, vertical_alignment, margin, margin_measure_type, opacity, sign_all_pages, password, certificate_guid, reason, contact, location, visible].hash
427
- end
428
-
429
- # Builds the object from hash
430
- # @param [Hash] attributes Model attributes in the form of hash
431
- # @return [Object] Returns the model itself
432
- def build_from_hash(attributes)
433
- return nil unless attributes.is_a?(Hash)
434
- self.class.swagger_types.each_pair do |key, type|
435
-
436
- attributeName = self.class.attribute_map[key]
437
- attributeNameLowerStr = attributeName.to_s
438
- attributeNameLowerStr[0] = attributeNameLowerStr[0].downcase
439
- attributeNameLower = attributeNameLowerStr.to_sym
440
- attributeNameLowerStr2 = attributeName.to_s
441
- attributeNameLowerStr2[0] = attributeNameLowerStr[0].downcase
442
- attributeNameLowerStr2[1] = attributeNameLowerStr[1].downcase
443
- attributeNameLower2 = attributeNameLowerStr2.to_sym
444
-
445
- if type =~ /\AArray<(.*)>/i
446
- # check to ensure the input is an array given that the the attribute
447
- # is documented as an array but the input is not
448
- if attributes[attributeName].is_a?(Array)
449
- self.send("#{key}=", attributes[attributeName].map { |v| _deserialize($1, v) })
450
- end
451
- if attributes[attributeNameLower].is_a?(Array)
452
- self.send("#{key}=", attributes[attributeNameLower].map { |v| _deserialize($1, v) })
453
- end
454
- if attributes[attributeNameLower2].is_a?(Array)
455
- self.send("#{key}=", attributes[attributeNameLower2].map { |v| _deserialize($1, v) })
456
- end
457
- elsif !attributes[attributeName].nil?
458
- self.send("#{key}=", _deserialize(type, attributes[attributeName]))
459
- elsif !attributes[attributeNameLower].nil?
460
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower]))
461
- elsif !attributes[attributeNameLower2].nil?
462
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower2]))
463
- end
464
- # or else data not found in attributes(hash), not an issue as the data can be optional
465
- end
466
- self
467
- end
468
-
469
- # Deserializes the data based on type
470
- # @param string type Data type
471
- # @param string value Value to be deserialized
472
- # @return [Object] Deserialized data
473
- def _deserialize(type, value)
474
- case type.to_sym
475
- when :DateTime
476
- Time.at(/\d/.match(value)[0].to_f).to_datetime
477
- when :Date
478
- Time.at(/\d/.match(value)[0].to_f).to_date
479
- when :String
480
- value.to_s
481
- when :Integer
482
- value.to_i
483
- when :Float
484
- value.to_f
485
- when :BOOLEAN
486
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
487
- true
488
- else
489
- false
490
- end
491
- when :Object
492
- # generic object (usually a Hash), return directly
493
- value
494
- when /\AArray<(?<inner_type>.+)>\z/
495
- inner_type = Regexp.last_match[:inner_type]
496
- value.map { |v| _deserialize(inner_type, v) }
497
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
498
- k_type = Regexp.last_match[:k_type]
499
- v_type = Regexp.last_match[:v_type]
500
- {}.tap do |hash|
501
- value.each do |k, v|
502
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
503
- end
504
- end
505
- else
506
- # model
507
- temp_model = GroupDocsSignatureCloud.const_get(type).new
508
- temp_model.build_from_hash(value)
509
- end
510
- end
511
-
512
- # Returns the string representation of the object
513
- # @return [String] String presentation of the object
514
- def to_s
515
- to_hash.to_s
516
- end
517
-
518
- # to_body is an alias to to_hash (backward compatibility)
519
- # @return [Hash] Returns the object in the form of hash
520
- def to_body
521
- to_hash
522
- end
523
-
524
- # Returns the object in the form of hash
525
- # @return [Hash] Returns the object in the form of hash
526
- def to_hash
527
- hash = {}
528
- self.class.attribute_map.each_pair do |attr, param|
529
- value = self.send(attr)
530
- next if value.nil?
531
- hash[param] = _to_hash(value)
532
- end
533
- hash
534
- end
535
-
536
- # Outputs non-array value in the form of hash
537
- # For object, use to_hash. Otherwise, just return the value
538
- # @param [Object] value Any valid value
539
- # @return [Hash] Returns the value in the form of hash
540
- def _to_hash(value)
541
- if value.is_a?(Array)
542
- value.compact.map { |v| _to_hash(v) }
543
- elsif value.is_a?(Hash)
544
- {}.tap do |hash|
545
- value.each { |k, v| hash[k] = _to_hash(v) }
546
- end
547
- elsif value.respond_to? :to_hash
548
- value.to_hash
549
- else
550
- value
551
- end
552
- end
553
-
554
- end
555
-
556
- end
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="sign_digital_options.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
+ # Represents the Digital sign options
32
+ class SignDigitalOptions
33
+
34
+ # Specifies the signature type of processing
35
+ attr_accessor :signature_type
36
+
37
+ # Gets or sets a document page number for processing. Value is optional
38
+ attr_accessor :page
39
+
40
+ # Process all document pages. Type of processing depends on SignatureType For Images Document Type it can be used only for multi-frames images like .tiff
41
+ attr_accessor :all_pages
42
+
43
+ # Options to specify pages for processing
44
+ attr_accessor :pages_setup
45
+
46
+ # Specifies Appearance with additional properties for this options instance
47
+ attr_accessor :appearance
48
+
49
+ # Gets or sets the signature image file name. This property is used only if ImageStream is not specified
50
+ attr_accessor :image_file_path
51
+
52
+ # Left X position of Signature on Document Page in Measure values (pixels or percent see MeasureType LocationMeasureType). (works if horizontal alignment is not specified). For Spreadsheet documents this property is mutually exclusive with Column property. If Left property is set ColumnNumber will be reset to 0
53
+ attr_accessor :left
54
+
55
+ # Top Y Position of Signature on Document Page in Measure values (pixels or percent see MeasureType LocationMeasureType). (works if vertical alignment is not specified). For Spreadsheet documents this property is mutually exclusive with Row property. If Top property is set RowNumber will be reset to 0
56
+ attr_accessor :top
57
+
58
+ # Width of Signature on Document Page in Measure values (pixels or percent see MeasureType SizeMeasureType)
59
+ attr_accessor :width
60
+
61
+ # Height of Signature on Document Page in Measure values (pixels or percent see MeasureType SizeMeasureType)
62
+ attr_accessor :height
63
+
64
+ # Measure type (pixels or percent) for Left and Top properties
65
+ attr_accessor :location_measure_type
66
+
67
+ # Measure type (pixels or percent) for Width and Height properties
68
+ attr_accessor :size_measure_type
69
+
70
+ # Rotation angle of signature on document page (clockwise)
71
+ attr_accessor :rotation_angle
72
+
73
+ # Horizontal alignment of signature on document page
74
+ attr_accessor :horizontal_alignment
75
+
76
+ # Vertical alignment of signature on document page
77
+ attr_accessor :vertical_alignment
78
+
79
+ # Gets or sets the space between Sign and Document edges (works ONLY if horizontal or vertical alignment are specified)
80
+ attr_accessor :margin
81
+
82
+ # Gets or sets the measure type (pixels or percent) for Margin
83
+ attr_accessor :margin_measure_type
84
+
85
+ # Gets or sets the signature transparency(value from 0.0 (opaque) through 1.0 (clear)). Default value is 0 (opaque).
86
+ attr_accessor :transparency
87
+
88
+ # Gets or sets the signature border properties
89
+ attr_accessor :border
90
+
91
+ # Gets or sets the reason of signature.
92
+ attr_accessor :reason
93
+
94
+ # Gets or sets the signature contact.
95
+ attr_accessor :contact
96
+
97
+ # Gets or sets the signature location.
98
+ attr_accessor :location
99
+
100
+ # Gets or sets the visibility of signature.
101
+ attr_accessor :visible
102
+
103
+ # Gets or sets the password of digital certificate
104
+ attr_accessor :password
105
+
106
+ # Gets or sets the digital certificate file GUID
107
+ attr_accessor :certificate_file_path
108
+
109
+ # XAdES type GroupDocs.Signature.Options.DigitalSignOptions.XAdESType. Default value is None (XAdES is off). At this moment XAdES signature type is supported only for Spreadsheet documents.
110
+ attr_accessor :x_ad_es_type
111
+ class EnumAttributeValidator
112
+ attr_reader :datatype
113
+ attr_reader :allowable_values
114
+
115
+ def initialize(datatype, allowable_values)
116
+ @allowable_values = allowable_values.map do |value|
117
+ case datatype.to_s
118
+ when /Integer/i
119
+ value.to_i
120
+ when /Float/i
121
+ value.to_f
122
+ else
123
+ value
124
+ end
125
+ end
126
+ end
127
+
128
+ def valid?(value)
129
+ !value || allowable_values.include?(value)
130
+ end
131
+ end
132
+
133
+ # Attribute mapping from ruby-style variable name to JSON key.
134
+ def self.attribute_map
135
+ {
136
+ :'signature_type' => :'SignatureType',
137
+ :'page' => :'Page',
138
+ :'all_pages' => :'AllPages',
139
+ :'pages_setup' => :'PagesSetup',
140
+ :'appearance' => :'Appearance',
141
+ :'image_file_path' => :'ImageFilePath',
142
+ :'left' => :'Left',
143
+ :'top' => :'Top',
144
+ :'width' => :'Width',
145
+ :'height' => :'Height',
146
+ :'location_measure_type' => :'LocationMeasureType',
147
+ :'size_measure_type' => :'SizeMeasureType',
148
+ :'rotation_angle' => :'RotationAngle',
149
+ :'horizontal_alignment' => :'HorizontalAlignment',
150
+ :'vertical_alignment' => :'VerticalAlignment',
151
+ :'margin' => :'Margin',
152
+ :'margin_measure_type' => :'MarginMeasureType',
153
+ :'transparency' => :'Transparency',
154
+ :'border' => :'Border',
155
+ :'reason' => :'Reason',
156
+ :'contact' => :'Contact',
157
+ :'location' => :'Location',
158
+ :'visible' => :'Visible',
159
+ :'password' => :'Password',
160
+ :'certificate_file_path' => :'CertificateFilePath',
161
+ :'x_ad_es_type' => :'XAdESType'
162
+ }
163
+ end
164
+
165
+ # Attribute type mapping.
166
+ def self.swagger_types
167
+ {
168
+ :'signature_type' => :'String',
169
+ :'page' => :'Integer',
170
+ :'all_pages' => :'BOOLEAN',
171
+ :'pages_setup' => :'PagesSetup',
172
+ :'appearance' => :'SignatureAppearance',
173
+ :'image_file_path' => :'String',
174
+ :'left' => :'Integer',
175
+ :'top' => :'Integer',
176
+ :'width' => :'Integer',
177
+ :'height' => :'Integer',
178
+ :'location_measure_type' => :'String',
179
+ :'size_measure_type' => :'String',
180
+ :'rotation_angle' => :'Integer',
181
+ :'horizontal_alignment' => :'String',
182
+ :'vertical_alignment' => :'String',
183
+ :'margin' => :'Padding',
184
+ :'margin_measure_type' => :'String',
185
+ :'transparency' => :'Float',
186
+ :'border' => :'BorderLine',
187
+ :'reason' => :'String',
188
+ :'contact' => :'String',
189
+ :'location' => :'String',
190
+ :'visible' => :'BOOLEAN',
191
+ :'password' => :'String',
192
+ :'certificate_file_path' => :'String',
193
+ :'x_ad_es_type' => :'String'
194
+ }
195
+ end
196
+
197
+ # Initializes the object
198
+ # @param [Hash] attributes Model attributes in the form of hash
199
+ def initialize(attributes = {})
200
+ return unless attributes.is_a?(Hash)
201
+
202
+ # convert string to symbol for hash key
203
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
204
+
205
+ if attributes.key?(:'SignatureType')
206
+ self.signature_type = attributes[:'SignatureType']
207
+ end
208
+
209
+ if attributes.key?(:'Page')
210
+ self.page = attributes[:'Page']
211
+ end
212
+
213
+ if attributes.key?(:'AllPages')
214
+ self.all_pages = attributes[:'AllPages']
215
+ end
216
+
217
+ if attributes.key?(:'PagesSetup')
218
+ self.pages_setup = attributes[:'PagesSetup']
219
+ end
220
+
221
+ if attributes.key?(:'Appearance')
222
+ self.appearance = attributes[:'Appearance']
223
+ end
224
+
225
+ if attributes.key?(:'ImageFilePath')
226
+ self.image_file_path = attributes[:'ImageFilePath']
227
+ end
228
+
229
+ if attributes.key?(:'Left')
230
+ self.left = attributes[:'Left']
231
+ end
232
+
233
+ if attributes.key?(:'Top')
234
+ self.top = attributes[:'Top']
235
+ end
236
+
237
+ if attributes.key?(:'Width')
238
+ self.width = attributes[:'Width']
239
+ end
240
+
241
+ if attributes.key?(:'Height')
242
+ self.height = attributes[:'Height']
243
+ end
244
+
245
+ if attributes.key?(:'LocationMeasureType')
246
+ self.location_measure_type = attributes[:'LocationMeasureType']
247
+ end
248
+
249
+ if attributes.key?(:'SizeMeasureType')
250
+ self.size_measure_type = attributes[:'SizeMeasureType']
251
+ end
252
+
253
+ if attributes.key?(:'RotationAngle')
254
+ self.rotation_angle = attributes[:'RotationAngle']
255
+ end
256
+
257
+ if attributes.key?(:'HorizontalAlignment')
258
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
259
+ end
260
+
261
+ if attributes.key?(:'VerticalAlignment')
262
+ self.vertical_alignment = attributes[:'VerticalAlignment']
263
+ end
264
+
265
+ if attributes.key?(:'Margin')
266
+ self.margin = attributes[:'Margin']
267
+ end
268
+
269
+ if attributes.key?(:'MarginMeasureType')
270
+ self.margin_measure_type = attributes[:'MarginMeasureType']
271
+ end
272
+
273
+ if attributes.key?(:'Transparency')
274
+ self.transparency = attributes[:'Transparency']
275
+ end
276
+
277
+ if attributes.key?(:'Border')
278
+ self.border = attributes[:'Border']
279
+ end
280
+
281
+ if attributes.key?(:'Reason')
282
+ self.reason = attributes[:'Reason']
283
+ end
284
+
285
+ if attributes.key?(:'Contact')
286
+ self.contact = attributes[:'Contact']
287
+ end
288
+
289
+ if attributes.key?(:'Location')
290
+ self.location = attributes[:'Location']
291
+ end
292
+
293
+ if attributes.key?(:'Visible')
294
+ self.visible = attributes[:'Visible']
295
+ end
296
+
297
+ if attributes.key?(:'Password')
298
+ self.password = attributes[:'Password']
299
+ end
300
+
301
+ if attributes.key?(:'CertificateFilePath')
302
+ self.certificate_file_path = attributes[:'CertificateFilePath']
303
+ end
304
+
305
+ if attributes.key?(:'XAdESType')
306
+ self.x_ad_es_type = attributes[:'XAdESType']
307
+ end
308
+
309
+ end
310
+
311
+ # Show invalid properties with the reasons. Usually used together with valid?
312
+ # @return Array for valid properies with the reasons
313
+ def list_invalid_properties
314
+ invalid_properties = []
315
+ if @signature_type.nil?
316
+ invalid_properties.push("invalid value for 'signature_type', signature_type cannot be nil.")
317
+ end
318
+
319
+ if @all_pages.nil?
320
+ invalid_properties.push("invalid value for 'all_pages', all_pages cannot be nil.")
321
+ end
322
+
323
+ if @left.nil?
324
+ invalid_properties.push("invalid value for 'left', left cannot be nil.")
325
+ end
326
+
327
+ if @top.nil?
328
+ invalid_properties.push("invalid value for 'top', top cannot be nil.")
329
+ end
330
+
331
+ if @width.nil?
332
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
333
+ end
334
+
335
+ if @height.nil?
336
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
337
+ end
338
+
339
+ if @location_measure_type.nil?
340
+ invalid_properties.push("invalid value for 'location_measure_type', location_measure_type cannot be nil.")
341
+ end
342
+
343
+ if @size_measure_type.nil?
344
+ invalid_properties.push("invalid value for 'size_measure_type', size_measure_type cannot be nil.")
345
+ end
346
+
347
+ if @rotation_angle.nil?
348
+ invalid_properties.push("invalid value for 'rotation_angle', rotation_angle cannot be nil.")
349
+ end
350
+
351
+ if @horizontal_alignment.nil?
352
+ invalid_properties.push("invalid value for 'horizontal_alignment', horizontal_alignment cannot be nil.")
353
+ end
354
+
355
+ if @vertical_alignment.nil?
356
+ invalid_properties.push("invalid value for 'vertical_alignment', vertical_alignment cannot be nil.")
357
+ end
358
+
359
+ if @margin_measure_type.nil?
360
+ invalid_properties.push("invalid value for 'margin_measure_type', margin_measure_type cannot be nil.")
361
+ end
362
+
363
+ if @transparency.nil?
364
+ invalid_properties.push("invalid value for 'transparency', transparency cannot be nil.")
365
+ end
366
+
367
+ if @visible.nil?
368
+ invalid_properties.push("invalid value for 'visible', visible cannot be nil.")
369
+ end
370
+
371
+ if @x_ad_es_type.nil?
372
+ invalid_properties.push("invalid value for 'x_ad_es_type', x_ad_es_type cannot be nil.")
373
+ end
374
+
375
+ return invalid_properties
376
+ end
377
+
378
+ # Check to see if the all the properties in the model are valid
379
+ # @return true if the model is valid
380
+ def valid?
381
+ return false if @signature_type.nil?
382
+ signature_type_validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp", "FormField", "Metadata"])
383
+ return false unless signature_type_validator.valid?(@signature_type)
384
+ return false if @all_pages.nil?
385
+ return false if @left.nil?
386
+ return false if @top.nil?
387
+ return false if @width.nil?
388
+ return false if @height.nil?
389
+ return false if @location_measure_type.nil?
390
+ location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
391
+ return false unless location_measure_type_validator.valid?(@location_measure_type)
392
+ return false if @size_measure_type.nil?
393
+ size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
394
+ return false unless size_measure_type_validator.valid?(@size_measure_type)
395
+ return false if @rotation_angle.nil?
396
+ return false if @horizontal_alignment.nil?
397
+ horizontal_alignment_validator = EnumAttributeValidator.new('String', ["None", "Left", "Center", "Right"])
398
+ return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
399
+ return false if @vertical_alignment.nil?
400
+ vertical_alignment_validator = EnumAttributeValidator.new('String', ["None", "Top", "Center", "Bottom"])
401
+ return false unless vertical_alignment_validator.valid?(@vertical_alignment)
402
+ return false if @margin_measure_type.nil?
403
+ margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
404
+ return false unless margin_measure_type_validator.valid?(@margin_measure_type)
405
+ return false if @transparency.nil?
406
+ return false if @visible.nil?
407
+ return false if @x_ad_es_type.nil?
408
+ x_ad_es_type_validator = EnumAttributeValidator.new('String', ["None", "XAdES"])
409
+ return false unless x_ad_es_type_validator.valid?(@x_ad_es_type)
410
+ return true
411
+ end
412
+
413
+ # Custom attribute writer method checking allowed values (enum).
414
+ # @param [Object] signature_type Object to be assigned
415
+ def signature_type=(signature_type)
416
+ validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp", "FormField", "Metadata"])
417
+ if signature_type.to_i == 0
418
+ unless validator.valid?(signature_type)
419
+ raise ArgumentError, "invalid value for 'signature_type', must be one of #{validator.allowable_values}."
420
+ end
421
+ @signature_type = signature_type
422
+ else
423
+ @signature_type = validator.allowable_values[signature_type.to_i]
424
+ end
425
+ end
426
+
427
+ # Custom attribute writer method checking allowed values (enum).
428
+ # @param [Object] location_measure_type Object to be assigned
429
+ def location_measure_type=(location_measure_type)
430
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
431
+ if location_measure_type.to_i == 0
432
+ unless validator.valid?(location_measure_type)
433
+ raise ArgumentError, "invalid value for 'location_measure_type', must be one of #{validator.allowable_values}."
434
+ end
435
+ @location_measure_type = location_measure_type
436
+ else
437
+ @location_measure_type = validator.allowable_values[location_measure_type.to_i]
438
+ end
439
+ end
440
+
441
+ # Custom attribute writer method checking allowed values (enum).
442
+ # @param [Object] size_measure_type Object to be assigned
443
+ def size_measure_type=(size_measure_type)
444
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
445
+ if size_measure_type.to_i == 0
446
+ unless validator.valid?(size_measure_type)
447
+ raise ArgumentError, "invalid value for 'size_measure_type', must be one of #{validator.allowable_values}."
448
+ end
449
+ @size_measure_type = size_measure_type
450
+ else
451
+ @size_measure_type = validator.allowable_values[size_measure_type.to_i]
452
+ end
453
+ end
454
+
455
+ # Custom attribute writer method checking allowed values (enum).
456
+ # @param [Object] horizontal_alignment Object to be assigned
457
+ def horizontal_alignment=(horizontal_alignment)
458
+ validator = EnumAttributeValidator.new('String', ["None", "Left", "Center", "Right"])
459
+ if horizontal_alignment.to_i == 0
460
+ unless validator.valid?(horizontal_alignment)
461
+ raise ArgumentError, "invalid value for 'horizontal_alignment', must be one of #{validator.allowable_values}."
462
+ end
463
+ @horizontal_alignment = horizontal_alignment
464
+ else
465
+ @horizontal_alignment = validator.allowable_values[horizontal_alignment.to_i]
466
+ end
467
+ end
468
+
469
+ # Custom attribute writer method checking allowed values (enum).
470
+ # @param [Object] vertical_alignment Object to be assigned
471
+ def vertical_alignment=(vertical_alignment)
472
+ validator = EnumAttributeValidator.new('String', ["None", "Top", "Center", "Bottom"])
473
+ if vertical_alignment.to_i == 0
474
+ unless validator.valid?(vertical_alignment)
475
+ raise ArgumentError, "invalid value for 'vertical_alignment', must be one of #{validator.allowable_values}."
476
+ end
477
+ @vertical_alignment = vertical_alignment
478
+ else
479
+ @vertical_alignment = validator.allowable_values[vertical_alignment.to_i]
480
+ end
481
+ end
482
+
483
+ # Custom attribute writer method checking allowed values (enum).
484
+ # @param [Object] margin_measure_type Object to be assigned
485
+ def margin_measure_type=(margin_measure_type)
486
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
487
+ if margin_measure_type.to_i == 0
488
+ unless validator.valid?(margin_measure_type)
489
+ raise ArgumentError, "invalid value for 'margin_measure_type', must be one of #{validator.allowable_values}."
490
+ end
491
+ @margin_measure_type = margin_measure_type
492
+ else
493
+ @margin_measure_type = validator.allowable_values[margin_measure_type.to_i]
494
+ end
495
+ end
496
+
497
+ # Custom attribute writer method checking allowed values (enum).
498
+ # @param [Object] x_ad_es_type Object to be assigned
499
+ def x_ad_es_type=(x_ad_es_type)
500
+ validator = EnumAttributeValidator.new('String', ["None", "XAdES"])
501
+ if x_ad_es_type.to_i == 0
502
+ unless validator.valid?(x_ad_es_type)
503
+ raise ArgumentError, "invalid value for 'x_ad_es_type', must be one of #{validator.allowable_values}."
504
+ end
505
+ @x_ad_es_type = x_ad_es_type
506
+ else
507
+ @x_ad_es_type = validator.allowable_values[x_ad_es_type.to_i]
508
+ end
509
+ end
510
+
511
+ # Checks equality by comparing each attribute.
512
+ # @param [Object] Object to be compared
513
+ def ==(other)
514
+ return true if self.equal?(other)
515
+ self.class == other.class &&
516
+ signature_type == other.signature_type &&
517
+ page == other.page &&
518
+ all_pages == other.all_pages &&
519
+ pages_setup == other.pages_setup &&
520
+ appearance == other.appearance &&
521
+ image_file_path == other.image_file_path &&
522
+ left == other.left &&
523
+ top == other.top &&
524
+ width == other.width &&
525
+ height == other.height &&
526
+ location_measure_type == other.location_measure_type &&
527
+ size_measure_type == other.size_measure_type &&
528
+ rotation_angle == other.rotation_angle &&
529
+ horizontal_alignment == other.horizontal_alignment &&
530
+ vertical_alignment == other.vertical_alignment &&
531
+ margin == other.margin &&
532
+ margin_measure_type == other.margin_measure_type &&
533
+ transparency == other.transparency &&
534
+ border == other.border &&
535
+ reason == other.reason &&
536
+ contact == other.contact &&
537
+ location == other.location &&
538
+ visible == other.visible &&
539
+ password == other.password &&
540
+ certificate_file_path == other.certificate_file_path &&
541
+ x_ad_es_type == other.x_ad_es_type
542
+ end
543
+
544
+ # @see the `==` method
545
+ # @param [Object] Object to be compared
546
+ def eql?(other)
547
+ self == other
548
+ end
549
+
550
+ # Calculates hash code according to all attributes.
551
+ # @return [Fixnum] Hash code
552
+ def hash
553
+ [signature_type, page, all_pages, pages_setup, appearance, image_file_path, left, top, width, height, location_measure_type, size_measure_type, rotation_angle, horizontal_alignment, vertical_alignment, margin, margin_measure_type, transparency, border, reason, contact, location, visible, password, certificate_file_path, x_ad_es_type].hash
554
+ end
555
+
556
+ # Downcases first letter.
557
+ # @return downcased string
558
+ def uncap(str)
559
+ str[0, 1].downcase + str[1..-1]
560
+ end
561
+
562
+ # Builds the object from hash
563
+ # @param [Hash] attributes Model attributes in the form of hash
564
+ # @return [Object] Returns the model itself
565
+ def build_from_hash(attributes)
566
+ return nil unless attributes.is_a?(Hash)
567
+ self.class.swagger_types.each_pair do |key, type|
568
+ pname = uncap(self.class.attribute_map[key]).intern
569
+ value = attributes[pname]
570
+ if type =~ /\AArray<(.*)>/i
571
+ # check to ensure the input is an array given that the the attribute
572
+ # is documented as an array but the input is not
573
+ if value.is_a?(Array)
574
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
575
+ end
576
+ elsif !value.nil?
577
+ self.send("#{key}=", _deserialize(type, value))
578
+ end
579
+ # or else data not found in attributes(hash), not an issue as the data can be optional
580
+ end
581
+
582
+ self
583
+ end
584
+
585
+ # Deserializes the data based on type
586
+ # @param string type Data type
587
+ # @param string value Value to be deserialized
588
+ # @return [Object] Deserialized data
589
+ def _deserialize(type, value)
590
+ case type.to_sym
591
+ when :DateTime
592
+ Date.parse value
593
+ when :Date
594
+ Date.parse value
595
+ when :String
596
+ value.to_s
597
+ when :Integer
598
+ value.to_i
599
+ when :Float
600
+ value.to_f
601
+ when :BOOLEAN
602
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
603
+ true
604
+ else
605
+ false
606
+ end
607
+ when :Object
608
+ # generic object (usually a Hash), return directly
609
+ value
610
+ when /\AArray<(?<inner_type>.+)>\z/
611
+ inner_type = Regexp.last_match[:inner_type]
612
+ value.map { |v| _deserialize(inner_type, v) }
613
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
614
+ k_type = Regexp.last_match[:k_type]
615
+ v_type = Regexp.last_match[:v_type]
616
+ {}.tap do |hash|
617
+ value.each do |k, v|
618
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
619
+ end
620
+ end
621
+ else
622
+ # model
623
+ # Signature type fix
624
+ ttype = type
625
+ if value.is_a?(Hash) and !value[:signatureType].nil?
626
+ ttype = value[:signatureType] + 'Signature'
627
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
628
+ type = value[:type]
629
+ if type == 'Checkbox'
630
+ ttype = 'CheckboxFormFieldSignature'
631
+ end
632
+ if type == 'Text'
633
+ ttype = 'TextFormFieldSignature'
634
+ end
635
+ if type == 'Combobox'
636
+ ttype = 'ComboboxFormFieldSignature'
637
+ end
638
+ if type == 'DigitalSignature'
639
+ ttype = 'DigitalFormFieldSignature'
640
+ end
641
+ if type == 'Radio'
642
+ ttype = 'RadioButtonFormFieldSignature'
643
+ end
644
+ end
645
+ end
646
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
647
+ temp_model.build_from_hash(value)
648
+ end
649
+ end
650
+
651
+ # Returns the string representation of the object
652
+ # @return [String] String presentation of the object
653
+ def to_s
654
+ to_hash.to_s
655
+ end
656
+
657
+ # to_body is an alias to to_hash (backward compatibility)
658
+ # @return [Hash] Returns the object in the form of hash
659
+ def to_body
660
+ to_hash
661
+ end
662
+
663
+ # Returns the object in the form of hash
664
+ # @return [Hash] Returns the object in the form of hash
665
+ def to_hash
666
+ hash = {}
667
+ self.class.attribute_map.each_pair do |attr, param|
668
+ value = self.send(attr)
669
+ next if value.nil?
670
+ hash[param] = _to_hash(value)
671
+ end
672
+ hash
673
+ end
674
+
675
+ # Outputs non-array value in the form of hash
676
+ # For object, use to_hash. Otherwise, just return the value
677
+ # @param [Object] value Any valid value
678
+ # @return [Hash] Returns the value in the form of hash
679
+ def _to_hash(value)
680
+ if value.is_a?(Array)
681
+ value.compact.map { |v| _to_hash(v) }
682
+ elsif value.is_a?(Hash)
683
+ {}.tap do |hash|
684
+ value.each { |k, v| hash[k] = _to_hash(v) }
685
+ end
686
+ elsif value.respond_to? :to_hash
687
+ value.to_hash
688
+ else
689
+ value
690
+ end
691
+ end
692
+
693
+ end
694
+
695
+ end