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