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,696 +1,808 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="pdf_sign_text_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 Text Sign Options for PDF Documents.
32
- class PdfSignTextOptionsData
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
- # Left X position of Signature on Document Page in Measure values (pixels or percent see LocationMeasureType property)
44
- attr_accessor :left
45
-
46
- # Top Y Position of Signature on Document Page in Measure values (pixels or percent see LocationMeasureType property)
47
- attr_accessor :top
48
-
49
- # Width of Signature area on Document Page in Measure values (pixels or percent see SizeMeasureType property)
50
- attr_accessor :width
51
-
52
- # Height of Signature are on Document Page in Measure values (pixels or percent see SizeMeasureType property)
53
- attr_accessor :height
54
-
55
- # Measure type (pixels or percent) for Left and Top properties.
56
- attr_accessor :location_measure_type
57
-
58
- # Measure type (pixels or percent) for Width and Height properties.
59
- attr_accessor :size_measure_type
60
-
61
- # Stretch mode on Document Page
62
- attr_accessor :stretch
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
- # Text of signature
80
- attr_accessor :text
81
-
82
- # Put signature on all document pages.
83
- attr_accessor :sign_all_pages
84
-
85
- # Gets or sets the font of signature.
86
- attr_accessor :font
87
-
88
- # Gets or sets the fore color of signature.
89
- attr_accessor :fore_color
90
-
91
- # Gets or sets the border color of signature.
92
- attr_accessor :border_color
93
-
94
- # Gets or sets the background color of signature.
95
- attr_accessor :background_color
96
-
97
- # Gets or sets the signature background brush. Value by default is null. When property has a value it is used instead BackgroundBrush property. For Stamp implementation LinearGradientBrush (ColorStart) and RadialGradientBrush (ColorInner) are used as SolidBrush. It is not used for Annotation, Sticker, TextToFormField and Watermark implementations.
98
- attr_accessor :background_brush
99
-
100
- # Gets or sets the signature opacity (value from 0.0 (clear) through 1.0 (opaque)). By default the value is 1.0.
101
- attr_accessor :opacity
102
-
103
- # Gets or sets the unique ID of signature. It can be used in signature verification options.
104
- attr_accessor :signature_id
105
-
106
- # Gets or sets the type of text signature implementation.
107
- attr_accessor :signature_implementation
108
-
109
- # Gets or sets the title of text form field to put text signature into it. This property could be used only with PdfTextSignatureImplementation = TextToFormField.
110
- attr_accessor :form_text_field_title
111
-
112
- # Gets or sets the type of form field to put text signature into it. This property could be used only with PdfTextSignatureImplementation = TextToFormField. Value by default is AllTextTypes.
113
- attr_accessor :form_text_field_type
114
-
115
- # Horizontal alignment of text inside a signature. This feature is supported only for Image and Annotation signature implementations (see SignatureImplementation property).
116
- attr_accessor :text_horizontal_alignment
117
-
118
- # Vertical alignment of text inside a signature. This feature is supported only for Image signature implementation (see SignatureImplementation property).
119
- attr_accessor :text_vertical_alignment
120
- class EnumAttributeValidator
121
- attr_reader :datatype
122
- attr_reader :allowable_values
123
-
124
- def initialize(datatype, allowable_values)
125
- @allowable_values = allowable_values.map do |value|
126
- case datatype.to_s
127
- when /Integer/i
128
- value.to_i
129
- when /Float/i
130
- value.to_f
131
- else
132
- value
133
- end
134
- end
135
- end
136
-
137
- def valid?(value)
138
- !value || allowable_values.include?(value)
139
- end
140
- end
141
-
142
- # Attribute mapping from ruby-style variable name to JSON key.
143
- def self.attribute_map
144
- {
145
- :'document_page_number' => :'DocumentPageNumber',
146
- :'pages_setup' => :'PagesSetup',
147
- :'options_type' => :'OptionsType',
148
- :'left' => :'Left',
149
- :'top' => :'Top',
150
- :'width' => :'Width',
151
- :'height' => :'Height',
152
- :'location_measure_type' => :'LocationMeasureType',
153
- :'size_measure_type' => :'SizeMeasureType',
154
- :'stretch' => :'Stretch',
155
- :'rotation_angle' => :'RotationAngle',
156
- :'horizontal_alignment' => :'HorizontalAlignment',
157
- :'vertical_alignment' => :'VerticalAlignment',
158
- :'margin' => :'Margin',
159
- :'margin_measure_type' => :'MarginMeasureType',
160
- :'text' => :'Text',
161
- :'sign_all_pages' => :'SignAllPages',
162
- :'font' => :'Font',
163
- :'fore_color' => :'ForeColor',
164
- :'border_color' => :'BorderColor',
165
- :'background_color' => :'BackgroundColor',
166
- :'background_brush' => :'BackgroundBrush',
167
- :'opacity' => :'Opacity',
168
- :'signature_id' => :'SignatureID',
169
- :'signature_implementation' => :'SignatureImplementation',
170
- :'form_text_field_title' => :'FormTextFieldTitle',
171
- :'form_text_field_type' => :'FormTextFieldType',
172
- :'text_horizontal_alignment' => :'TextHorizontalAlignment',
173
- :'text_vertical_alignment' => :'TextVerticalAlignment'
174
- }
175
- end
176
-
177
- # Attribute type mapping.
178
- def self.swagger_types
179
- {
180
- :'document_page_number' => :'Integer',
181
- :'pages_setup' => :'PagesSetupData',
182
- :'options_type' => :'String',
183
- :'left' => :'Integer',
184
- :'top' => :'Integer',
185
- :'width' => :'Integer',
186
- :'height' => :'Integer',
187
- :'location_measure_type' => :'String',
188
- :'size_measure_type' => :'String',
189
- :'stretch' => :'String',
190
- :'rotation_angle' => :'Integer',
191
- :'horizontal_alignment' => :'String',
192
- :'vertical_alignment' => :'String',
193
- :'margin' => :'PaddingData',
194
- :'margin_measure_type' => :'String',
195
- :'text' => :'String',
196
- :'sign_all_pages' => :'BOOLEAN',
197
- :'font' => :'SignatureFontData',
198
- :'fore_color' => :'Color',
199
- :'border_color' => :'Color',
200
- :'background_color' => :'Color',
201
- :'background_brush' => :'BrushData',
202
- :'opacity' => :'Float',
203
- :'signature_id' => :'Integer',
204
- :'signature_implementation' => :'String',
205
- :'form_text_field_title' => :'String',
206
- :'form_text_field_type' => :'String',
207
- :'text_horizontal_alignment' => :'String',
208
- :'text_vertical_alignment' => :'String'
209
- }
210
- end
211
-
212
- # Initializes the object
213
- # @param [Hash] attributes Model attributes in the form of hash
214
- def initialize(attributes = {})
215
- return unless attributes.is_a?(Hash)
216
-
217
- # convert string to symbol for hash key
218
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
219
-
220
- if attributes.key?(:'DocumentPageNumber')
221
- self.document_page_number = attributes[:'DocumentPageNumber']
222
- end
223
-
224
- if attributes.key?(:'PagesSetup')
225
- self.pages_setup = attributes[:'PagesSetup']
226
- end
227
-
228
- if attributes.key?(:'OptionsType')
229
- self.options_type = attributes[:'OptionsType']
230
- end
231
-
232
- if attributes.key?(:'Left')
233
- self.left = attributes[:'Left']
234
- end
235
-
236
- if attributes.key?(:'Top')
237
- self.top = attributes[:'Top']
238
- end
239
-
240
- if attributes.key?(:'Width')
241
- self.width = attributes[:'Width']
242
- end
243
-
244
- if attributes.key?(:'Height')
245
- self.height = attributes[:'Height']
246
- end
247
-
248
- if attributes.key?(:'LocationMeasureType')
249
- self.location_measure_type = attributes[:'LocationMeasureType']
250
- end
251
-
252
- if attributes.key?(:'SizeMeasureType')
253
- self.size_measure_type = attributes[:'SizeMeasureType']
254
- end
255
-
256
- if attributes.key?(:'Stretch')
257
- self.stretch = attributes[:'Stretch']
258
- end
259
-
260
- if attributes.key?(:'RotationAngle')
261
- self.rotation_angle = attributes[:'RotationAngle']
262
- end
263
-
264
- if attributes.key?(:'HorizontalAlignment')
265
- self.horizontal_alignment = attributes[:'HorizontalAlignment']
266
- end
267
-
268
- if attributes.key?(:'VerticalAlignment')
269
- self.vertical_alignment = attributes[:'VerticalAlignment']
270
- end
271
-
272
- if attributes.key?(:'Margin')
273
- self.margin = attributes[:'Margin']
274
- end
275
-
276
- if attributes.key?(:'MarginMeasureType')
277
- self.margin_measure_type = attributes[:'MarginMeasureType']
278
- end
279
-
280
- if attributes.key?(:'Text')
281
- self.text = attributes[:'Text']
282
- end
283
-
284
- if attributes.key?(:'SignAllPages')
285
- self.sign_all_pages = attributes[:'SignAllPages']
286
- end
287
-
288
- if attributes.key?(:'Font')
289
- self.font = attributes[:'Font']
290
- end
291
-
292
- if attributes.key?(:'ForeColor')
293
- self.fore_color = attributes[:'ForeColor']
294
- end
295
-
296
- if attributes.key?(:'BorderColor')
297
- self.border_color = attributes[:'BorderColor']
298
- end
299
-
300
- if attributes.key?(:'BackgroundColor')
301
- self.background_color = attributes[:'BackgroundColor']
302
- end
303
-
304
- if attributes.key?(:'BackgroundBrush')
305
- self.background_brush = attributes[:'BackgroundBrush']
306
- end
307
-
308
- if attributes.key?(:'Opacity')
309
- self.opacity = attributes[:'Opacity']
310
- end
311
-
312
- if attributes.key?(:'SignatureID')
313
- self.signature_id = attributes[:'SignatureID']
314
- end
315
-
316
- if attributes.key?(:'SignatureImplementation')
317
- self.signature_implementation = attributes[:'SignatureImplementation']
318
- end
319
-
320
- if attributes.key?(:'FormTextFieldTitle')
321
- self.form_text_field_title = attributes[:'FormTextFieldTitle']
322
- end
323
-
324
- if attributes.key?(:'FormTextFieldType')
325
- self.form_text_field_type = attributes[:'FormTextFieldType']
326
- end
327
-
328
- if attributes.key?(:'TextHorizontalAlignment')
329
- self.text_horizontal_alignment = attributes[:'TextHorizontalAlignment']
330
- end
331
-
332
- if attributes.key?(:'TextVerticalAlignment')
333
- self.text_vertical_alignment = attributes[:'TextVerticalAlignment']
334
- end
335
-
336
-
337
- if !((defined? options_type) == nil)
338
- self.options_type = "PdfSignTextOptionsData"
339
- end
340
-
341
- end
342
-
343
- # Show invalid properties with the reasons. Usually used together with valid?
344
- # @return Array for valid properies with the reasons
345
- def list_invalid_properties
346
- invalid_properties = []
347
- if @document_page_number.nil?
348
- invalid_properties.push("invalid value for 'document_page_number', document_page_number cannot be nil.")
349
- end
350
-
351
- return invalid_properties
352
- end
353
-
354
- # Check to see if the all the properties in the model are valid
355
- # @return true if the model is valid
356
- def valid?
357
- return false if @document_page_number.nil?
358
- location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
359
- return false unless location_measure_type_validator.valid?(@location_measure_type)
360
- size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
361
- return false unless size_measure_type_validator.valid?(@size_measure_type)
362
- stretch_validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
363
- return false unless stretch_validator.valid?(@stretch)
364
- horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
365
- return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
366
- vertical_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
367
- return false unless vertical_alignment_validator.valid?(@vertical_alignment)
368
- margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
369
- return false unless margin_measure_type_validator.valid?(@margin_measure_type)
370
- signature_implementation_validator = EnumAttributeValidator.new('String', ["Stamp", "Image", "Annotation", "Sticker", "TextToFormField", "Watermark"])
371
- return false unless signature_implementation_validator.valid?(@signature_implementation)
372
- form_text_field_type_validator = EnumAttributeValidator.new('String', ["AllTextTypes", "PlainText", "RichText"])
373
- return false unless form_text_field_type_validator.valid?(@form_text_field_type)
374
- text_horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
375
- return false unless text_horizontal_alignment_validator.valid?(@text_horizontal_alignment)
376
- text_vertical_alignment_validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
377
- return false unless text_vertical_alignment_validator.valid?(@text_vertical_alignment)
378
- return true
379
- end
380
-
381
- # Custom attribute writer method checking allowed values (enum).
382
- # @param [Object] location_measure_type Object to be assigned
383
- def location_measure_type=(location_measure_type)
384
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
385
- if location_measure_type.to_i == 0
386
- unless validator.valid?(location_measure_type)
387
- raise ArgumentError, "invalid value for 'location_measure_type', must be one of #{validator.allowable_values}."
388
- end
389
- @location_measure_type = location_measure_type
390
- else
391
- @location_measure_type = validator.allowable_values[location_measure_type.to_i]
392
- end
393
- end
394
-
395
- # Custom attribute writer method checking allowed values (enum).
396
- # @param [Object] size_measure_type Object to be assigned
397
- def size_measure_type=(size_measure_type)
398
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
399
- if size_measure_type.to_i == 0
400
- unless validator.valid?(size_measure_type)
401
- raise ArgumentError, "invalid value for 'size_measure_type', must be one of #{validator.allowable_values}."
402
- end
403
- @size_measure_type = size_measure_type
404
- else
405
- @size_measure_type = validator.allowable_values[size_measure_type.to_i]
406
- end
407
- end
408
-
409
- # Custom attribute writer method checking allowed values (enum).
410
- # @param [Object] stretch Object to be assigned
411
- def stretch=(stretch)
412
- validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
413
- if stretch.to_i == 0
414
- unless validator.valid?(stretch)
415
- raise ArgumentError, "invalid value for 'stretch', must be one of #{validator.allowable_values}."
416
- end
417
- @stretch = stretch
418
- else
419
- @stretch = validator.allowable_values[stretch.to_i]
420
- end
421
- end
422
-
423
- # Custom attribute writer method checking allowed values (enum).
424
- # @param [Object] horizontal_alignment Object to be assigned
425
- def horizontal_alignment=(horizontal_alignment)
426
- validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
427
- if horizontal_alignment.to_i == 0
428
- unless validator.valid?(horizontal_alignment)
429
- raise ArgumentError, "invalid value for 'horizontal_alignment', must be one of #{validator.allowable_values}."
430
- end
431
- @horizontal_alignment = horizontal_alignment
432
- else
433
- @horizontal_alignment = validator.allowable_values[horizontal_alignment.to_i]
434
- end
435
- end
436
-
437
- # Custom attribute writer method checking allowed values (enum).
438
- # @param [Object] vertical_alignment Object to be assigned
439
- def vertical_alignment=(vertical_alignment)
440
- validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
441
- if vertical_alignment.to_i == 0
442
- unless validator.valid?(vertical_alignment)
443
- raise ArgumentError, "invalid value for 'vertical_alignment', must be one of #{validator.allowable_values}."
444
- end
445
- @vertical_alignment = vertical_alignment
446
- else
447
- @vertical_alignment = validator.allowable_values[vertical_alignment.to_i]
448
- end
449
- end
450
-
451
- # Custom attribute writer method checking allowed values (enum).
452
- # @param [Object] margin_measure_type Object to be assigned
453
- def margin_measure_type=(margin_measure_type)
454
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
455
- if margin_measure_type.to_i == 0
456
- unless validator.valid?(margin_measure_type)
457
- raise ArgumentError, "invalid value for 'margin_measure_type', must be one of #{validator.allowable_values}."
458
- end
459
- @margin_measure_type = margin_measure_type
460
- else
461
- @margin_measure_type = validator.allowable_values[margin_measure_type.to_i]
462
- end
463
- end
464
-
465
- # Custom attribute writer method checking allowed values (enum).
466
- # @param [Object] signature_implementation Object to be assigned
467
- def signature_implementation=(signature_implementation)
468
- validator = EnumAttributeValidator.new('String', ["Stamp", "Image", "Annotation", "Sticker", "TextToFormField", "Watermark"])
469
- if signature_implementation.to_i == 0
470
- unless validator.valid?(signature_implementation)
471
- raise ArgumentError, "invalid value for 'signature_implementation', must be one of #{validator.allowable_values}."
472
- end
473
- @signature_implementation = signature_implementation
474
- else
475
- @signature_implementation = validator.allowable_values[signature_implementation.to_i]
476
- end
477
- end
478
-
479
- # Custom attribute writer method checking allowed values (enum).
480
- # @param [Object] form_text_field_type Object to be assigned
481
- def form_text_field_type=(form_text_field_type)
482
- validator = EnumAttributeValidator.new('String', ["AllTextTypes", "PlainText", "RichText"])
483
- if form_text_field_type.to_i == 0
484
- unless validator.valid?(form_text_field_type)
485
- raise ArgumentError, "invalid value for 'form_text_field_type', must be one of #{validator.allowable_values}."
486
- end
487
- @form_text_field_type = form_text_field_type
488
- else
489
- @form_text_field_type = validator.allowable_values[form_text_field_type.to_i]
490
- end
491
- end
492
-
493
- # Custom attribute writer method checking allowed values (enum).
494
- # @param [Object] text_horizontal_alignment Object to be assigned
495
- def text_horizontal_alignment=(text_horizontal_alignment)
496
- validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
497
- if text_horizontal_alignment.to_i == 0
498
- unless validator.valid?(text_horizontal_alignment)
499
- raise ArgumentError, "invalid value for 'text_horizontal_alignment', must be one of #{validator.allowable_values}."
500
- end
501
- @text_horizontal_alignment = text_horizontal_alignment
502
- else
503
- @text_horizontal_alignment = validator.allowable_values[text_horizontal_alignment.to_i]
504
- end
505
- end
506
-
507
- # Custom attribute writer method checking allowed values (enum).
508
- # @param [Object] text_vertical_alignment Object to be assigned
509
- def text_vertical_alignment=(text_vertical_alignment)
510
- validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
511
- if text_vertical_alignment.to_i == 0
512
- unless validator.valid?(text_vertical_alignment)
513
- raise ArgumentError, "invalid value for 'text_vertical_alignment', must be one of #{validator.allowable_values}."
514
- end
515
- @text_vertical_alignment = text_vertical_alignment
516
- else
517
- @text_vertical_alignment = validator.allowable_values[text_vertical_alignment.to_i]
518
- end
519
- end
520
-
521
- # Checks equality by comparing each attribute.
522
- # @param [Object] Object to be compared
523
- def ==(other)
524
- return true if self.equal?(other)
525
- self.class == other.class &&
526
- document_page_number == other.document_page_number &&
527
- pages_setup == other.pages_setup &&
528
- options_type == other.options_type &&
529
- left == other.left &&
530
- top == other.top &&
531
- width == other.width &&
532
- height == other.height &&
533
- location_measure_type == other.location_measure_type &&
534
- size_measure_type == other.size_measure_type &&
535
- stretch == other.stretch &&
536
- rotation_angle == other.rotation_angle &&
537
- horizontal_alignment == other.horizontal_alignment &&
538
- vertical_alignment == other.vertical_alignment &&
539
- margin == other.margin &&
540
- margin_measure_type == other.margin_measure_type &&
541
- text == other.text &&
542
- sign_all_pages == other.sign_all_pages &&
543
- font == other.font &&
544
- fore_color == other.fore_color &&
545
- border_color == other.border_color &&
546
- background_color == other.background_color &&
547
- background_brush == other.background_brush &&
548
- opacity == other.opacity &&
549
- signature_id == other.signature_id &&
550
- signature_implementation == other.signature_implementation &&
551
- form_text_field_title == other.form_text_field_title &&
552
- form_text_field_type == other.form_text_field_type &&
553
- text_horizontal_alignment == other.text_horizontal_alignment &&
554
- text_vertical_alignment == other.text_vertical_alignment
555
- end
556
-
557
- # @see the `==` method
558
- # @param [Object] Object to be compared
559
- def eql?(other)
560
- self == other
561
- end
562
-
563
- # Calculates hash code according to all attributes.
564
- # @return [Fixnum] Hash code
565
- def hash
566
- [document_page_number, pages_setup, options_type, left, top, width, height, location_measure_type, size_measure_type, stretch, rotation_angle, horizontal_alignment, vertical_alignment, margin, margin_measure_type, text, sign_all_pages, font, fore_color, border_color, background_color, background_brush, opacity, signature_id, signature_implementation, form_text_field_title, form_text_field_type, text_horizontal_alignment, text_vertical_alignment].hash
567
- end
568
-
569
- # Builds the object from hash
570
- # @param [Hash] attributes Model attributes in the form of hash
571
- # @return [Object] Returns the model itself
572
- def build_from_hash(attributes)
573
- return nil unless attributes.is_a?(Hash)
574
- self.class.swagger_types.each_pair do |key, type|
575
-
576
- attributeName = self.class.attribute_map[key]
577
- attributeNameLowerStr = attributeName.to_s
578
- attributeNameLowerStr[0] = attributeNameLowerStr[0].downcase
579
- attributeNameLower = attributeNameLowerStr.to_sym
580
- attributeNameLowerStr2 = attributeName.to_s
581
- attributeNameLowerStr2[0] = attributeNameLowerStr[0].downcase
582
- attributeNameLowerStr2[1] = attributeNameLowerStr[1].downcase
583
- attributeNameLower2 = attributeNameLowerStr2.to_sym
584
-
585
- if type =~ /\AArray<(.*)>/i
586
- # check to ensure the input is an array given that the the attribute
587
- # is documented as an array but the input is not
588
- if attributes[attributeName].is_a?(Array)
589
- self.send("#{key}=", attributes[attributeName].map { |v| _deserialize($1, v) })
590
- end
591
- if attributes[attributeNameLower].is_a?(Array)
592
- self.send("#{key}=", attributes[attributeNameLower].map { |v| _deserialize($1, v) })
593
- end
594
- if attributes[attributeNameLower2].is_a?(Array)
595
- self.send("#{key}=", attributes[attributeNameLower2].map { |v| _deserialize($1, v) })
596
- end
597
- elsif !attributes[attributeName].nil?
598
- self.send("#{key}=", _deserialize(type, attributes[attributeName]))
599
- elsif !attributes[attributeNameLower].nil?
600
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower]))
601
- elsif !attributes[attributeNameLower2].nil?
602
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower2]))
603
- end
604
- # or else data not found in attributes(hash), not an issue as the data can be optional
605
- end
606
- self
607
- end
608
-
609
- # Deserializes the data based on type
610
- # @param string type Data type
611
- # @param string value Value to be deserialized
612
- # @return [Object] Deserialized data
613
- def _deserialize(type, value)
614
- case type.to_sym
615
- when :DateTime
616
- Time.at(/\d/.match(value)[0].to_f).to_datetime
617
- when :Date
618
- Time.at(/\d/.match(value)[0].to_f).to_date
619
- when :String
620
- value.to_s
621
- when :Integer
622
- value.to_i
623
- when :Float
624
- value.to_f
625
- when :BOOLEAN
626
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
627
- true
628
- else
629
- false
630
- end
631
- when :Object
632
- # generic object (usually a Hash), return directly
633
- value
634
- when /\AArray<(?<inner_type>.+)>\z/
635
- inner_type = Regexp.last_match[:inner_type]
636
- value.map { |v| _deserialize(inner_type, v) }
637
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
638
- k_type = Regexp.last_match[:k_type]
639
- v_type = Regexp.last_match[:v_type]
640
- {}.tap do |hash|
641
- value.each do |k, v|
642
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
643
- end
644
- end
645
- else
646
- # model
647
- temp_model = GroupDocsSignatureCloud.const_get(type).new
648
- temp_model.build_from_hash(value)
649
- end
650
- end
651
-
652
- # Returns the string representation of the object
653
- # @return [String] String presentation of the object
654
- def to_s
655
- to_hash.to_s
656
- end
657
-
658
- # to_body is an alias to to_hash (backward compatibility)
659
- # @return [Hash] Returns the object in the form of hash
660
- def to_body
661
- to_hash
662
- end
663
-
664
- # Returns the object in the form of hash
665
- # @return [Hash] Returns the object in the form of hash
666
- def to_hash
667
- hash = {}
668
- self.class.attribute_map.each_pair do |attr, param|
669
- value = self.send(attr)
670
- next if value.nil?
671
- hash[param] = _to_hash(value)
672
- end
673
- hash
674
- end
675
-
676
- # Outputs non-array value in the form of hash
677
- # For object, use to_hash. Otherwise, just return the value
678
- # @param [Object] value Any valid value
679
- # @return [Hash] Returns the value in the form of hash
680
- def _to_hash(value)
681
- if value.is_a?(Array)
682
- value.compact.map { |v| _to_hash(v) }
683
- elsif value.is_a?(Hash)
684
- {}.tap do |hash|
685
- value.each { |k, v| hash[k] = _to_hash(v) }
686
- end
687
- elsif value.respond_to? :to_hash
688
- value.to_hash
689
- else
690
- value
691
- end
692
- end
693
-
694
- end
695
-
696
- end
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="sign_barcode_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 Barcode signature options
32
+ class SignBarcodeOptions
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
+ # Left X position of Signature on Document Page in Measure values (pixels or percent see MeasureType LocationMeasureType property)
50
+ attr_accessor :left
51
+
52
+ # Top Y Position of Signature on Document Page in Measure values (pixels or percent see MeasureType LocationMeasureType property)
53
+ attr_accessor :top
54
+
55
+ # Width of Signature area on Document Page in Measure values (pixels or percent see MeasureType SizeMeasureType property)
56
+ attr_accessor :width
57
+
58
+ # Height of Signature are on Document Page in Measure values (pixels or percent see MeasureType SizeMeasureType property)
59
+ attr_accessor :height
60
+
61
+ # Measure type (pixels or percent) for Left and Top properties
62
+ attr_accessor :location_measure_type
63
+
64
+ # Measure type (pixels or percent) for Width and Height properties
65
+ attr_accessor :size_measure_type
66
+
67
+ # Stretch mode on document page
68
+ attr_accessor :stretch
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
+ # Text of signature
86
+ attr_accessor :text
87
+
88
+ # Gets or sets the font of signature
89
+ attr_accessor :font
90
+
91
+ # Gets or sets the fore color of signature
92
+ attr_accessor :fore_color
93
+
94
+ # Gets or sets the background color of signature
95
+ attr_accessor :background_color
96
+
97
+ # Gets or sets the signature background brush. Value by default is null. If this property has a value it will be used instead BackgroundBrush property. For Spreadsheet documents TextStamp implementation RadialGradientBrush is not applicable, it is replaced by LinearGradientBrush. Spreadsheets, Images, Presentations It is not used for Watermark implementation. PDF For Stamp implementation LinearGradientBrush (ColorStart) and RadialGradientBrush (ColorInner) are used as SolidBrush. PDF It is not used for Annotation, Sticker, TextToFormField and Watermark implementations. Presentations For TextStamp implementation RadialGradientBrush is not applicable, it is replaced by LinearGradientBrush. Word Processing For TextStamp implementation LinearGradientBrush (ColorStart) and RadialGradientBrush (ColorInner) are used as SolidBrush. Word Processing It is not used for TextToFormField and Watermark implementations
98
+ attr_accessor :background_brush
99
+
100
+ # Gets or sets the signature border properties
101
+ attr_accessor :border
102
+
103
+ # Horizontal alignment of text inside a signature
104
+ attr_accessor :text_horizontal_alignment
105
+
106
+ # Vertical alignment of text inside a signature
107
+ attr_accessor :text_vertical_alignment
108
+
109
+ # Gets or sets the Z-order position of text signature. Determines the display order of overlapping signatures.
110
+ attr_accessor :z_order
111
+
112
+ # Gets or sets the native attribute. If it is set document specific signatures could be used. Native text watermark for WordProcessing documents is different than regular, for example.
113
+ attr_accessor :native
114
+
115
+ # Get or set Barcode type. Pick one from supported barcode types list
116
+ attr_accessor :barcode_type
117
+
118
+ # Gets or sets the signature transparency (value from 0.0 (opaque) through 1.0 (clear)). Default value is 0 (opaque).
119
+ attr_accessor :transparency
120
+
121
+ # Gets or sets the alignment of text in the result Barcode Default value is None
122
+ attr_accessor :code_text_alignment
123
+
124
+ # Gets or sets the space between Barcode elements and result image borders
125
+ attr_accessor :inner_margins
126
+ class EnumAttributeValidator
127
+ attr_reader :datatype
128
+ attr_reader :allowable_values
129
+
130
+ def initialize(datatype, allowable_values)
131
+ @allowable_values = allowable_values.map do |value|
132
+ case datatype.to_s
133
+ when /Integer/i
134
+ value.to_i
135
+ when /Float/i
136
+ value.to_f
137
+ else
138
+ value
139
+ end
140
+ end
141
+ end
142
+
143
+ def valid?(value)
144
+ !value || allowable_values.include?(value)
145
+ end
146
+ end
147
+
148
+ # Attribute mapping from ruby-style variable name to JSON key.
149
+ def self.attribute_map
150
+ {
151
+ :'signature_type' => :'SignatureType',
152
+ :'page' => :'Page',
153
+ :'all_pages' => :'AllPages',
154
+ :'pages_setup' => :'PagesSetup',
155
+ :'appearance' => :'Appearance',
156
+ :'left' => :'Left',
157
+ :'top' => :'Top',
158
+ :'width' => :'Width',
159
+ :'height' => :'Height',
160
+ :'location_measure_type' => :'LocationMeasureType',
161
+ :'size_measure_type' => :'SizeMeasureType',
162
+ :'stretch' => :'Stretch',
163
+ :'rotation_angle' => :'RotationAngle',
164
+ :'horizontal_alignment' => :'HorizontalAlignment',
165
+ :'vertical_alignment' => :'VerticalAlignment',
166
+ :'margin' => :'Margin',
167
+ :'margin_measure_type' => :'MarginMeasureType',
168
+ :'text' => :'Text',
169
+ :'font' => :'Font',
170
+ :'fore_color' => :'ForeColor',
171
+ :'background_color' => :'BackgroundColor',
172
+ :'background_brush' => :'BackgroundBrush',
173
+ :'border' => :'Border',
174
+ :'text_horizontal_alignment' => :'TextHorizontalAlignment',
175
+ :'text_vertical_alignment' => :'TextVerticalAlignment',
176
+ :'z_order' => :'ZOrder',
177
+ :'native' => :'Native',
178
+ :'barcode_type' => :'BarcodeType',
179
+ :'transparency' => :'Transparency',
180
+ :'code_text_alignment' => :'CodeTextAlignment',
181
+ :'inner_margins' => :'InnerMargins'
182
+ }
183
+ end
184
+
185
+ # Attribute type mapping.
186
+ def self.swagger_types
187
+ {
188
+ :'signature_type' => :'String',
189
+ :'page' => :'Integer',
190
+ :'all_pages' => :'BOOLEAN',
191
+ :'pages_setup' => :'PagesSetup',
192
+ :'appearance' => :'SignatureAppearance',
193
+ :'left' => :'Integer',
194
+ :'top' => :'Integer',
195
+ :'width' => :'Integer',
196
+ :'height' => :'Integer',
197
+ :'location_measure_type' => :'String',
198
+ :'size_measure_type' => :'String',
199
+ :'stretch' => :'String',
200
+ :'rotation_angle' => :'Integer',
201
+ :'horizontal_alignment' => :'String',
202
+ :'vertical_alignment' => :'String',
203
+ :'margin' => :'Padding',
204
+ :'margin_measure_type' => :'String',
205
+ :'text' => :'String',
206
+ :'font' => :'SignatureFont',
207
+ :'fore_color' => :'Color',
208
+ :'background_color' => :'Color',
209
+ :'background_brush' => :'Brush',
210
+ :'border' => :'BorderLine',
211
+ :'text_horizontal_alignment' => :'String',
212
+ :'text_vertical_alignment' => :'String',
213
+ :'z_order' => :'Integer',
214
+ :'native' => :'BOOLEAN',
215
+ :'barcode_type' => :'String',
216
+ :'transparency' => :'Float',
217
+ :'code_text_alignment' => :'String',
218
+ :'inner_margins' => :'Padding'
219
+ }
220
+ end
221
+
222
+ # Initializes the object
223
+ # @param [Hash] attributes Model attributes in the form of hash
224
+ def initialize(attributes = {})
225
+ return unless attributes.is_a?(Hash)
226
+
227
+ # convert string to symbol for hash key
228
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
229
+
230
+ if attributes.key?(:'SignatureType')
231
+ self.signature_type = attributes[:'SignatureType']
232
+ end
233
+
234
+ if attributes.key?(:'Page')
235
+ self.page = attributes[:'Page']
236
+ end
237
+
238
+ if attributes.key?(:'AllPages')
239
+ self.all_pages = attributes[:'AllPages']
240
+ end
241
+
242
+ if attributes.key?(:'PagesSetup')
243
+ self.pages_setup = attributes[:'PagesSetup']
244
+ end
245
+
246
+ if attributes.key?(:'Appearance')
247
+ self.appearance = attributes[:'Appearance']
248
+ end
249
+
250
+ if attributes.key?(:'Left')
251
+ self.left = attributes[:'Left']
252
+ end
253
+
254
+ if attributes.key?(:'Top')
255
+ self.top = attributes[:'Top']
256
+ end
257
+
258
+ if attributes.key?(:'Width')
259
+ self.width = attributes[:'Width']
260
+ end
261
+
262
+ if attributes.key?(:'Height')
263
+ self.height = attributes[:'Height']
264
+ end
265
+
266
+ if attributes.key?(:'LocationMeasureType')
267
+ self.location_measure_type = attributes[:'LocationMeasureType']
268
+ end
269
+
270
+ if attributes.key?(:'SizeMeasureType')
271
+ self.size_measure_type = attributes[:'SizeMeasureType']
272
+ end
273
+
274
+ if attributes.key?(:'Stretch')
275
+ self.stretch = attributes[:'Stretch']
276
+ end
277
+
278
+ if attributes.key?(:'RotationAngle')
279
+ self.rotation_angle = attributes[:'RotationAngle']
280
+ end
281
+
282
+ if attributes.key?(:'HorizontalAlignment')
283
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
284
+ end
285
+
286
+ if attributes.key?(:'VerticalAlignment')
287
+ self.vertical_alignment = attributes[:'VerticalAlignment']
288
+ end
289
+
290
+ if attributes.key?(:'Margin')
291
+ self.margin = attributes[:'Margin']
292
+ end
293
+
294
+ if attributes.key?(:'MarginMeasureType')
295
+ self.margin_measure_type = attributes[:'MarginMeasureType']
296
+ end
297
+
298
+ if attributes.key?(:'Text')
299
+ self.text = attributes[:'Text']
300
+ end
301
+
302
+ if attributes.key?(:'Font')
303
+ self.font = attributes[:'Font']
304
+ end
305
+
306
+ if attributes.key?(:'ForeColor')
307
+ self.fore_color = attributes[:'ForeColor']
308
+ end
309
+
310
+ if attributes.key?(:'BackgroundColor')
311
+ self.background_color = attributes[:'BackgroundColor']
312
+ end
313
+
314
+ if attributes.key?(:'BackgroundBrush')
315
+ self.background_brush = attributes[:'BackgroundBrush']
316
+ end
317
+
318
+ if attributes.key?(:'Border')
319
+ self.border = attributes[:'Border']
320
+ end
321
+
322
+ if attributes.key?(:'TextHorizontalAlignment')
323
+ self.text_horizontal_alignment = attributes[:'TextHorizontalAlignment']
324
+ end
325
+
326
+ if attributes.key?(:'TextVerticalAlignment')
327
+ self.text_vertical_alignment = attributes[:'TextVerticalAlignment']
328
+ end
329
+
330
+ if attributes.key?(:'ZOrder')
331
+ self.z_order = attributes[:'ZOrder']
332
+ end
333
+
334
+ if attributes.key?(:'Native')
335
+ self.native = attributes[:'Native']
336
+ end
337
+
338
+ if attributes.key?(:'BarcodeType')
339
+ self.barcode_type = attributes[:'BarcodeType']
340
+ end
341
+
342
+ if attributes.key?(:'Transparency')
343
+ self.transparency = attributes[:'Transparency']
344
+ end
345
+
346
+ if attributes.key?(:'CodeTextAlignment')
347
+ self.code_text_alignment = attributes[:'CodeTextAlignment']
348
+ end
349
+
350
+ if attributes.key?(:'InnerMargins')
351
+ self.inner_margins = attributes[:'InnerMargins']
352
+ end
353
+
354
+ end
355
+
356
+ # Show invalid properties with the reasons. Usually used together with valid?
357
+ # @return Array for valid properies with the reasons
358
+ def list_invalid_properties
359
+ invalid_properties = []
360
+ if @signature_type.nil?
361
+ invalid_properties.push("invalid value for 'signature_type', signature_type cannot be nil.")
362
+ end
363
+
364
+ if @all_pages.nil?
365
+ invalid_properties.push("invalid value for 'all_pages', all_pages cannot be nil.")
366
+ end
367
+
368
+ if @left.nil?
369
+ invalid_properties.push("invalid value for 'left', left cannot be nil.")
370
+ end
371
+
372
+ if @top.nil?
373
+ invalid_properties.push("invalid value for 'top', top cannot be nil.")
374
+ end
375
+
376
+ if @width.nil?
377
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
378
+ end
379
+
380
+ if @height.nil?
381
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
382
+ end
383
+
384
+ if @location_measure_type.nil?
385
+ invalid_properties.push("invalid value for 'location_measure_type', location_measure_type cannot be nil.")
386
+ end
387
+
388
+ if @size_measure_type.nil?
389
+ invalid_properties.push("invalid value for 'size_measure_type', size_measure_type cannot be nil.")
390
+ end
391
+
392
+ if @stretch.nil?
393
+ invalid_properties.push("invalid value for 'stretch', stretch cannot be nil.")
394
+ end
395
+
396
+ if @rotation_angle.nil?
397
+ invalid_properties.push("invalid value for 'rotation_angle', rotation_angle cannot be nil.")
398
+ end
399
+
400
+ if @horizontal_alignment.nil?
401
+ invalid_properties.push("invalid value for 'horizontal_alignment', horizontal_alignment cannot be nil.")
402
+ end
403
+
404
+ if @vertical_alignment.nil?
405
+ invalid_properties.push("invalid value for 'vertical_alignment', vertical_alignment cannot be nil.")
406
+ end
407
+
408
+ if @margin_measure_type.nil?
409
+ invalid_properties.push("invalid value for 'margin_measure_type', margin_measure_type cannot be nil.")
410
+ end
411
+
412
+ if @text_horizontal_alignment.nil?
413
+ invalid_properties.push("invalid value for 'text_horizontal_alignment', text_horizontal_alignment cannot be nil.")
414
+ end
415
+
416
+ if @text_vertical_alignment.nil?
417
+ invalid_properties.push("invalid value for 'text_vertical_alignment', text_vertical_alignment cannot be nil.")
418
+ end
419
+
420
+ if @z_order.nil?
421
+ invalid_properties.push("invalid value for 'z_order', z_order cannot be nil.")
422
+ end
423
+
424
+ if @native.nil?
425
+ invalid_properties.push("invalid value for 'native', native cannot be nil.")
426
+ end
427
+
428
+ if @code_text_alignment.nil?
429
+ invalid_properties.push("invalid value for 'code_text_alignment', code_text_alignment cannot be nil.")
430
+ end
431
+
432
+ return invalid_properties
433
+ end
434
+
435
+ # Check to see if the all the properties in the model are valid
436
+ # @return true if the model is valid
437
+ def valid?
438
+ return false if @signature_type.nil?
439
+ signature_type_validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp", "FormField", "Metadata"])
440
+ return false unless signature_type_validator.valid?(@signature_type)
441
+ return false if @all_pages.nil?
442
+ return false if @left.nil?
443
+ return false if @top.nil?
444
+ return false if @width.nil?
445
+ return false if @height.nil?
446
+ return false if @location_measure_type.nil?
447
+ location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
448
+ return false unless location_measure_type_validator.valid?(@location_measure_type)
449
+ return false if @size_measure_type.nil?
450
+ size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
451
+ return false unless size_measure_type_validator.valid?(@size_measure_type)
452
+ return false if @stretch.nil?
453
+ stretch_validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
454
+ return false unless stretch_validator.valid?(@stretch)
455
+ return false if @rotation_angle.nil?
456
+ return false if @horizontal_alignment.nil?
457
+ horizontal_alignment_validator = EnumAttributeValidator.new('String', ["None", "Left", "Center", "Right"])
458
+ return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
459
+ return false if @vertical_alignment.nil?
460
+ vertical_alignment_validator = EnumAttributeValidator.new('String', ["None", "Top", "Center", "Bottom"])
461
+ return false unless vertical_alignment_validator.valid?(@vertical_alignment)
462
+ return false if @margin_measure_type.nil?
463
+ margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
464
+ return false unless margin_measure_type_validator.valid?(@margin_measure_type)
465
+ return false if @text_horizontal_alignment.nil?
466
+ text_horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
467
+ return false unless text_horizontal_alignment_validator.valid?(@text_horizontal_alignment)
468
+ return false if @text_vertical_alignment.nil?
469
+ text_vertical_alignment_validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
470
+ return false unless text_vertical_alignment_validator.valid?(@text_vertical_alignment)
471
+ return false if @z_order.nil?
472
+ return false if @native.nil?
473
+ return false if @code_text_alignment.nil?
474
+ code_text_alignment_validator = EnumAttributeValidator.new('String', ["None", "Above", "Below", "Right"])
475
+ return false unless code_text_alignment_validator.valid?(@code_text_alignment)
476
+ return true
477
+ end
478
+
479
+ # Custom attribute writer method checking allowed values (enum).
480
+ # @param [Object] signature_type Object to be assigned
481
+ def signature_type=(signature_type)
482
+ validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp", "FormField", "Metadata"])
483
+ if signature_type.to_i == 0
484
+ unless validator.valid?(signature_type)
485
+ raise ArgumentError, "invalid value for 'signature_type', must be one of #{validator.allowable_values}."
486
+ end
487
+ @signature_type = signature_type
488
+ else
489
+ @signature_type = validator.allowable_values[signature_type.to_i]
490
+ end
491
+ end
492
+
493
+ # Custom attribute writer method checking allowed values (enum).
494
+ # @param [Object] location_measure_type Object to be assigned
495
+ def location_measure_type=(location_measure_type)
496
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
497
+ if location_measure_type.to_i == 0
498
+ unless validator.valid?(location_measure_type)
499
+ raise ArgumentError, "invalid value for 'location_measure_type', must be one of #{validator.allowable_values}."
500
+ end
501
+ @location_measure_type = location_measure_type
502
+ else
503
+ @location_measure_type = validator.allowable_values[location_measure_type.to_i]
504
+ end
505
+ end
506
+
507
+ # Custom attribute writer method checking allowed values (enum).
508
+ # @param [Object] size_measure_type Object to be assigned
509
+ def size_measure_type=(size_measure_type)
510
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
511
+ if size_measure_type.to_i == 0
512
+ unless validator.valid?(size_measure_type)
513
+ raise ArgumentError, "invalid value for 'size_measure_type', must be one of #{validator.allowable_values}."
514
+ end
515
+ @size_measure_type = size_measure_type
516
+ else
517
+ @size_measure_type = validator.allowable_values[size_measure_type.to_i]
518
+ end
519
+ end
520
+
521
+ # Custom attribute writer method checking allowed values (enum).
522
+ # @param [Object] stretch Object to be assigned
523
+ def stretch=(stretch)
524
+ validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
525
+ if stretch.to_i == 0
526
+ unless validator.valid?(stretch)
527
+ raise ArgumentError, "invalid value for 'stretch', must be one of #{validator.allowable_values}."
528
+ end
529
+ @stretch = stretch
530
+ else
531
+ @stretch = validator.allowable_values[stretch.to_i]
532
+ end
533
+ end
534
+
535
+ # Custom attribute writer method checking allowed values (enum).
536
+ # @param [Object] horizontal_alignment Object to be assigned
537
+ def horizontal_alignment=(horizontal_alignment)
538
+ validator = EnumAttributeValidator.new('String', ["None", "Left", "Center", "Right"])
539
+ if horizontal_alignment.to_i == 0
540
+ unless validator.valid?(horizontal_alignment)
541
+ raise ArgumentError, "invalid value for 'horizontal_alignment', must be one of #{validator.allowable_values}."
542
+ end
543
+ @horizontal_alignment = horizontal_alignment
544
+ else
545
+ @horizontal_alignment = validator.allowable_values[horizontal_alignment.to_i]
546
+ end
547
+ end
548
+
549
+ # Custom attribute writer method checking allowed values (enum).
550
+ # @param [Object] vertical_alignment Object to be assigned
551
+ def vertical_alignment=(vertical_alignment)
552
+ validator = EnumAttributeValidator.new('String', ["None", "Top", "Center", "Bottom"])
553
+ if vertical_alignment.to_i == 0
554
+ unless validator.valid?(vertical_alignment)
555
+ raise ArgumentError, "invalid value for 'vertical_alignment', must be one of #{validator.allowable_values}."
556
+ end
557
+ @vertical_alignment = vertical_alignment
558
+ else
559
+ @vertical_alignment = validator.allowable_values[vertical_alignment.to_i]
560
+ end
561
+ end
562
+
563
+ # Custom attribute writer method checking allowed values (enum).
564
+ # @param [Object] margin_measure_type Object to be assigned
565
+ def margin_measure_type=(margin_measure_type)
566
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
567
+ if margin_measure_type.to_i == 0
568
+ unless validator.valid?(margin_measure_type)
569
+ raise ArgumentError, "invalid value for 'margin_measure_type', must be one of #{validator.allowable_values}."
570
+ end
571
+ @margin_measure_type = margin_measure_type
572
+ else
573
+ @margin_measure_type = validator.allowable_values[margin_measure_type.to_i]
574
+ end
575
+ end
576
+
577
+ # Custom attribute writer method checking allowed values (enum).
578
+ # @param [Object] text_horizontal_alignment Object to be assigned
579
+ def text_horizontal_alignment=(text_horizontal_alignment)
580
+ validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
581
+ if text_horizontal_alignment.to_i == 0
582
+ unless validator.valid?(text_horizontal_alignment)
583
+ raise ArgumentError, "invalid value for 'text_horizontal_alignment', must be one of #{validator.allowable_values}."
584
+ end
585
+ @text_horizontal_alignment = text_horizontal_alignment
586
+ else
587
+ @text_horizontal_alignment = validator.allowable_values[text_horizontal_alignment.to_i]
588
+ end
589
+ end
590
+
591
+ # Custom attribute writer method checking allowed values (enum).
592
+ # @param [Object] text_vertical_alignment Object to be assigned
593
+ def text_vertical_alignment=(text_vertical_alignment)
594
+ validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
595
+ if text_vertical_alignment.to_i == 0
596
+ unless validator.valid?(text_vertical_alignment)
597
+ raise ArgumentError, "invalid value for 'text_vertical_alignment', must be one of #{validator.allowable_values}."
598
+ end
599
+ @text_vertical_alignment = text_vertical_alignment
600
+ else
601
+ @text_vertical_alignment = validator.allowable_values[text_vertical_alignment.to_i]
602
+ end
603
+ end
604
+
605
+ # Custom attribute writer method checking allowed values (enum).
606
+ # @param [Object] code_text_alignment Object to be assigned
607
+ def code_text_alignment=(code_text_alignment)
608
+ validator = EnumAttributeValidator.new('String', ["None", "Above", "Below", "Right"])
609
+ if code_text_alignment.to_i == 0
610
+ unless validator.valid?(code_text_alignment)
611
+ raise ArgumentError, "invalid value for 'code_text_alignment', must be one of #{validator.allowable_values}."
612
+ end
613
+ @code_text_alignment = code_text_alignment
614
+ else
615
+ @code_text_alignment = validator.allowable_values[code_text_alignment.to_i]
616
+ end
617
+ end
618
+
619
+ # Checks equality by comparing each attribute.
620
+ # @param [Object] Object to be compared
621
+ def ==(other)
622
+ return true if self.equal?(other)
623
+ self.class == other.class &&
624
+ signature_type == other.signature_type &&
625
+ page == other.page &&
626
+ all_pages == other.all_pages &&
627
+ pages_setup == other.pages_setup &&
628
+ appearance == other.appearance &&
629
+ left == other.left &&
630
+ top == other.top &&
631
+ width == other.width &&
632
+ height == other.height &&
633
+ location_measure_type == other.location_measure_type &&
634
+ size_measure_type == other.size_measure_type &&
635
+ stretch == other.stretch &&
636
+ rotation_angle == other.rotation_angle &&
637
+ horizontal_alignment == other.horizontal_alignment &&
638
+ vertical_alignment == other.vertical_alignment &&
639
+ margin == other.margin &&
640
+ margin_measure_type == other.margin_measure_type &&
641
+ text == other.text &&
642
+ font == other.font &&
643
+ fore_color == other.fore_color &&
644
+ background_color == other.background_color &&
645
+ background_brush == other.background_brush &&
646
+ border == other.border &&
647
+ text_horizontal_alignment == other.text_horizontal_alignment &&
648
+ text_vertical_alignment == other.text_vertical_alignment &&
649
+ z_order == other.z_order &&
650
+ native == other.native &&
651
+ barcode_type == other.barcode_type &&
652
+ transparency == other.transparency &&
653
+ code_text_alignment == other.code_text_alignment &&
654
+ inner_margins == other.inner_margins
655
+ end
656
+
657
+ # @see the `==` method
658
+ # @param [Object] Object to be compared
659
+ def eql?(other)
660
+ self == other
661
+ end
662
+
663
+ # Calculates hash code according to all attributes.
664
+ # @return [Fixnum] Hash code
665
+ def hash
666
+ [signature_type, page, all_pages, pages_setup, appearance, left, top, width, height, location_measure_type, size_measure_type, stretch, rotation_angle, horizontal_alignment, vertical_alignment, margin, margin_measure_type, text, font, fore_color, background_color, background_brush, border, text_horizontal_alignment, text_vertical_alignment, z_order, native, barcode_type, transparency, code_text_alignment, inner_margins].hash
667
+ end
668
+
669
+ # Downcases first letter.
670
+ # @return downcased string
671
+ def uncap(str)
672
+ str[0, 1].downcase + str[1..-1]
673
+ end
674
+
675
+ # Builds the object from hash
676
+ # @param [Hash] attributes Model attributes in the form of hash
677
+ # @return [Object] Returns the model itself
678
+ def build_from_hash(attributes)
679
+ return nil unless attributes.is_a?(Hash)
680
+ self.class.swagger_types.each_pair do |key, type|
681
+ pname = uncap(self.class.attribute_map[key]).intern
682
+ value = attributes[pname]
683
+ if type =~ /\AArray<(.*)>/i
684
+ # check to ensure the input is an array given that the the attribute
685
+ # is documented as an array but the input is not
686
+ if value.is_a?(Array)
687
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
688
+ end
689
+ elsif !value.nil?
690
+ self.send("#{key}=", _deserialize(type, value))
691
+ end
692
+ # or else data not found in attributes(hash), not an issue as the data can be optional
693
+ end
694
+
695
+ self
696
+ end
697
+
698
+ # Deserializes the data based on type
699
+ # @param string type Data type
700
+ # @param string value Value to be deserialized
701
+ # @return [Object] Deserialized data
702
+ def _deserialize(type, value)
703
+ case type.to_sym
704
+ when :DateTime
705
+ Date.parse value
706
+ when :Date
707
+ Date.parse value
708
+ when :String
709
+ value.to_s
710
+ when :Integer
711
+ value.to_i
712
+ when :Float
713
+ value.to_f
714
+ when :BOOLEAN
715
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
716
+ true
717
+ else
718
+ false
719
+ end
720
+ when :Object
721
+ # generic object (usually a Hash), return directly
722
+ value
723
+ when /\AArray<(?<inner_type>.+)>\z/
724
+ inner_type = Regexp.last_match[:inner_type]
725
+ value.map { |v| _deserialize(inner_type, v) }
726
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
727
+ k_type = Regexp.last_match[:k_type]
728
+ v_type = Regexp.last_match[:v_type]
729
+ {}.tap do |hash|
730
+ value.each do |k, v|
731
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
732
+ end
733
+ end
734
+ else
735
+ # model
736
+ # Signature type fix
737
+ ttype = type
738
+ if value.is_a?(Hash) and !value[:signatureType].nil?
739
+ ttype = value[:signatureType] + 'Signature'
740
+ if value[:signatureType] == 'FormField' and !value[:type].nil?
741
+ type = value[:type]
742
+ if type == 'Checkbox'
743
+ ttype = 'CheckboxFormFieldSignature'
744
+ end
745
+ if type == 'Text'
746
+ ttype = 'TextFormFieldSignature'
747
+ end
748
+ if type == 'Combobox'
749
+ ttype = 'ComboboxFormFieldSignature'
750
+ end
751
+ if type == 'DigitalSignature'
752
+ ttype = 'DigitalFormFieldSignature'
753
+ end
754
+ if type == 'Radio'
755
+ ttype = 'RadioButtonFormFieldSignature'
756
+ end
757
+ end
758
+ end
759
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
760
+ temp_model.build_from_hash(value)
761
+ end
762
+ end
763
+
764
+ # Returns the string representation of the object
765
+ # @return [String] String presentation of the object
766
+ def to_s
767
+ to_hash.to_s
768
+ end
769
+
770
+ # to_body is an alias to to_hash (backward compatibility)
771
+ # @return [Hash] Returns the object in the form of hash
772
+ def to_body
773
+ to_hash
774
+ end
775
+
776
+ # Returns the object in the form of hash
777
+ # @return [Hash] Returns the object in the form of hash
778
+ def to_hash
779
+ hash = {}
780
+ self.class.attribute_map.each_pair do |attr, param|
781
+ value = self.send(attr)
782
+ next if value.nil?
783
+ hash[param] = _to_hash(value)
784
+ end
785
+ hash
786
+ end
787
+
788
+ # Outputs non-array value in the form of hash
789
+ # For object, use to_hash. Otherwise, just return the value
790
+ # @param [Object] value Any valid value
791
+ # @return [Hash] Returns the value in the form of hash
792
+ def _to_hash(value)
793
+ if value.is_a?(Array)
794
+ value.compact.map { |v| _to_hash(v) }
795
+ elsif value.is_a?(Hash)
796
+ {}.tap do |hash|
797
+ value.each { |k, v| hash[k] = _to_hash(v) }
798
+ end
799
+ elsif value.respond_to? :to_hash
800
+ value.to_hash
801
+ else
802
+ value
803
+ end
804
+ end
805
+
806
+ end
807
+
808
+ end