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