groupdocs_signature_cloud 18.8.1 → 19.5

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