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,592 +1,592 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="sign_stamp_options_data.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
5
- # </copyright>
6
- # <summary>
7
- # Permission is hereby granted, free of charge, to any person obtaining a copy
8
- # of this software and associated documentation files (the "Software"), to deal
9
- # in the Software without restriction, including without limitation the rights
10
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- # copies of the Software, and to permit persons to whom the Software is
12
- # furnished to do so, subject to the following conditions:
13
- #
14
- # The above copyright notice and this permission notice shall be included in all
15
- # copies or substantial portions of the Software.
16
- #
17
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- # SOFTWARE.
24
- # </summary>
25
- # --------------------------------------------------------------------------------------------------------------------
26
- #
27
-
28
- require 'date'
29
-
30
- module GroupDocsSignatureCloud
31
- # Represents the Stamp Signature Options.
32
- class SignStampOptionsData
33
-
34
- # Gets or sets a document page number to put signature Value starts from 1
35
- attr_accessor :document_page_number
36
-
37
- # Page Options to specify pages to be verified.
38
- attr_accessor :pages_setup
39
-
40
- # Internal property that specify the name of Options.
41
- attr_accessor :options_type
42
-
43
- # Gets or sets the signature image file name. This property is used only if ImageStream is not specified.
44
- attr_accessor :image_guid
45
-
46
- # Left X position of Signature on Document Page in Measure values (pixels or percent see LocationMeasureType). (works if horizontal alignment is not specified).
47
- attr_accessor :left
48
-
49
- # Top Y Position of Signature on Document Page in Measure values (pixels or percent see LocationMeasureType). (works if vertical alignment is not specified).
50
- attr_accessor :top
51
-
52
- # Width of Signature on Document Page in Measure values (pixels or percent see SizeMeasureType).
53
- attr_accessor :width
54
-
55
- # Height of Signature on Document Page in Measure values (pixels or percent see SizeMeasureType).
56
- attr_accessor :height
57
-
58
- # Measure type (pixels or percent) for Left and Top properties.
59
- attr_accessor :location_measure_type
60
-
61
- # Measure type (pixels or percent) for Width and Height properties.
62
- attr_accessor :size_measure_type
63
-
64
- # Rotation angle of signature on document page (clockwise).
65
- attr_accessor :rotation_angle
66
-
67
- # Horizontal alignment of signature on document page.
68
- attr_accessor :horizontal_alignment
69
-
70
- # Vertical alignment of signature on document page.
71
- attr_accessor :vertical_alignment
72
-
73
- # Gets or sets the space between Sign and Document edges. (works ONLY if horizontal or vertical alignment are specified).
74
- attr_accessor :margin
75
-
76
- # Gets or sets the measure type (pixels or percent) for Margin.
77
- attr_accessor :margin_measure_type
78
-
79
- # Gets or sets the additional opacity for sign image (value from 0.0 (clear) through 1.0 (opaque)). By default the value is 1.0.
80
- attr_accessor :opacity
81
-
82
- # Put signature on all document pages.
83
- attr_accessor :sign_all_pages
84
-
85
- # List of Outer Lines rendered as concentric circles.
86
- attr_accessor :outer_lines
87
-
88
- # List of Inner Lines rendered as set of rectangles.
89
- attr_accessor :inner_lines
90
-
91
- # Gets or sets the background color of signature.
92
- attr_accessor :background_color
93
-
94
- # Gets or sets the signature background brush. Value by default is null. When property has a value it is used instead BackgroundBrush property.
95
- attr_accessor :background_brush
96
-
97
- # Gets or sets the background color crop type of signature.
98
- attr_accessor :background_color_crop_type
99
-
100
- # Gets or sets the background image crop type of signature.
101
- attr_accessor :background_image_crop_type
102
- class EnumAttributeValidator
103
- attr_reader :datatype
104
- attr_reader :allowable_values
105
-
106
- def initialize(datatype, allowable_values)
107
- @allowable_values = allowable_values.map do |value|
108
- case datatype.to_s
109
- when /Integer/i
110
- value.to_i
111
- when /Float/i
112
- value.to_f
113
- else
114
- value
115
- end
116
- end
117
- end
118
-
119
- def valid?(value)
120
- !value || allowable_values.include?(value)
121
- end
122
- end
123
-
124
- # Attribute mapping from ruby-style variable name to JSON key.
125
- def self.attribute_map
126
- {
127
- :'document_page_number' => :'DocumentPageNumber',
128
- :'pages_setup' => :'PagesSetup',
129
- :'options_type' => :'OptionsType',
130
- :'image_guid' => :'ImageGuid',
131
- :'left' => :'Left',
132
- :'top' => :'Top',
133
- :'width' => :'Width',
134
- :'height' => :'Height',
135
- :'location_measure_type' => :'LocationMeasureType',
136
- :'size_measure_type' => :'SizeMeasureType',
137
- :'rotation_angle' => :'RotationAngle',
138
- :'horizontal_alignment' => :'HorizontalAlignment',
139
- :'vertical_alignment' => :'VerticalAlignment',
140
- :'margin' => :'Margin',
141
- :'margin_measure_type' => :'MarginMeasureType',
142
- :'opacity' => :'Opacity',
143
- :'sign_all_pages' => :'SignAllPages',
144
- :'outer_lines' => :'OuterLines',
145
- :'inner_lines' => :'InnerLines',
146
- :'background_color' => :'BackgroundColor',
147
- :'background_brush' => :'BackgroundBrush',
148
- :'background_color_crop_type' => :'BackgroundColorCropType',
149
- :'background_image_crop_type' => :'BackgroundImageCropType'
150
- }
151
- end
152
-
153
- # Attribute type mapping.
154
- def self.swagger_types
155
- {
156
- :'document_page_number' => :'Integer',
157
- :'pages_setup' => :'PagesSetupData',
158
- :'options_type' => :'String',
159
- :'image_guid' => :'String',
160
- :'left' => :'Integer',
161
- :'top' => :'Integer',
162
- :'width' => :'Integer',
163
- :'height' => :'Integer',
164
- :'location_measure_type' => :'String',
165
- :'size_measure_type' => :'String',
166
- :'rotation_angle' => :'Integer',
167
- :'horizontal_alignment' => :'String',
168
- :'vertical_alignment' => :'String',
169
- :'margin' => :'PaddingData',
170
- :'margin_measure_type' => :'String',
171
- :'opacity' => :'Float',
172
- :'sign_all_pages' => :'BOOLEAN',
173
- :'outer_lines' => :'Array<StampLineData>',
174
- :'inner_lines' => :'Array<StampLineData>',
175
- :'background_color' => :'Color',
176
- :'background_brush' => :'BrushData',
177
- :'background_color_crop_type' => :'String',
178
- :'background_image_crop_type' => :'String'
179
- }
180
- end
181
-
182
- # Initializes the object
183
- # @param [Hash] attributes Model attributes in the form of hash
184
- def initialize(attributes = {})
185
- return unless attributes.is_a?(Hash)
186
-
187
- # convert string to symbol for hash key
188
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
189
-
190
- if attributes.key?(:'DocumentPageNumber')
191
- self.document_page_number = attributes[:'DocumentPageNumber']
192
- end
193
-
194
- if attributes.key?(:'PagesSetup')
195
- self.pages_setup = attributes[:'PagesSetup']
196
- end
197
-
198
- if attributes.key?(:'OptionsType')
199
- self.options_type = attributes[:'OptionsType']
200
- end
201
-
202
- if attributes.key?(:'ImageGuid')
203
- self.image_guid = attributes[:'ImageGuid']
204
- end
205
-
206
- if attributes.key?(:'Left')
207
- self.left = attributes[:'Left']
208
- end
209
-
210
- if attributes.key?(:'Top')
211
- self.top = attributes[:'Top']
212
- end
213
-
214
- if attributes.key?(:'Width')
215
- self.width = attributes[:'Width']
216
- end
217
-
218
- if attributes.key?(:'Height')
219
- self.height = attributes[:'Height']
220
- end
221
-
222
- if attributes.key?(:'LocationMeasureType')
223
- self.location_measure_type = attributes[:'LocationMeasureType']
224
- end
225
-
226
- if attributes.key?(:'SizeMeasureType')
227
- self.size_measure_type = attributes[:'SizeMeasureType']
228
- end
229
-
230
- if attributes.key?(:'RotationAngle')
231
- self.rotation_angle = attributes[:'RotationAngle']
232
- end
233
-
234
- if attributes.key?(:'HorizontalAlignment')
235
- self.horizontal_alignment = attributes[:'HorizontalAlignment']
236
- end
237
-
238
- if attributes.key?(:'VerticalAlignment')
239
- self.vertical_alignment = attributes[:'VerticalAlignment']
240
- end
241
-
242
- if attributes.key?(:'Margin')
243
- self.margin = attributes[:'Margin']
244
- end
245
-
246
- if attributes.key?(:'MarginMeasureType')
247
- self.margin_measure_type = attributes[:'MarginMeasureType']
248
- end
249
-
250
- if attributes.key?(:'Opacity')
251
- self.opacity = attributes[:'Opacity']
252
- end
253
-
254
- if attributes.key?(:'SignAllPages')
255
- self.sign_all_pages = attributes[:'SignAllPages']
256
- end
257
-
258
- if attributes.key?(:'OuterLines')
259
- if (value = attributes[:'OuterLines']).is_a?(Array)
260
- self.outer_lines = value
261
- end
262
- end
263
-
264
- if attributes.key?(:'InnerLines')
265
- if (value = attributes[:'InnerLines']).is_a?(Array)
266
- self.inner_lines = value
267
- end
268
- end
269
-
270
- if attributes.key?(:'BackgroundColor')
271
- self.background_color = attributes[:'BackgroundColor']
272
- end
273
-
274
- if attributes.key?(:'BackgroundBrush')
275
- self.background_brush = attributes[:'BackgroundBrush']
276
- end
277
-
278
- if attributes.key?(:'BackgroundColorCropType')
279
- self.background_color_crop_type = attributes[:'BackgroundColorCropType']
280
- end
281
-
282
- if attributes.key?(:'BackgroundImageCropType')
283
- self.background_image_crop_type = attributes[:'BackgroundImageCropType']
284
- end
285
-
286
-
287
- if !((defined? options_type) == nil)
288
- self.options_type = "SignStampOptionsData"
289
- end
290
-
291
- end
292
-
293
- # Show invalid properties with the reasons. Usually used together with valid?
294
- # @return Array for valid properies with the reasons
295
- def list_invalid_properties
296
- invalid_properties = []
297
- if @document_page_number.nil?
298
- invalid_properties.push("invalid value for 'document_page_number', document_page_number cannot be nil.")
299
- end
300
-
301
- return invalid_properties
302
- end
303
-
304
- # Check to see if the all the properties in the model are valid
305
- # @return true if the model is valid
306
- def valid?
307
- return false if @document_page_number.nil?
308
- location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
309
- return false unless location_measure_type_validator.valid?(@location_measure_type)
310
- size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
311
- return false unless size_measure_type_validator.valid?(@size_measure_type)
312
- horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
313
- return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
314
- vertical_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
315
- return false unless vertical_alignment_validator.valid?(@vertical_alignment)
316
- margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
317
- return false unless margin_measure_type_validator.valid?(@margin_measure_type)
318
- background_color_crop_type_validator = EnumAttributeValidator.new('String', ["None", "OuterArea", "MiddleArea", "InnerArea"])
319
- return false unless background_color_crop_type_validator.valid?(@background_color_crop_type)
320
- background_image_crop_type_validator = EnumAttributeValidator.new('String', ["None", "OuterArea", "MiddleArea", "InnerArea"])
321
- return false unless background_image_crop_type_validator.valid?(@background_image_crop_type)
322
- return true
323
- end
324
-
325
- # Custom attribute writer method checking allowed values (enum).
326
- # @param [Object] location_measure_type Object to be assigned
327
- def location_measure_type=(location_measure_type)
328
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
329
- if location_measure_type.to_i == 0
330
- unless validator.valid?(location_measure_type)
331
- raise ArgumentError, "invalid value for 'location_measure_type', must be one of #{validator.allowable_values}."
332
- end
333
- @location_measure_type = location_measure_type
334
- else
335
- @location_measure_type = validator.allowable_values[location_measure_type.to_i]
336
- end
337
- end
338
-
339
- # Custom attribute writer method checking allowed values (enum).
340
- # @param [Object] size_measure_type Object to be assigned
341
- def size_measure_type=(size_measure_type)
342
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
343
- if size_measure_type.to_i == 0
344
- unless validator.valid?(size_measure_type)
345
- raise ArgumentError, "invalid value for 'size_measure_type', must be one of #{validator.allowable_values}."
346
- end
347
- @size_measure_type = size_measure_type
348
- else
349
- @size_measure_type = validator.allowable_values[size_measure_type.to_i]
350
- end
351
- end
352
-
353
- # Custom attribute writer method checking allowed values (enum).
354
- # @param [Object] horizontal_alignment Object to be assigned
355
- def horizontal_alignment=(horizontal_alignment)
356
- validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
357
- if horizontal_alignment.to_i == 0
358
- unless validator.valid?(horizontal_alignment)
359
- raise ArgumentError, "invalid value for 'horizontal_alignment', must be one of #{validator.allowable_values}."
360
- end
361
- @horizontal_alignment = horizontal_alignment
362
- else
363
- @horizontal_alignment = validator.allowable_values[horizontal_alignment.to_i]
364
- end
365
- end
366
-
367
- # Custom attribute writer method checking allowed values (enum).
368
- # @param [Object] vertical_alignment Object to be assigned
369
- def vertical_alignment=(vertical_alignment)
370
- validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
371
- if vertical_alignment.to_i == 0
372
- unless validator.valid?(vertical_alignment)
373
- raise ArgumentError, "invalid value for 'vertical_alignment', must be one of #{validator.allowable_values}."
374
- end
375
- @vertical_alignment = vertical_alignment
376
- else
377
- @vertical_alignment = validator.allowable_values[vertical_alignment.to_i]
378
- end
379
- end
380
-
381
- # Custom attribute writer method checking allowed values (enum).
382
- # @param [Object] margin_measure_type Object to be assigned
383
- def margin_measure_type=(margin_measure_type)
384
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
385
- if margin_measure_type.to_i == 0
386
- unless validator.valid?(margin_measure_type)
387
- raise ArgumentError, "invalid value for 'margin_measure_type', must be one of #{validator.allowable_values}."
388
- end
389
- @margin_measure_type = margin_measure_type
390
- else
391
- @margin_measure_type = validator.allowable_values[margin_measure_type.to_i]
392
- end
393
- end
394
-
395
- # Custom attribute writer method checking allowed values (enum).
396
- # @param [Object] background_color_crop_type Object to be assigned
397
- def background_color_crop_type=(background_color_crop_type)
398
- validator = EnumAttributeValidator.new('String', ["None", "OuterArea", "MiddleArea", "InnerArea"])
399
- if background_color_crop_type.to_i == 0
400
- unless validator.valid?(background_color_crop_type)
401
- raise ArgumentError, "invalid value for 'background_color_crop_type', must be one of #{validator.allowable_values}."
402
- end
403
- @background_color_crop_type = background_color_crop_type
404
- else
405
- @background_color_crop_type = validator.allowable_values[background_color_crop_type.to_i]
406
- end
407
- end
408
-
409
- # Custom attribute writer method checking allowed values (enum).
410
- # @param [Object] background_image_crop_type Object to be assigned
411
- def background_image_crop_type=(background_image_crop_type)
412
- validator = EnumAttributeValidator.new('String', ["None", "OuterArea", "MiddleArea", "InnerArea"])
413
- if background_image_crop_type.to_i == 0
414
- unless validator.valid?(background_image_crop_type)
415
- raise ArgumentError, "invalid value for 'background_image_crop_type', must be one of #{validator.allowable_values}."
416
- end
417
- @background_image_crop_type = background_image_crop_type
418
- else
419
- @background_image_crop_type = validator.allowable_values[background_image_crop_type.to_i]
420
- end
421
- end
422
-
423
- # Checks equality by comparing each attribute.
424
- # @param [Object] Object to be compared
425
- def ==(other)
426
- return true if self.equal?(other)
427
- self.class == other.class &&
428
- document_page_number == other.document_page_number &&
429
- pages_setup == other.pages_setup &&
430
- options_type == other.options_type &&
431
- image_guid == other.image_guid &&
432
- left == other.left &&
433
- top == other.top &&
434
- width == other.width &&
435
- height == other.height &&
436
- location_measure_type == other.location_measure_type &&
437
- size_measure_type == other.size_measure_type &&
438
- rotation_angle == other.rotation_angle &&
439
- horizontal_alignment == other.horizontal_alignment &&
440
- vertical_alignment == other.vertical_alignment &&
441
- margin == other.margin &&
442
- margin_measure_type == other.margin_measure_type &&
443
- opacity == other.opacity &&
444
- sign_all_pages == other.sign_all_pages &&
445
- outer_lines == other.outer_lines &&
446
- inner_lines == other.inner_lines &&
447
- background_color == other.background_color &&
448
- background_brush == other.background_brush &&
449
- background_color_crop_type == other.background_color_crop_type &&
450
- background_image_crop_type == other.background_image_crop_type
451
- end
452
-
453
- # @see the `==` method
454
- # @param [Object] Object to be compared
455
- def eql?(other)
456
- self == other
457
- end
458
-
459
- # Calculates hash code according to all attributes.
460
- # @return [Fixnum] Hash code
461
- def hash
462
- [document_page_number, pages_setup, options_type, image_guid, left, top, width, height, location_measure_type, size_measure_type, rotation_angle, horizontal_alignment, vertical_alignment, margin, margin_measure_type, opacity, sign_all_pages, outer_lines, inner_lines, background_color, background_brush, background_color_crop_type, background_image_crop_type].hash
463
- end
464
-
465
- # Builds the object from hash
466
- # @param [Hash] attributes Model attributes in the form of hash
467
- # @return [Object] Returns the model itself
468
- def build_from_hash(attributes)
469
- return nil unless attributes.is_a?(Hash)
470
- self.class.swagger_types.each_pair do |key, type|
471
-
472
- attributeName = self.class.attribute_map[key]
473
- attributeNameLowerStr = attributeName.to_s
474
- attributeNameLowerStr[0] = attributeNameLowerStr[0].downcase
475
- attributeNameLower = attributeNameLowerStr.to_sym
476
- attributeNameLowerStr2 = attributeName.to_s
477
- attributeNameLowerStr2[0] = attributeNameLowerStr[0].downcase
478
- attributeNameLowerStr2[1] = attributeNameLowerStr[1].downcase
479
- attributeNameLower2 = attributeNameLowerStr2.to_sym
480
-
481
- if type =~ /\AArray<(.*)>/i
482
- # check to ensure the input is an array given that the the attribute
483
- # is documented as an array but the input is not
484
- if attributes[attributeName].is_a?(Array)
485
- self.send("#{key}=", attributes[attributeName].map { |v| _deserialize($1, v) })
486
- end
487
- if attributes[attributeNameLower].is_a?(Array)
488
- self.send("#{key}=", attributes[attributeNameLower].map { |v| _deserialize($1, v) })
489
- end
490
- if attributes[attributeNameLower2].is_a?(Array)
491
- self.send("#{key}=", attributes[attributeNameLower2].map { |v| _deserialize($1, v) })
492
- end
493
- elsif !attributes[attributeName].nil?
494
- self.send("#{key}=", _deserialize(type, attributes[attributeName]))
495
- elsif !attributes[attributeNameLower].nil?
496
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower]))
497
- elsif !attributes[attributeNameLower2].nil?
498
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower2]))
499
- end
500
- # or else data not found in attributes(hash), not an issue as the data can be optional
501
- end
502
- self
503
- end
504
-
505
- # Deserializes the data based on type
506
- # @param string type Data type
507
- # @param string value Value to be deserialized
508
- # @return [Object] Deserialized data
509
- def _deserialize(type, value)
510
- case type.to_sym
511
- when :DateTime
512
- Time.at(/\d/.match(value)[0].to_f).to_datetime
513
- when :Date
514
- Time.at(/\d/.match(value)[0].to_f).to_date
515
- when :String
516
- value.to_s
517
- when :Integer
518
- value.to_i
519
- when :Float
520
- value.to_f
521
- when :BOOLEAN
522
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
523
- true
524
- else
525
- false
526
- end
527
- when :Object
528
- # generic object (usually a Hash), return directly
529
- value
530
- when /\AArray<(?<inner_type>.+)>\z/
531
- inner_type = Regexp.last_match[:inner_type]
532
- value.map { |v| _deserialize(inner_type, v) }
533
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
534
- k_type = Regexp.last_match[:k_type]
535
- v_type = Regexp.last_match[:v_type]
536
- {}.tap do |hash|
537
- value.each do |k, v|
538
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
539
- end
540
- end
541
- else
542
- # model
543
- temp_model = GroupDocsSignatureCloud.const_get(type).new
544
- temp_model.build_from_hash(value)
545
- end
546
- end
547
-
548
- # Returns the string representation of the object
549
- # @return [String] String presentation of the object
550
- def to_s
551
- to_hash.to_s
552
- end
553
-
554
- # to_body is an alias to to_hash (backward compatibility)
555
- # @return [Hash] Returns the object in the form of hash
556
- def to_body
557
- to_hash
558
- end
559
-
560
- # Returns the object in the form of hash
561
- # @return [Hash] Returns the object in the form of hash
562
- def to_hash
563
- hash = {}
564
- self.class.attribute_map.each_pair do |attr, param|
565
- value = self.send(attr)
566
- next if value.nil?
567
- hash[param] = _to_hash(value)
568
- end
569
- hash
570
- end
571
-
572
- # Outputs non-array value in the form of hash
573
- # For object, use to_hash. Otherwise, just return the value
574
- # @param [Object] value Any valid value
575
- # @return [Hash] Returns the value in the form of hash
576
- def _to_hash(value)
577
- if value.is_a?(Array)
578
- value.compact.map { |v| _to_hash(v) }
579
- elsif value.is_a?(Hash)
580
- {}.tap do |hash|
581
- value.each { |k, v| hash[k] = _to_hash(v) }
582
- end
583
- elsif value.respond_to? :to_hash
584
- value.to_hash
585
- else
586
- value
587
- end
588
- end
589
-
590
- end
591
-
592
- end
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="sign_image_options.rb">
4
+ # Copyright (c) 2003-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
+ # Represents the Image sign options
32
+ class SignImageOptions
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
+ # Gets or sets the signature image file name. This property is used only if ImageStream is not specified
50
+ attr_accessor :image_guid
51
+
52
+ # Left X position of Signature on Document Page in Measure values (pixels or percent see MeasureType LocationMeasureType). (works if horizontal alignment is not specified). For Spreadsheet documents this property is mutually exclusive with Column property. If Left property is set ColumnNumber will be reset to 0
53
+ attr_accessor :left
54
+
55
+ # Top Y Position of Signature on Document Page in Measure values (pixels or percent see MeasureType LocationMeasureType). (works if vertical alignment is not specified). For Spreadsheet documents this property is mutually exclusive with Row property. If Top property is set RowNumber will be reset to 0
56
+ attr_accessor :top
57
+
58
+ # Width of Signature on Document Page in Measure values (pixels or percent see MeasureType SizeMeasureType)
59
+ attr_accessor :width
60
+
61
+ # Height of Signature on Document Page in Measure values (pixels or percent see MeasureType SizeMeasureType)
62
+ attr_accessor :height
63
+
64
+ # Measure type (pixels or percent) for Left and Top properties
65
+ attr_accessor :location_measure_type
66
+
67
+ # Measure type (pixels or percent) for Width and Height properties
68
+ attr_accessor :size_measure_type
69
+
70
+ # Rotation angle of signature on document page (clockwise)
71
+ attr_accessor :rotation_angle
72
+
73
+ # Horizontal alignment of signature on document page
74
+ attr_accessor :horizontal_alignment
75
+
76
+ # Vertical alignment of signature on document page
77
+ attr_accessor :vertical_alignment
78
+
79
+ # Gets or sets the space between Sign and Document edges (works ONLY if horizontal or vertical alignment are specified)
80
+ attr_accessor :margin
81
+
82
+ # Gets or sets the measure type (pixels or percent) for Margin
83
+ attr_accessor :margin_measure_type
84
+
85
+ # Gets or sets the additional opacity for sign image (value from 0.0 (clear) through 1.0 (opaque)). By default the value is 1.0
86
+ attr_accessor :opacity
87
+ class EnumAttributeValidator
88
+ attr_reader :datatype
89
+ attr_reader :allowable_values
90
+
91
+ def initialize(datatype, allowable_values)
92
+ @allowable_values = allowable_values.map do |value|
93
+ case datatype.to_s
94
+ when /Integer/i
95
+ value.to_i
96
+ when /Float/i
97
+ value.to_f
98
+ else
99
+ value
100
+ end
101
+ end
102
+ end
103
+
104
+ def valid?(value)
105
+ !value || allowable_values.include?(value)
106
+ end
107
+ end
108
+
109
+ # Attribute mapping from ruby-style variable name to JSON key.
110
+ def self.attribute_map
111
+ {
112
+ :'document_type' => :'DocumentType',
113
+ :'signature_type' => :'SignatureType',
114
+ :'page' => :'Page',
115
+ :'all_pages' => :'AllPages',
116
+ :'pages_setup' => :'PagesSetup',
117
+ :'image_guid' => :'ImageGuid',
118
+ :'left' => :'Left',
119
+ :'top' => :'Top',
120
+ :'width' => :'Width',
121
+ :'height' => :'Height',
122
+ :'location_measure_type' => :'LocationMeasureType',
123
+ :'size_measure_type' => :'SizeMeasureType',
124
+ :'rotation_angle' => :'RotationAngle',
125
+ :'horizontal_alignment' => :'HorizontalAlignment',
126
+ :'vertical_alignment' => :'VerticalAlignment',
127
+ :'margin' => :'Margin',
128
+ :'margin_measure_type' => :'MarginMeasureType',
129
+ :'opacity' => :'Opacity'
130
+ }
131
+ end
132
+
133
+ # Attribute type mapping.
134
+ def self.swagger_types
135
+ {
136
+ :'document_type' => :'String',
137
+ :'signature_type' => :'String',
138
+ :'page' => :'Integer',
139
+ :'all_pages' => :'BOOLEAN',
140
+ :'pages_setup' => :'PagesSetup',
141
+ :'image_guid' => :'String',
142
+ :'left' => :'Integer',
143
+ :'top' => :'Integer',
144
+ :'width' => :'Integer',
145
+ :'height' => :'Integer',
146
+ :'location_measure_type' => :'String',
147
+ :'size_measure_type' => :'String',
148
+ :'rotation_angle' => :'Integer',
149
+ :'horizontal_alignment' => :'String',
150
+ :'vertical_alignment' => :'String',
151
+ :'margin' => :'Padding',
152
+ :'margin_measure_type' => :'String',
153
+ :'opacity' => :'Float'
154
+ }
155
+ end
156
+
157
+ # Initializes the object
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ def initialize(attributes = {})
160
+ return unless attributes.is_a?(Hash)
161
+
162
+ # convert string to symbol for hash key
163
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
164
+
165
+ if attributes.key?(:'DocumentType')
166
+ self.document_type = attributes[:'DocumentType']
167
+ end
168
+
169
+ if attributes.key?(:'SignatureType')
170
+ self.signature_type = attributes[:'SignatureType']
171
+ end
172
+
173
+ if attributes.key?(:'Page')
174
+ self.page = attributes[:'Page']
175
+ end
176
+
177
+ if attributes.key?(:'AllPages')
178
+ self.all_pages = attributes[:'AllPages']
179
+ end
180
+
181
+ if attributes.key?(:'PagesSetup')
182
+ self.pages_setup = attributes[:'PagesSetup']
183
+ end
184
+
185
+ if attributes.key?(:'ImageGuid')
186
+ self.image_guid = attributes[:'ImageGuid']
187
+ end
188
+
189
+ if attributes.key?(:'Left')
190
+ self.left = attributes[:'Left']
191
+ end
192
+
193
+ if attributes.key?(:'Top')
194
+ self.top = attributes[:'Top']
195
+ end
196
+
197
+ if attributes.key?(:'Width')
198
+ self.width = attributes[:'Width']
199
+ end
200
+
201
+ if attributes.key?(:'Height')
202
+ self.height = attributes[:'Height']
203
+ end
204
+
205
+ if attributes.key?(:'LocationMeasureType')
206
+ self.location_measure_type = attributes[:'LocationMeasureType']
207
+ end
208
+
209
+ if attributes.key?(:'SizeMeasureType')
210
+ self.size_measure_type = attributes[:'SizeMeasureType']
211
+ end
212
+
213
+ if attributes.key?(:'RotationAngle')
214
+ self.rotation_angle = attributes[:'RotationAngle']
215
+ end
216
+
217
+ if attributes.key?(:'HorizontalAlignment')
218
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
219
+ end
220
+
221
+ if attributes.key?(:'VerticalAlignment')
222
+ self.vertical_alignment = attributes[:'VerticalAlignment']
223
+ end
224
+
225
+ if attributes.key?(:'Margin')
226
+ self.margin = attributes[:'Margin']
227
+ end
228
+
229
+ if attributes.key?(:'MarginMeasureType')
230
+ self.margin_measure_type = attributes[:'MarginMeasureType']
231
+ end
232
+
233
+ if attributes.key?(:'Opacity')
234
+ self.opacity = attributes[:'Opacity']
235
+ end
236
+
237
+ end
238
+
239
+ # Show invalid properties with the reasons. Usually used together with valid?
240
+ # @return Array for valid properies with the reasons
241
+ def list_invalid_properties
242
+ invalid_properties = []
243
+ if @document_type.nil?
244
+ invalid_properties.push("invalid value for 'document_type', document_type cannot be nil.")
245
+ end
246
+
247
+ if @signature_type.nil?
248
+ invalid_properties.push("invalid value for 'signature_type', signature_type cannot be nil.")
249
+ end
250
+
251
+ if @all_pages.nil?
252
+ invalid_properties.push("invalid value for 'all_pages', all_pages cannot be nil.")
253
+ end
254
+
255
+ if @left.nil?
256
+ invalid_properties.push("invalid value for 'left', left cannot be nil.")
257
+ end
258
+
259
+ if @top.nil?
260
+ invalid_properties.push("invalid value for 'top', top cannot be nil.")
261
+ end
262
+
263
+ if @width.nil?
264
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
265
+ end
266
+
267
+ if @height.nil?
268
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
269
+ end
270
+
271
+ if @location_measure_type.nil?
272
+ invalid_properties.push("invalid value for 'location_measure_type', location_measure_type cannot be nil.")
273
+ end
274
+
275
+ if @size_measure_type.nil?
276
+ invalid_properties.push("invalid value for 'size_measure_type', size_measure_type cannot be nil.")
277
+ end
278
+
279
+ if @rotation_angle.nil?
280
+ invalid_properties.push("invalid value for 'rotation_angle', rotation_angle cannot be nil.")
281
+ end
282
+
283
+ if @horizontal_alignment.nil?
284
+ invalid_properties.push("invalid value for 'horizontal_alignment', horizontal_alignment cannot be nil.")
285
+ end
286
+
287
+ if @vertical_alignment.nil?
288
+ invalid_properties.push("invalid value for 'vertical_alignment', vertical_alignment cannot be nil.")
289
+ end
290
+
291
+ if @margin_measure_type.nil?
292
+ invalid_properties.push("invalid value for 'margin_measure_type', margin_measure_type cannot be nil.")
293
+ end
294
+
295
+ if @opacity.nil?
296
+ invalid_properties.push("invalid value for 'opacity', opacity cannot be nil.")
297
+ end
298
+
299
+ return invalid_properties
300
+ end
301
+
302
+ # Check to see if the all the properties in the model are valid
303
+ # @return true if the model is valid
304
+ def valid?
305
+ return false if @document_type.nil?
306
+ document_type_validator = EnumAttributeValidator.new('String', ["Image", "Pdf", "Presentation", "Spreadsheet", "WordProcessing"])
307
+ return false unless document_type_validator.valid?(@document_type)
308
+ return false if @signature_type.nil?
309
+ signature_type_validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp"])
310
+ return false unless signature_type_validator.valid?(@signature_type)
311
+ return false if @all_pages.nil?
312
+ return false if @left.nil?
313
+ return false if @top.nil?
314
+ return false if @width.nil?
315
+ return false if @height.nil?
316
+ return false if @location_measure_type.nil?
317
+ location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
318
+ return false unless location_measure_type_validator.valid?(@location_measure_type)
319
+ return false if @size_measure_type.nil?
320
+ size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
321
+ return false unless size_measure_type_validator.valid?(@size_measure_type)
322
+ return false if @rotation_angle.nil?
323
+ return false if @horizontal_alignment.nil?
324
+ horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
325
+ return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
326
+ return false if @vertical_alignment.nil?
327
+ vertical_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
328
+ return false unless vertical_alignment_validator.valid?(@vertical_alignment)
329
+ return false if @margin_measure_type.nil?
330
+ margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
331
+ return false unless margin_measure_type_validator.valid?(@margin_measure_type)
332
+ return false if @opacity.nil?
333
+ return true
334
+ end
335
+
336
+ # Custom attribute writer method checking allowed values (enum).
337
+ # @param [Object] document_type Object to be assigned
338
+ def document_type=(document_type)
339
+ validator = EnumAttributeValidator.new('String', ["Image", "Pdf", "Presentation", "Spreadsheet", "WordProcessing"])
340
+ if document_type.to_i == 0
341
+ unless validator.valid?(document_type)
342
+ raise ArgumentError, "invalid value for 'document_type', must be one of #{validator.allowable_values}."
343
+ end
344
+ @document_type = document_type
345
+ else
346
+ @document_type = validator.allowable_values[document_type.to_i]
347
+ end
348
+ end
349
+
350
+ # Custom attribute writer method checking allowed values (enum).
351
+ # @param [Object] signature_type Object to be assigned
352
+ def signature_type=(signature_type)
353
+ validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp"])
354
+ if signature_type.to_i == 0
355
+ unless validator.valid?(signature_type)
356
+ raise ArgumentError, "invalid value for 'signature_type', must be one of #{validator.allowable_values}."
357
+ end
358
+ @signature_type = signature_type
359
+ else
360
+ @signature_type = validator.allowable_values[signature_type.to_i]
361
+ end
362
+ end
363
+
364
+ # Custom attribute writer method checking allowed values (enum).
365
+ # @param [Object] location_measure_type Object to be assigned
366
+ def location_measure_type=(location_measure_type)
367
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
368
+ if location_measure_type.to_i == 0
369
+ unless validator.valid?(location_measure_type)
370
+ raise ArgumentError, "invalid value for 'location_measure_type', must be one of #{validator.allowable_values}."
371
+ end
372
+ @location_measure_type = location_measure_type
373
+ else
374
+ @location_measure_type = validator.allowable_values[location_measure_type.to_i]
375
+ end
376
+ end
377
+
378
+ # Custom attribute writer method checking allowed values (enum).
379
+ # @param [Object] size_measure_type Object to be assigned
380
+ def size_measure_type=(size_measure_type)
381
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
382
+ if size_measure_type.to_i == 0
383
+ unless validator.valid?(size_measure_type)
384
+ raise ArgumentError, "invalid value for 'size_measure_type', must be one of #{validator.allowable_values}."
385
+ end
386
+ @size_measure_type = size_measure_type
387
+ else
388
+ @size_measure_type = validator.allowable_values[size_measure_type.to_i]
389
+ end
390
+ end
391
+
392
+ # Custom attribute writer method checking allowed values (enum).
393
+ # @param [Object] horizontal_alignment Object to be assigned
394
+ def horizontal_alignment=(horizontal_alignment)
395
+ validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
396
+ if horizontal_alignment.to_i == 0
397
+ unless validator.valid?(horizontal_alignment)
398
+ raise ArgumentError, "invalid value for 'horizontal_alignment', must be one of #{validator.allowable_values}."
399
+ end
400
+ @horizontal_alignment = horizontal_alignment
401
+ else
402
+ @horizontal_alignment = validator.allowable_values[horizontal_alignment.to_i]
403
+ end
404
+ end
405
+
406
+ # Custom attribute writer method checking allowed values (enum).
407
+ # @param [Object] vertical_alignment Object to be assigned
408
+ def vertical_alignment=(vertical_alignment)
409
+ validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
410
+ if vertical_alignment.to_i == 0
411
+ unless validator.valid?(vertical_alignment)
412
+ raise ArgumentError, "invalid value for 'vertical_alignment', must be one of #{validator.allowable_values}."
413
+ end
414
+ @vertical_alignment = vertical_alignment
415
+ else
416
+ @vertical_alignment = validator.allowable_values[vertical_alignment.to_i]
417
+ end
418
+ end
419
+
420
+ # Custom attribute writer method checking allowed values (enum).
421
+ # @param [Object] margin_measure_type Object to be assigned
422
+ def margin_measure_type=(margin_measure_type)
423
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
424
+ if margin_measure_type.to_i == 0
425
+ unless validator.valid?(margin_measure_type)
426
+ raise ArgumentError, "invalid value for 'margin_measure_type', must be one of #{validator.allowable_values}."
427
+ end
428
+ @margin_measure_type = margin_measure_type
429
+ else
430
+ @margin_measure_type = validator.allowable_values[margin_measure_type.to_i]
431
+ end
432
+ end
433
+
434
+ # Checks equality by comparing each attribute.
435
+ # @param [Object] Object to be compared
436
+ def ==(other)
437
+ return true if self.equal?(other)
438
+ self.class == other.class &&
439
+ document_type == other.document_type &&
440
+ signature_type == other.signature_type &&
441
+ page == other.page &&
442
+ all_pages == other.all_pages &&
443
+ pages_setup == other.pages_setup &&
444
+ image_guid == other.image_guid &&
445
+ left == other.left &&
446
+ top == other.top &&
447
+ width == other.width &&
448
+ height == other.height &&
449
+ location_measure_type == other.location_measure_type &&
450
+ size_measure_type == other.size_measure_type &&
451
+ rotation_angle == other.rotation_angle &&
452
+ horizontal_alignment == other.horizontal_alignment &&
453
+ vertical_alignment == other.vertical_alignment &&
454
+ margin == other.margin &&
455
+ margin_measure_type == other.margin_measure_type &&
456
+ opacity == other.opacity
457
+ end
458
+
459
+ # @see the `==` method
460
+ # @param [Object] Object to be compared
461
+ def eql?(other)
462
+ self == other
463
+ end
464
+
465
+ # Calculates hash code according to all attributes.
466
+ # @return [Fixnum] Hash code
467
+ def hash
468
+ [document_type, signature_type, page, all_pages, pages_setup, image_guid, left, top, width, height, location_measure_type, size_measure_type, rotation_angle, horizontal_alignment, vertical_alignment, margin, margin_measure_type, opacity].hash
469
+ end
470
+
471
+ # Downcases first letter.
472
+ # @return downcased string
473
+ def uncap(str)
474
+ str[0, 1].downcase + str[1..-1]
475
+ end
476
+
477
+ # Builds the object from hash
478
+ # @param [Hash] attributes Model attributes in the form of hash
479
+ # @return [Object] Returns the model itself
480
+ def build_from_hash(attributes)
481
+ return nil unless attributes.is_a?(Hash)
482
+ self.class.swagger_types.each_pair do |key, type|
483
+ pname = uncap(self.class.attribute_map[key]).intern
484
+ value = attributes[pname]
485
+ if type =~ /\AArray<(.*)>/i
486
+ # check to ensure the input is an array given that the the attribute
487
+ # is documented as an array but the input is not
488
+ if value.is_a?(Array)
489
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
490
+ end
491
+ elsif !value.nil?
492
+ self.send("#{key}=", _deserialize(type, value))
493
+ end
494
+ # or else data not found in attributes(hash), not an issue as the data can be optional
495
+ end
496
+
497
+ self
498
+ end
499
+
500
+ # Deserializes the data based on type
501
+ # @param string type Data type
502
+ # @param string value Value to be deserialized
503
+ # @return [Object] Deserialized data
504
+ def _deserialize(type, value)
505
+ case type.to_sym
506
+ when :DateTime
507
+ Date.parse value
508
+ when :Date
509
+ Date.parse value
510
+ when :String
511
+ value.to_s
512
+ when :Integer
513
+ value.to_i
514
+ when :Float
515
+ value.to_f
516
+ when :BOOLEAN
517
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
518
+ true
519
+ else
520
+ false
521
+ end
522
+ when :Object
523
+ # generic object (usually a Hash), return directly
524
+ value
525
+ when /\AArray<(?<inner_type>.+)>\z/
526
+ inner_type = Regexp.last_match[:inner_type]
527
+ value.map { |v| _deserialize(inner_type, v) }
528
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
529
+ k_type = Regexp.last_match[:k_type]
530
+ v_type = Regexp.last_match[:v_type]
531
+ {}.tap do |hash|
532
+ value.each do |k, v|
533
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
534
+ end
535
+ end
536
+ else
537
+ # model
538
+ # Signature type fix
539
+ ttype = type
540
+ if value.is_a?(Hash) and !value[:signatureType].nil?
541
+ ttype = value[:signatureType] + 'Signature'
542
+ end
543
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
544
+ temp_model.build_from_hash(value)
545
+ end
546
+ end
547
+
548
+ # Returns the string representation of the object
549
+ # @return [String] String presentation of the object
550
+ def to_s
551
+ to_hash.to_s
552
+ end
553
+
554
+ # to_body is an alias to to_hash (backward compatibility)
555
+ # @return [Hash] Returns the object in the form of hash
556
+ def to_body
557
+ to_hash
558
+ end
559
+
560
+ # Returns the object in the form of hash
561
+ # @return [Hash] Returns the object in the form of hash
562
+ def to_hash
563
+ hash = {}
564
+ self.class.attribute_map.each_pair do |attr, param|
565
+ value = self.send(attr)
566
+ next if value.nil?
567
+ hash[param] = _to_hash(value)
568
+ end
569
+ hash
570
+ end
571
+
572
+ # Outputs non-array value in the form of hash
573
+ # For object, use to_hash. Otherwise, just return the value
574
+ # @param [Object] value Any valid value
575
+ # @return [Hash] Returns the value in the form of hash
576
+ def _to_hash(value)
577
+ if value.is_a?(Array)
578
+ value.compact.map { |v| _to_hash(v) }
579
+ elsif value.is_a?(Hash)
580
+ {}.tap do |hash|
581
+ value.each { |k, v| hash[k] = _to_hash(v) }
582
+ end
583
+ elsif value.respond_to? :to_hash
584
+ value.to_hash
585
+ else
586
+ value
587
+ end
588
+ end
589
+
590
+ end
591
+
592
+ end