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,592 +1,599 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="sign_stamp_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 Stamp Signature Options.
32
- class SignStampOptionsData
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
- # List of Outer Lines rendered as concentric circles.
86
- attr_accessor :outer_lines
87
-
88
- # List of Inner Lines rendered as set of rectangles.
89
- attr_accessor :inner_lines
90
-
91
- # Gets or sets the background color of signature.
92
- attr_accessor :background_color
93
-
94
- # Gets or sets the signature background brush. Value by default is null. When property has a value it is used instead BackgroundBrush property.
95
- attr_accessor :background_brush
96
-
97
- # Gets or sets the background color crop type of signature.
98
- attr_accessor :background_color_crop_type
99
-
100
- # Gets or sets the background image crop type of signature.
101
- attr_accessor :background_image_crop_type
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
- :'outer_lines' => :'OuterLines',
145
- :'inner_lines' => :'InnerLines',
146
- :'background_color' => :'BackgroundColor',
147
- :'background_brush' => :'BackgroundBrush',
148
- :'background_color_crop_type' => :'BackgroundColorCropType',
149
- :'background_image_crop_type' => :'BackgroundImageCropType'
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
- :'outer_lines' => :'Array<StampLineData>',
174
- :'inner_lines' => :'Array<StampLineData>',
175
- :'background_color' => :'Color',
176
- :'background_brush' => :'BrushData',
177
- :'background_color_crop_type' => :'String',
178
- :'background_image_crop_type' => :'String'
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?(:'OuterLines')
259
- if (value = attributes[:'OuterLines']).is_a?(Array)
260
- self.outer_lines = value
261
- end
262
- end
263
-
264
- if attributes.key?(:'InnerLines')
265
- if (value = attributes[:'InnerLines']).is_a?(Array)
266
- self.inner_lines = value
267
- end
268
- end
269
-
270
- if attributes.key?(:'BackgroundColor')
271
- self.background_color = attributes[:'BackgroundColor']
272
- end
273
-
274
- if attributes.key?(:'BackgroundBrush')
275
- self.background_brush = attributes[:'BackgroundBrush']
276
- end
277
-
278
- if attributes.key?(:'BackgroundColorCropType')
279
- self.background_color_crop_type = attributes[:'BackgroundColorCropType']
280
- end
281
-
282
- if attributes.key?(:'BackgroundImageCropType')
283
- self.background_image_crop_type = attributes[:'BackgroundImageCropType']
284
- end
285
-
286
-
287
- if !((defined? options_type) == nil)
288
- self.options_type = "SignStampOptionsData"
289
- end
290
-
291
- end
292
-
293
- # Show invalid properties with the reasons. Usually used together with valid?
294
- # @return Array for valid properies with the reasons
295
- def list_invalid_properties
296
- invalid_properties = []
297
- if @document_page_number.nil?
298
- invalid_properties.push("invalid value for 'document_page_number', document_page_number cannot be nil.")
299
- end
300
-
301
- return invalid_properties
302
- end
303
-
304
- # Check to see if the all the properties in the model are valid
305
- # @return true if the model is valid
306
- def valid?
307
- return false if @document_page_number.nil?
308
- location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
309
- return false unless location_measure_type_validator.valid?(@location_measure_type)
310
- size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
311
- return false unless size_measure_type_validator.valid?(@size_measure_type)
312
- horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
313
- return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
314
- vertical_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
315
- return false unless vertical_alignment_validator.valid?(@vertical_alignment)
316
- margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
317
- return false unless margin_measure_type_validator.valid?(@margin_measure_type)
318
- background_color_crop_type_validator = EnumAttributeValidator.new('String', ["None", "OuterArea", "MiddleArea", "InnerArea"])
319
- return false unless background_color_crop_type_validator.valid?(@background_color_crop_type)
320
- background_image_crop_type_validator = EnumAttributeValidator.new('String', ["None", "OuterArea", "MiddleArea", "InnerArea"])
321
- return false unless background_image_crop_type_validator.valid?(@background_image_crop_type)
322
- return true
323
- end
324
-
325
- # Custom attribute writer method checking allowed values (enum).
326
- # @param [Object] location_measure_type Object to be assigned
327
- def location_measure_type=(location_measure_type)
328
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
329
- if location_measure_type.to_i == 0
330
- unless validator.valid?(location_measure_type)
331
- raise ArgumentError, "invalid value for 'location_measure_type', must be one of #{validator.allowable_values}."
332
- end
333
- @location_measure_type = location_measure_type
334
- else
335
- @location_measure_type = validator.allowable_values[location_measure_type.to_i]
336
- end
337
- end
338
-
339
- # Custom attribute writer method checking allowed values (enum).
340
- # @param [Object] size_measure_type Object to be assigned
341
- def size_measure_type=(size_measure_type)
342
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
343
- if size_measure_type.to_i == 0
344
- unless validator.valid?(size_measure_type)
345
- raise ArgumentError, "invalid value for 'size_measure_type', must be one of #{validator.allowable_values}."
346
- end
347
- @size_measure_type = size_measure_type
348
- else
349
- @size_measure_type = validator.allowable_values[size_measure_type.to_i]
350
- end
351
- end
352
-
353
- # Custom attribute writer method checking allowed values (enum).
354
- # @param [Object] horizontal_alignment Object to be assigned
355
- def horizontal_alignment=(horizontal_alignment)
356
- validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
357
- if horizontal_alignment.to_i == 0
358
- unless validator.valid?(horizontal_alignment)
359
- raise ArgumentError, "invalid value for 'horizontal_alignment', must be one of #{validator.allowable_values}."
360
- end
361
- @horizontal_alignment = horizontal_alignment
362
- else
363
- @horizontal_alignment = validator.allowable_values[horizontal_alignment.to_i]
364
- end
365
- end
366
-
367
- # Custom attribute writer method checking allowed values (enum).
368
- # @param [Object] vertical_alignment Object to be assigned
369
- def vertical_alignment=(vertical_alignment)
370
- validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
371
- if vertical_alignment.to_i == 0
372
- unless validator.valid?(vertical_alignment)
373
- raise ArgumentError, "invalid value for 'vertical_alignment', must be one of #{validator.allowable_values}."
374
- end
375
- @vertical_alignment = vertical_alignment
376
- else
377
- @vertical_alignment = validator.allowable_values[vertical_alignment.to_i]
378
- end
379
- end
380
-
381
- # Custom attribute writer method checking allowed values (enum).
382
- # @param [Object] margin_measure_type Object to be assigned
383
- def margin_measure_type=(margin_measure_type)
384
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
385
- if margin_measure_type.to_i == 0
386
- unless validator.valid?(margin_measure_type)
387
- raise ArgumentError, "invalid value for 'margin_measure_type', must be one of #{validator.allowable_values}."
388
- end
389
- @margin_measure_type = margin_measure_type
390
- else
391
- @margin_measure_type = validator.allowable_values[margin_measure_type.to_i]
392
- end
393
- end
394
-
395
- # Custom attribute writer method checking allowed values (enum).
396
- # @param [Object] background_color_crop_type Object to be assigned
397
- def background_color_crop_type=(background_color_crop_type)
398
- validator = EnumAttributeValidator.new('String', ["None", "OuterArea", "MiddleArea", "InnerArea"])
399
- if background_color_crop_type.to_i == 0
400
- unless validator.valid?(background_color_crop_type)
401
- raise ArgumentError, "invalid value for 'background_color_crop_type', must be one of #{validator.allowable_values}."
402
- end
403
- @background_color_crop_type = background_color_crop_type
404
- else
405
- @background_color_crop_type = validator.allowable_values[background_color_crop_type.to_i]
406
- end
407
- end
408
-
409
- # Custom attribute writer method checking allowed values (enum).
410
- # @param [Object] background_image_crop_type Object to be assigned
411
- def background_image_crop_type=(background_image_crop_type)
412
- validator = EnumAttributeValidator.new('String', ["None", "OuterArea", "MiddleArea", "InnerArea"])
413
- if background_image_crop_type.to_i == 0
414
- unless validator.valid?(background_image_crop_type)
415
- raise ArgumentError, "invalid value for 'background_image_crop_type', must be one of #{validator.allowable_values}."
416
- end
417
- @background_image_crop_type = background_image_crop_type
418
- else
419
- @background_image_crop_type = validator.allowable_values[background_image_crop_type.to_i]
420
- end
421
- end
422
-
423
- # Checks equality by comparing each attribute.
424
- # @param [Object] Object to be compared
425
- def ==(other)
426
- return true if self.equal?(other)
427
- self.class == other.class &&
428
- document_page_number == other.document_page_number &&
429
- pages_setup == other.pages_setup &&
430
- options_type == other.options_type &&
431
- image_guid == other.image_guid &&
432
- left == other.left &&
433
- top == other.top &&
434
- width == other.width &&
435
- height == other.height &&
436
- location_measure_type == other.location_measure_type &&
437
- size_measure_type == other.size_measure_type &&
438
- rotation_angle == other.rotation_angle &&
439
- horizontal_alignment == other.horizontal_alignment &&
440
- vertical_alignment == other.vertical_alignment &&
441
- margin == other.margin &&
442
- margin_measure_type == other.margin_measure_type &&
443
- opacity == other.opacity &&
444
- sign_all_pages == other.sign_all_pages &&
445
- outer_lines == other.outer_lines &&
446
- inner_lines == other.inner_lines &&
447
- background_color == other.background_color &&
448
- background_brush == other.background_brush &&
449
- background_color_crop_type == other.background_color_crop_type &&
450
- background_image_crop_type == other.background_image_crop_type
451
- end
452
-
453
- # @see the `==` method
454
- # @param [Object] Object to be compared
455
- def eql?(other)
456
- self == other
457
- end
458
-
459
- # Calculates hash code according to all attributes.
460
- # @return [Fixnum] Hash code
461
- def hash
462
- [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, outer_lines, inner_lines, background_color, background_brush, background_color_crop_type, background_image_crop_type].hash
463
- end
464
-
465
- # Builds the object from hash
466
- # @param [Hash] attributes Model attributes in the form of hash
467
- # @return [Object] Returns the model itself
468
- def build_from_hash(attributes)
469
- return nil unless attributes.is_a?(Hash)
470
- self.class.swagger_types.each_pair do |key, type|
471
-
472
- attributeName = self.class.attribute_map[key]
473
- attributeNameLowerStr = attributeName.to_s
474
- attributeNameLowerStr[0] = attributeNameLowerStr[0].downcase
475
- attributeNameLower = attributeNameLowerStr.to_sym
476
- attributeNameLowerStr2 = attributeName.to_s
477
- attributeNameLowerStr2[0] = attributeNameLowerStr[0].downcase
478
- attributeNameLowerStr2[1] = attributeNameLowerStr[1].downcase
479
- attributeNameLower2 = attributeNameLowerStr2.to_sym
480
-
481
- if type =~ /\AArray<(.*)>/i
482
- # check to ensure the input is an array given that the the attribute
483
- # is documented as an array but the input is not
484
- if attributes[attributeName].is_a?(Array)
485
- self.send("#{key}=", attributes[attributeName].map { |v| _deserialize($1, v) })
486
- end
487
- if attributes[attributeNameLower].is_a?(Array)
488
- self.send("#{key}=", attributes[attributeNameLower].map { |v| _deserialize($1, v) })
489
- end
490
- if attributes[attributeNameLower2].is_a?(Array)
491
- self.send("#{key}=", attributes[attributeNameLower2].map { |v| _deserialize($1, v) })
492
- end
493
- elsif !attributes[attributeName].nil?
494
- self.send("#{key}=", _deserialize(type, attributes[attributeName]))
495
- elsif !attributes[attributeNameLower].nil?
496
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower]))
497
- elsif !attributes[attributeNameLower2].nil?
498
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower2]))
499
- end
500
- # or else data not found in attributes(hash), not an issue as the data can be optional
501
- end
502
- self
503
- end
504
-
505
- # Deserializes the data based on type
506
- # @param string type Data type
507
- # @param string value Value to be deserialized
508
- # @return [Object] Deserialized data
509
- def _deserialize(type, value)
510
- case type.to_sym
511
- when :DateTime
512
- Time.at(/\d/.match(value)[0].to_f).to_datetime
513
- when :Date
514
- Time.at(/\d/.match(value)[0].to_f).to_date
515
- when :String
516
- value.to_s
517
- when :Integer
518
- value.to_i
519
- when :Float
520
- value.to_f
521
- when :BOOLEAN
522
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
523
- true
524
- else
525
- false
526
- end
527
- when :Object
528
- # generic object (usually a Hash), return directly
529
- value
530
- when /\AArray<(?<inner_type>.+)>\z/
531
- inner_type = Regexp.last_match[:inner_type]
532
- value.map { |v| _deserialize(inner_type, v) }
533
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
534
- k_type = Regexp.last_match[:k_type]
535
- v_type = Regexp.last_match[:v_type]
536
- {}.tap do |hash|
537
- value.each do |k, v|
538
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
539
- end
540
- end
541
- else
542
- # model
543
- temp_model = GroupDocsSignatureCloud.const_get(type).new
544
- temp_model.build_from_hash(value)
545
- end
546
- end
547
-
548
- # Returns the string representation of the object
549
- # @return [String] String presentation of the object
550
- def to_s
551
- to_hash.to_s
552
- end
553
-
554
- # to_body is an alias to to_hash (backward compatibility)
555
- # @return [Hash] Returns the object in the form of hash
556
- def to_body
557
- to_hash
558
- end
559
-
560
- # Returns the object in the form of hash
561
- # @return [Hash] Returns the object in the form of hash
562
- def to_hash
563
- hash = {}
564
- self.class.attribute_map.each_pair do |attr, param|
565
- value = self.send(attr)
566
- next if value.nil?
567
- hash[param] = _to_hash(value)
568
- end
569
- hash
570
- end
571
-
572
- # Outputs non-array value in the form of hash
573
- # For object, use to_hash. Otherwise, just return the value
574
- # @param [Object] value Any valid value
575
- # @return [Hash] Returns the value in the form of hash
576
- def _to_hash(value)
577
- if value.is_a?(Array)
578
- value.compact.map { |v| _to_hash(v) }
579
- elsif value.is_a?(Hash)
580
- {}.tap do |hash|
581
- value.each { |k, v| hash[k] = _to_hash(v) }
582
- end
583
- elsif value.respond_to? :to_hash
584
- value.to_hash
585
- else
586
- value
587
- end
588
- end
589
-
590
- end
591
-
592
- end
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="sign_image_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 Image sign options
32
+ class SignImageOptions
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
+ class EnumAttributeValidator
91
+ attr_reader :datatype
92
+ attr_reader :allowable_values
93
+
94
+ def initialize(datatype, allowable_values)
95
+ @allowable_values = allowable_values.map do |value|
96
+ case datatype.to_s
97
+ when /Integer/i
98
+ value.to_i
99
+ when /Float/i
100
+ value.to_f
101
+ else
102
+ value
103
+ end
104
+ end
105
+ end
106
+
107
+ def valid?(value)
108
+ !value || allowable_values.include?(value)
109
+ end
110
+ end
111
+
112
+ # Attribute mapping from ruby-style variable name to JSON key.
113
+ def self.attribute_map
114
+ {
115
+ :'signature_type' => :'SignatureType',
116
+ :'page' => :'Page',
117
+ :'all_pages' => :'AllPages',
118
+ :'pages_setup' => :'PagesSetup',
119
+ :'appearance' => :'Appearance',
120
+ :'image_file_path' => :'ImageFilePath',
121
+ :'left' => :'Left',
122
+ :'top' => :'Top',
123
+ :'width' => :'Width',
124
+ :'height' => :'Height',
125
+ :'location_measure_type' => :'LocationMeasureType',
126
+ :'size_measure_type' => :'SizeMeasureType',
127
+ :'rotation_angle' => :'RotationAngle',
128
+ :'horizontal_alignment' => :'HorizontalAlignment',
129
+ :'vertical_alignment' => :'VerticalAlignment',
130
+ :'margin' => :'Margin',
131
+ :'margin_measure_type' => :'MarginMeasureType',
132
+ :'transparency' => :'Transparency',
133
+ :'border' => :'Border'
134
+ }
135
+ end
136
+
137
+ # Attribute type mapping.
138
+ def self.swagger_types
139
+ {
140
+ :'signature_type' => :'String',
141
+ :'page' => :'Integer',
142
+ :'all_pages' => :'BOOLEAN',
143
+ :'pages_setup' => :'PagesSetup',
144
+ :'appearance' => :'SignatureAppearance',
145
+ :'image_file_path' => :'String',
146
+ :'left' => :'Integer',
147
+ :'top' => :'Integer',
148
+ :'width' => :'Integer',
149
+ :'height' => :'Integer',
150
+ :'location_measure_type' => :'String',
151
+ :'size_measure_type' => :'String',
152
+ :'rotation_angle' => :'Integer',
153
+ :'horizontal_alignment' => :'String',
154
+ :'vertical_alignment' => :'String',
155
+ :'margin' => :'Padding',
156
+ :'margin_measure_type' => :'String',
157
+ :'transparency' => :'Float',
158
+ :'border' => :'BorderLine'
159
+ }
160
+ end
161
+
162
+ # Initializes the object
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ def initialize(attributes = {})
165
+ return unless attributes.is_a?(Hash)
166
+
167
+ # convert string to symbol for hash key
168
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
169
+
170
+ if attributes.key?(:'SignatureType')
171
+ self.signature_type = attributes[:'SignatureType']
172
+ end
173
+
174
+ if attributes.key?(:'Page')
175
+ self.page = attributes[:'Page']
176
+ end
177
+
178
+ if attributes.key?(:'AllPages')
179
+ self.all_pages = attributes[:'AllPages']
180
+ end
181
+
182
+ if attributes.key?(:'PagesSetup')
183
+ self.pages_setup = attributes[:'PagesSetup']
184
+ end
185
+
186
+ if attributes.key?(:'Appearance')
187
+ self.appearance = attributes[:'Appearance']
188
+ end
189
+
190
+ if attributes.key?(:'ImageFilePath')
191
+ self.image_file_path = attributes[:'ImageFilePath']
192
+ end
193
+
194
+ if attributes.key?(:'Left')
195
+ self.left = attributes[:'Left']
196
+ end
197
+
198
+ if attributes.key?(:'Top')
199
+ self.top = attributes[:'Top']
200
+ end
201
+
202
+ if attributes.key?(:'Width')
203
+ self.width = attributes[:'Width']
204
+ end
205
+
206
+ if attributes.key?(:'Height')
207
+ self.height = attributes[:'Height']
208
+ end
209
+
210
+ if attributes.key?(:'LocationMeasureType')
211
+ self.location_measure_type = attributes[:'LocationMeasureType']
212
+ end
213
+
214
+ if attributes.key?(:'SizeMeasureType')
215
+ self.size_measure_type = attributes[:'SizeMeasureType']
216
+ end
217
+
218
+ if attributes.key?(:'RotationAngle')
219
+ self.rotation_angle = attributes[:'RotationAngle']
220
+ end
221
+
222
+ if attributes.key?(:'HorizontalAlignment')
223
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
224
+ end
225
+
226
+ if attributes.key?(:'VerticalAlignment')
227
+ self.vertical_alignment = attributes[:'VerticalAlignment']
228
+ end
229
+
230
+ if attributes.key?(:'Margin')
231
+ self.margin = attributes[:'Margin']
232
+ end
233
+
234
+ if attributes.key?(:'MarginMeasureType')
235
+ self.margin_measure_type = attributes[:'MarginMeasureType']
236
+ end
237
+
238
+ if attributes.key?(:'Transparency')
239
+ self.transparency = attributes[:'Transparency']
240
+ end
241
+
242
+ if attributes.key?(:'Border')
243
+ self.border = attributes[:'Border']
244
+ end
245
+
246
+ end
247
+
248
+ # Show invalid properties with the reasons. Usually used together with valid?
249
+ # @return Array for valid properies with the reasons
250
+ def list_invalid_properties
251
+ invalid_properties = []
252
+ if @signature_type.nil?
253
+ invalid_properties.push("invalid value for 'signature_type', signature_type cannot be nil.")
254
+ end
255
+
256
+ if @all_pages.nil?
257
+ invalid_properties.push("invalid value for 'all_pages', all_pages cannot be nil.")
258
+ end
259
+
260
+ if @left.nil?
261
+ invalid_properties.push("invalid value for 'left', left cannot be nil.")
262
+ end
263
+
264
+ if @top.nil?
265
+ invalid_properties.push("invalid value for 'top', top cannot be nil.")
266
+ end
267
+
268
+ if @width.nil?
269
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
270
+ end
271
+
272
+ if @height.nil?
273
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
274
+ end
275
+
276
+ if @location_measure_type.nil?
277
+ invalid_properties.push("invalid value for 'location_measure_type', location_measure_type cannot be nil.")
278
+ end
279
+
280
+ if @size_measure_type.nil?
281
+ invalid_properties.push("invalid value for 'size_measure_type', size_measure_type cannot be nil.")
282
+ end
283
+
284
+ if @rotation_angle.nil?
285
+ invalid_properties.push("invalid value for 'rotation_angle', rotation_angle cannot be nil.")
286
+ end
287
+
288
+ if @horizontal_alignment.nil?
289
+ invalid_properties.push("invalid value for 'horizontal_alignment', horizontal_alignment cannot be nil.")
290
+ end
291
+
292
+ if @vertical_alignment.nil?
293
+ invalid_properties.push("invalid value for 'vertical_alignment', vertical_alignment cannot be nil.")
294
+ end
295
+
296
+ if @margin_measure_type.nil?
297
+ invalid_properties.push("invalid value for 'margin_measure_type', margin_measure_type cannot be nil.")
298
+ end
299
+
300
+ if @transparency.nil?
301
+ invalid_properties.push("invalid value for 'transparency', transparency cannot be nil.")
302
+ end
303
+
304
+ return invalid_properties
305
+ end
306
+
307
+ # Check to see if the all the properties in the model are valid
308
+ # @return true if the model is valid
309
+ def valid?
310
+ return false if @signature_type.nil?
311
+ signature_type_validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp", "FormField", "Metadata"])
312
+ return false unless signature_type_validator.valid?(@signature_type)
313
+ return false if @all_pages.nil?
314
+ return false if @left.nil?
315
+ return false if @top.nil?
316
+ return false if @width.nil?
317
+ return false if @height.nil?
318
+ return false if @location_measure_type.nil?
319
+ location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
320
+ return false unless location_measure_type_validator.valid?(@location_measure_type)
321
+ return false if @size_measure_type.nil?
322
+ size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
323
+ return false unless size_measure_type_validator.valid?(@size_measure_type)
324
+ return false if @rotation_angle.nil?
325
+ return false if @horizontal_alignment.nil?
326
+ horizontal_alignment_validator = EnumAttributeValidator.new('String', ["None", "Left", "Center", "Right"])
327
+ return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
328
+ return false if @vertical_alignment.nil?
329
+ vertical_alignment_validator = EnumAttributeValidator.new('String', ["None", "Top", "Center", "Bottom"])
330
+ return false unless vertical_alignment_validator.valid?(@vertical_alignment)
331
+ return false if @margin_measure_type.nil?
332
+ margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
333
+ return false unless margin_measure_type_validator.valid?(@margin_measure_type)
334
+ return false if @transparency.nil?
335
+ return true
336
+ end
337
+
338
+ # Custom attribute writer method checking allowed values (enum).
339
+ # @param [Object] signature_type Object to be assigned
340
+ def signature_type=(signature_type)
341
+ validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp", "FormField", "Metadata"])
342
+ if signature_type.to_i == 0
343
+ unless validator.valid?(signature_type)
344
+ raise ArgumentError, "invalid value for 'signature_type', must be one of #{validator.allowable_values}."
345
+ end
346
+ @signature_type = signature_type
347
+ else
348
+ @signature_type = validator.allowable_values[signature_type.to_i]
349
+ end
350
+ end
351
+
352
+ # Custom attribute writer method checking allowed values (enum).
353
+ # @param [Object] location_measure_type Object to be assigned
354
+ def location_measure_type=(location_measure_type)
355
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
356
+ if location_measure_type.to_i == 0
357
+ unless validator.valid?(location_measure_type)
358
+ raise ArgumentError, "invalid value for 'location_measure_type', must be one of #{validator.allowable_values}."
359
+ end
360
+ @location_measure_type = location_measure_type
361
+ else
362
+ @location_measure_type = validator.allowable_values[location_measure_type.to_i]
363
+ end
364
+ end
365
+
366
+ # Custom attribute writer method checking allowed values (enum).
367
+ # @param [Object] size_measure_type Object to be assigned
368
+ def size_measure_type=(size_measure_type)
369
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
370
+ if size_measure_type.to_i == 0
371
+ unless validator.valid?(size_measure_type)
372
+ raise ArgumentError, "invalid value for 'size_measure_type', must be one of #{validator.allowable_values}."
373
+ end
374
+ @size_measure_type = size_measure_type
375
+ else
376
+ @size_measure_type = validator.allowable_values[size_measure_type.to_i]
377
+ end
378
+ end
379
+
380
+ # Custom attribute writer method checking allowed values (enum).
381
+ # @param [Object] horizontal_alignment Object to be assigned
382
+ def horizontal_alignment=(horizontal_alignment)
383
+ validator = EnumAttributeValidator.new('String', ["None", "Left", "Center", "Right"])
384
+ if horizontal_alignment.to_i == 0
385
+ unless validator.valid?(horizontal_alignment)
386
+ raise ArgumentError, "invalid value for 'horizontal_alignment', must be one of #{validator.allowable_values}."
387
+ end
388
+ @horizontal_alignment = horizontal_alignment
389
+ else
390
+ @horizontal_alignment = validator.allowable_values[horizontal_alignment.to_i]
391
+ end
392
+ end
393
+
394
+ # Custom attribute writer method checking allowed values (enum).
395
+ # @param [Object] vertical_alignment Object to be assigned
396
+ def vertical_alignment=(vertical_alignment)
397
+ validator = EnumAttributeValidator.new('String', ["None", "Top", "Center", "Bottom"])
398
+ if vertical_alignment.to_i == 0
399
+ unless validator.valid?(vertical_alignment)
400
+ raise ArgumentError, "invalid value for 'vertical_alignment', must be one of #{validator.allowable_values}."
401
+ end
402
+ @vertical_alignment = vertical_alignment
403
+ else
404
+ @vertical_alignment = validator.allowable_values[vertical_alignment.to_i]
405
+ end
406
+ end
407
+
408
+ # Custom attribute writer method checking allowed values (enum).
409
+ # @param [Object] margin_measure_type Object to be assigned
410
+ def margin_measure_type=(margin_measure_type)
411
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
412
+ if margin_measure_type.to_i == 0
413
+ unless validator.valid?(margin_measure_type)
414
+ raise ArgumentError, "invalid value for 'margin_measure_type', must be one of #{validator.allowable_values}."
415
+ end
416
+ @margin_measure_type = margin_measure_type
417
+ else
418
+ @margin_measure_type = validator.allowable_values[margin_measure_type.to_i]
419
+ end
420
+ end
421
+
422
+ # Checks equality by comparing each attribute.
423
+ # @param [Object] Object to be compared
424
+ def ==(other)
425
+ return true if self.equal?(other)
426
+ self.class == other.class &&
427
+ signature_type == other.signature_type &&
428
+ page == other.page &&
429
+ all_pages == other.all_pages &&
430
+ pages_setup == other.pages_setup &&
431
+ appearance == other.appearance &&
432
+ image_file_path == other.image_file_path &&
433
+ left == other.left &&
434
+ top == other.top &&
435
+ width == other.width &&
436
+ height == other.height &&
437
+ location_measure_type == other.location_measure_type &&
438
+ size_measure_type == other.size_measure_type &&
439
+ rotation_angle == other.rotation_angle &&
440
+ horizontal_alignment == other.horizontal_alignment &&
441
+ vertical_alignment == other.vertical_alignment &&
442
+ margin == other.margin &&
443
+ margin_measure_type == other.margin_measure_type &&
444
+ transparency == other.transparency &&
445
+ border == other.border
446
+ end
447
+
448
+ # @see the `==` method
449
+ # @param [Object] Object to be compared
450
+ def eql?(other)
451
+ self == other
452
+ end
453
+
454
+ # Calculates hash code according to all attributes.
455
+ # @return [Fixnum] Hash code
456
+ def hash
457
+ [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].hash
458
+ end
459
+
460
+ # Downcases first letter.
461
+ # @return downcased string
462
+ def uncap(str)
463
+ str[0, 1].downcase + str[1..-1]
464
+ end
465
+
466
+ # Builds the object from hash
467
+ # @param [Hash] attributes Model attributes in the form of hash
468
+ # @return [Object] Returns the model itself
469
+ def build_from_hash(attributes)
470
+ return nil unless attributes.is_a?(Hash)
471
+ self.class.swagger_types.each_pair do |key, type|
472
+ pname = uncap(self.class.attribute_map[key]).intern
473
+ value = attributes[pname]
474
+ if type =~ /\AArray<(.*)>/i
475
+ # check to ensure the input is an array given that the the attribute
476
+ # is documented as an array but the input is not
477
+ if value.is_a?(Array)
478
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
479
+ end
480
+ elsif !value.nil?
481
+ self.send("#{key}=", _deserialize(type, value))
482
+ end
483
+ # or else data not found in attributes(hash), not an issue as the data can be optional
484
+ end
485
+
486
+ self
487
+ end
488
+
489
+ # Deserializes the data based on type
490
+ # @param string type Data type
491
+ # @param string value Value to be deserialized
492
+ # @return [Object] Deserialized data
493
+ def _deserialize(type, value)
494
+ case type.to_sym
495
+ when :DateTime
496
+ Date.parse value
497
+ when :Date
498
+ Date.parse value
499
+ when :String
500
+ value.to_s
501
+ when :Integer
502
+ value.to_i
503
+ when :Float
504
+ value.to_f
505
+ when :BOOLEAN
506
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
507
+ true
508
+ else
509
+ false
510
+ end
511
+ when :Object
512
+ # generic object (usually a Hash), return directly
513
+ value
514
+ when /\AArray<(?<inner_type>.+)>\z/
515
+ inner_type = Regexp.last_match[:inner_type]
516
+ value.map { |v| _deserialize(inner_type, v) }
517
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
518
+ k_type = Regexp.last_match[:k_type]
519
+ v_type = Regexp.last_match[:v_type]
520
+ {}.tap do |hash|
521
+ value.each do |k, v|
522
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
523
+ end
524
+ end
525
+ else
526
+ # model
527
+ # Signature type fix
528
+ ttype = type
529
+ if value.is_a?(Hash) and !value[:signatureType].nil?
530
+ ttype = value[:signatureType] + 'Signature'
531
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
532
+ type = value[:type]
533
+ if type == 'Checkbox'
534
+ ttype = 'CheckboxFormFieldSignature'
535
+ end
536
+ if type == 'Text'
537
+ ttype = 'TextFormFieldSignature'
538
+ end
539
+ if type == 'Combobox'
540
+ ttype = 'ComboboxFormFieldSignature'
541
+ end
542
+ if type == 'DigitalSignature'
543
+ ttype = 'DigitalFormFieldSignature'
544
+ end
545
+ if type == 'Radio'
546
+ ttype = 'RadioButtonFormFieldSignature'
547
+ end
548
+ end
549
+ end
550
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
551
+ temp_model.build_from_hash(value)
552
+ end
553
+ end
554
+
555
+ # Returns the string representation of the object
556
+ # @return [String] String presentation of the object
557
+ def to_s
558
+ to_hash.to_s
559
+ end
560
+
561
+ # to_body is an alias to to_hash (backward compatibility)
562
+ # @return [Hash] Returns the object in the form of hash
563
+ def to_body
564
+ to_hash
565
+ end
566
+
567
+ # Returns the object in the form of hash
568
+ # @return [Hash] Returns the object in the form of hash
569
+ def to_hash
570
+ hash = {}
571
+ self.class.attribute_map.each_pair do |attr, param|
572
+ value = self.send(attr)
573
+ next if value.nil?
574
+ hash[param] = _to_hash(value)
575
+ end
576
+ hash
577
+ end
578
+
579
+ # Outputs non-array value in the form of hash
580
+ # For object, use to_hash. Otherwise, just return the value
581
+ # @param [Object] value Any valid value
582
+ # @return [Hash] Returns the value in the form of hash
583
+ def _to_hash(value)
584
+ if value.is_a?(Array)
585
+ value.compact.map { |v| _to_hash(v) }
586
+ elsif value.is_a?(Hash)
587
+ {}.tap do |hash|
588
+ value.each { |k, v| hash[k] = _to_hash(v) }
589
+ end
590
+ elsif value.respond_to? :to_hash
591
+ value.to_hash
592
+ else
593
+ value
594
+ end
595
+ end
596
+
597
+ end
598
+
599
+ end