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