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
@@ -0,0 +1,231 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="search_settings.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
+ # Defines signatures search settings request
32
+ class SearchSettings
33
+
34
+ # File info
35
+ attr_accessor :file_info
36
+
37
+ # Gets or sets options collection to perform search in a document
38
+ attr_accessor :options
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'file_info' => :'FileInfo',
44
+ :'options' => :'Options'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'file_info' => :'FileInfo',
52
+ :'options' => :'Array<SearchOptions>'
53
+ }
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ return unless attributes.is_a?(Hash)
60
+
61
+ # convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
63
+
64
+ if attributes.key?(:'FileInfo')
65
+ self.file_info = attributes[:'FileInfo']
66
+ end
67
+
68
+ if attributes.key?(:'Options')
69
+ if (value = attributes[:'Options']).is_a?(Array)
70
+ self.options = value
71
+ end
72
+ end
73
+
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properies with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = []
80
+ return invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ return true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(other)
92
+ return true if self.equal?(other)
93
+ self.class == other.class &&
94
+ file_info == other.file_info &&
95
+ options == other.options
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(other)
101
+ self == other
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Fixnum] Hash code
106
+ def hash
107
+ [file_info, options].hash
108
+ end
109
+
110
+ # Downcases first letter.
111
+ # @return downcased string
112
+ def uncap(str)
113
+ str[0, 1].downcase + str[1..-1]
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ self.class.swagger_types.each_pair do |key, type|
122
+ pname = uncap(self.class.attribute_map[key]).intern
123
+ value = attributes[pname]
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the the attribute
126
+ # is documented as an array but the input is not
127
+ if value.is_a?(Array)
128
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !value.nil?
131
+ self.send("#{key}=", _deserialize(type, value))
132
+ end
133
+ # or else data not found in attributes(hash), not an issue as the data can be optional
134
+ end
135
+
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :DateTime
146
+ Date.parse value
147
+ when :Date
148
+ Date.parse value
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :BOOLEAN
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else
176
+ # model
177
+ # Signature type fix
178
+ ttype = type
179
+ if value.is_a?(Hash) and !value[:signatureType].nil?
180
+ ttype = value[:signatureType] + 'Signature'
181
+ end
182
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
183
+ temp_model.build_from_hash(value)
184
+ end
185
+ end
186
+
187
+ # Returns the string representation of the object
188
+ # @return [String] String presentation of the object
189
+ def to_s
190
+ to_hash.to_s
191
+ end
192
+
193
+ # to_body is an alias to to_hash (backward compatibility)
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_body
196
+ to_hash
197
+ end
198
+
199
+ # Returns the object in the form of hash
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_hash
202
+ hash = {}
203
+ self.class.attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ next if value.nil?
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+
229
+ end
230
+
231
+ end
@@ -1,706 +1,857 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="images_sign_text_options_data.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
5
- # </copyright>
6
- # <summary>
7
- # Permission is hereby granted, free of charge, to any person obtaining a copy
8
- # of this software and associated documentation files (the "Software"), to deal
9
- # in the Software without restriction, including without limitation the rights
10
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- # copies of the Software, and to permit persons to whom the Software is
12
- # furnished to do so, subject to the following conditions:
13
- #
14
- # The above copyright notice and this permission notice shall be included in all
15
- # copies or substantial portions of the Software.
16
- #
17
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- # SOFTWARE.
24
- # </summary>
25
- # --------------------------------------------------------------------------------------------------------------------
26
- #
27
-
28
- require 'date'
29
-
30
- module GroupDocsSignatureCloud
31
- # Represents the Text Sign Options for Images Documents.
32
- class ImagesSignTextOptionsData
33
-
34
- # Gets or sets document page number for signing. This property can only be used for multi-frames image formats (Tiff). Minimal value is 1.
35
- attr_accessor :document_page_number
36
-
37
- # Options to specify pages to be signed. This property can only be used for multi-frames image formats (Tiff).
38
- attr_accessor :pages_setup
39
-
40
- # Internal property that specify the name of Options.
41
- attr_accessor :options_type
42
-
43
- # Left X position of Signature on Document Page in Measure values (pixels or percent see LocationMeasureType property)
44
- attr_accessor :left
45
-
46
- # Top Y Position of Signature on Document Page in Measure values (pixels or percent see LocationMeasureType property)
47
- attr_accessor :top
48
-
49
- # Width of Signature area on Document Page in Measure values (pixels or percent see SizeMeasureType property)
50
- attr_accessor :width
51
-
52
- # Height of Signature are on Document Page in Measure values (pixels or percent see SizeMeasureType property)
53
- attr_accessor :height
54
-
55
- # Measure type (pixels or percent) for Left and Top properties.
56
- attr_accessor :location_measure_type
57
-
58
- # Measure type (pixels or percent) for Width and Height properties.
59
- attr_accessor :size_measure_type
60
-
61
- # Stretch mode on Document Page
62
- attr_accessor :stretch
63
-
64
- # Rotation angle of signature on document page (clockwise).
65
- attr_accessor :rotation_angle
66
-
67
- # Horizontal alignment of signature on document page.
68
- attr_accessor :horizontal_alignment
69
-
70
- # Vertical alignment of signature on document page.
71
- attr_accessor :vertical_alignment
72
-
73
- # Gets or sets the space between Sign and Document edges. (works ONLY if horizontal or vertical alignment are specified).
74
- attr_accessor :margin
75
-
76
- # Gets or sets the measure type (pixels or percent) for Margin.
77
- attr_accessor :margin_measure_type
78
-
79
- # Text of signature
80
- attr_accessor :text
81
-
82
- # Put signature on all document pages. This property can only be used for multi-frames image formats (Tiff).
83
- attr_accessor :sign_all_pages
84
-
85
- # Gets or sets the font of signature.
86
- attr_accessor :font
87
-
88
- # Gets or sets the fore color of signature.
89
- attr_accessor :fore_color
90
-
91
- # Gets or sets the border color of signature.
92
- attr_accessor :border_color
93
-
94
- # Gets or sets the background color of signature.
95
- attr_accessor :background_color
96
-
97
- # Gets or sets the signature background brush. Value by default is null. When property has a value it is used instead BackgroundBrush property. It is not used for Watermark implementation.
98
- attr_accessor :background_brush
99
-
100
- # Gets or sets the signature border style.
101
- attr_accessor :border_dash_style
102
-
103
- # Gets or sets the signature border transparency (value from 0.0 (opaque) through 1.0 (clear)).
104
- attr_accessor :border_transparency
105
-
106
- # Gets or sets the weight of the signature border.
107
- attr_accessor :border_weight
108
-
109
- # Gets or sets the signature background transparency (value from 0.0 (opaque) through 1.0 (clear)).
110
- attr_accessor :background_transparency
111
-
112
- # Gets or sets the type of text signature implementation.
113
- attr_accessor :signature_implementation
114
-
115
- # Gets or sets the signature opacity (value from 0.0 (clear) through 1.0 (opaque)). By default the value is 1.0.
116
- attr_accessor :opacity
117
-
118
- # Horizontal alignment of text inside a signature.
119
- attr_accessor :text_horizontal_alignment
120
-
121
- # Vertical alignment of text inside a signature.
122
- attr_accessor :text_vertical_alignment
123
- class EnumAttributeValidator
124
- attr_reader :datatype
125
- attr_reader :allowable_values
126
-
127
- def initialize(datatype, allowable_values)
128
- @allowable_values = allowable_values.map do |value|
129
- case datatype.to_s
130
- when /Integer/i
131
- value.to_i
132
- when /Float/i
133
- value.to_f
134
- else
135
- value
136
- end
137
- end
138
- end
139
-
140
- def valid?(value)
141
- !value || allowable_values.include?(value)
142
- end
143
- end
144
-
145
- # Attribute mapping from ruby-style variable name to JSON key.
146
- def self.attribute_map
147
- {
148
- :'document_page_number' => :'DocumentPageNumber',
149
- :'pages_setup' => :'PagesSetup',
150
- :'options_type' => :'OptionsType',
151
- :'left' => :'Left',
152
- :'top' => :'Top',
153
- :'width' => :'Width',
154
- :'height' => :'Height',
155
- :'location_measure_type' => :'LocationMeasureType',
156
- :'size_measure_type' => :'SizeMeasureType',
157
- :'stretch' => :'Stretch',
158
- :'rotation_angle' => :'RotationAngle',
159
- :'horizontal_alignment' => :'HorizontalAlignment',
160
- :'vertical_alignment' => :'VerticalAlignment',
161
- :'margin' => :'Margin',
162
- :'margin_measure_type' => :'MarginMeasureType',
163
- :'text' => :'Text',
164
- :'sign_all_pages' => :'SignAllPages',
165
- :'font' => :'Font',
166
- :'fore_color' => :'ForeColor',
167
- :'border_color' => :'BorderColor',
168
- :'background_color' => :'BackgroundColor',
169
- :'background_brush' => :'BackgroundBrush',
170
- :'border_dash_style' => :'BorderDashStyle',
171
- :'border_transparency' => :'BorderTransparency',
172
- :'border_weight' => :'BorderWeight',
173
- :'background_transparency' => :'BackgroundTransparency',
174
- :'signature_implementation' => :'SignatureImplementation',
175
- :'opacity' => :'Opacity',
176
- :'text_horizontal_alignment' => :'TextHorizontalAlignment',
177
- :'text_vertical_alignment' => :'TextVerticalAlignment'
178
- }
179
- end
180
-
181
- # Attribute type mapping.
182
- def self.swagger_types
183
- {
184
- :'document_page_number' => :'Integer',
185
- :'pages_setup' => :'PagesSetupData',
186
- :'options_type' => :'String',
187
- :'left' => :'Integer',
188
- :'top' => :'Integer',
189
- :'width' => :'Integer',
190
- :'height' => :'Integer',
191
- :'location_measure_type' => :'String',
192
- :'size_measure_type' => :'String',
193
- :'stretch' => :'String',
194
- :'rotation_angle' => :'Integer',
195
- :'horizontal_alignment' => :'String',
196
- :'vertical_alignment' => :'String',
197
- :'margin' => :'PaddingData',
198
- :'margin_measure_type' => :'String',
199
- :'text' => :'String',
200
- :'sign_all_pages' => :'BOOLEAN',
201
- :'font' => :'SignatureFontData',
202
- :'fore_color' => :'Color',
203
- :'border_color' => :'Color',
204
- :'background_color' => :'Color',
205
- :'background_brush' => :'BrushData',
206
- :'border_dash_style' => :'String',
207
- :'border_transparency' => :'Float',
208
- :'border_weight' => :'Float',
209
- :'background_transparency' => :'Float',
210
- :'signature_implementation' => :'String',
211
- :'opacity' => :'Float',
212
- :'text_horizontal_alignment' => :'String',
213
- :'text_vertical_alignment' => :'String'
214
- }
215
- end
216
-
217
- # Initializes the object
218
- # @param [Hash] attributes Model attributes in the form of hash
219
- def initialize(attributes = {})
220
- return unless attributes.is_a?(Hash)
221
-
222
- # convert string to symbol for hash key
223
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
224
-
225
- if attributes.key?(:'DocumentPageNumber')
226
- self.document_page_number = attributes[:'DocumentPageNumber']
227
- end
228
-
229
- if attributes.key?(:'PagesSetup')
230
- self.pages_setup = attributes[:'PagesSetup']
231
- end
232
-
233
- if attributes.key?(:'OptionsType')
234
- self.options_type = attributes[:'OptionsType']
235
- end
236
-
237
- if attributes.key?(:'Left')
238
- self.left = attributes[:'Left']
239
- end
240
-
241
- if attributes.key?(:'Top')
242
- self.top = attributes[:'Top']
243
- end
244
-
245
- if attributes.key?(:'Width')
246
- self.width = attributes[:'Width']
247
- end
248
-
249
- if attributes.key?(:'Height')
250
- self.height = attributes[:'Height']
251
- end
252
-
253
- if attributes.key?(:'LocationMeasureType')
254
- self.location_measure_type = attributes[:'LocationMeasureType']
255
- end
256
-
257
- if attributes.key?(:'SizeMeasureType')
258
- self.size_measure_type = attributes[:'SizeMeasureType']
259
- end
260
-
261
- if attributes.key?(:'Stretch')
262
- self.stretch = attributes[:'Stretch']
263
- end
264
-
265
- if attributes.key?(:'RotationAngle')
266
- self.rotation_angle = attributes[:'RotationAngle']
267
- end
268
-
269
- if attributes.key?(:'HorizontalAlignment')
270
- self.horizontal_alignment = attributes[:'HorizontalAlignment']
271
- end
272
-
273
- if attributes.key?(:'VerticalAlignment')
274
- self.vertical_alignment = attributes[:'VerticalAlignment']
275
- end
276
-
277
- if attributes.key?(:'Margin')
278
- self.margin = attributes[:'Margin']
279
- end
280
-
281
- if attributes.key?(:'MarginMeasureType')
282
- self.margin_measure_type = attributes[:'MarginMeasureType']
283
- end
284
-
285
- if attributes.key?(:'Text')
286
- self.text = attributes[:'Text']
287
- end
288
-
289
- if attributes.key?(:'SignAllPages')
290
- self.sign_all_pages = attributes[:'SignAllPages']
291
- end
292
-
293
- if attributes.key?(:'Font')
294
- self.font = attributes[:'Font']
295
- end
296
-
297
- if attributes.key?(:'ForeColor')
298
- self.fore_color = attributes[:'ForeColor']
299
- end
300
-
301
- if attributes.key?(:'BorderColor')
302
- self.border_color = attributes[:'BorderColor']
303
- end
304
-
305
- if attributes.key?(:'BackgroundColor')
306
- self.background_color = attributes[:'BackgroundColor']
307
- end
308
-
309
- if attributes.key?(:'BackgroundBrush')
310
- self.background_brush = attributes[:'BackgroundBrush']
311
- end
312
-
313
- if attributes.key?(:'BorderDashStyle')
314
- self.border_dash_style = attributes[:'BorderDashStyle']
315
- end
316
-
317
- if attributes.key?(:'BorderTransparency')
318
- self.border_transparency = attributes[:'BorderTransparency']
319
- end
320
-
321
- if attributes.key?(:'BorderWeight')
322
- self.border_weight = attributes[:'BorderWeight']
323
- end
324
-
325
- if attributes.key?(:'BackgroundTransparency')
326
- self.background_transparency = attributes[:'BackgroundTransparency']
327
- end
328
-
329
- if attributes.key?(:'SignatureImplementation')
330
- self.signature_implementation = attributes[:'SignatureImplementation']
331
- end
332
-
333
- if attributes.key?(:'Opacity')
334
- self.opacity = attributes[:'Opacity']
335
- end
336
-
337
- if attributes.key?(:'TextHorizontalAlignment')
338
- self.text_horizontal_alignment = attributes[:'TextHorizontalAlignment']
339
- end
340
-
341
- if attributes.key?(:'TextVerticalAlignment')
342
- self.text_vertical_alignment = attributes[:'TextVerticalAlignment']
343
- end
344
-
345
-
346
- if !((defined? options_type) == nil)
347
- self.options_type = "ImagesSignTextOptionsData"
348
- end
349
-
350
- end
351
-
352
- # Show invalid properties with the reasons. Usually used together with valid?
353
- # @return Array for valid properies with the reasons
354
- def list_invalid_properties
355
- invalid_properties = []
356
- if @document_page_number.nil?
357
- invalid_properties.push("invalid value for 'document_page_number', document_page_number cannot be nil.")
358
- end
359
-
360
- return invalid_properties
361
- end
362
-
363
- # Check to see if the all the properties in the model are valid
364
- # @return true if the model is valid
365
- def valid?
366
- return false if @document_page_number.nil?
367
- location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
368
- return false unless location_measure_type_validator.valid?(@location_measure_type)
369
- size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
370
- return false unless size_measure_type_validator.valid?(@size_measure_type)
371
- stretch_validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
372
- return false unless stretch_validator.valid?(@stretch)
373
- horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
374
- return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
375
- vertical_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
376
- return false unless vertical_alignment_validator.valid?(@vertical_alignment)
377
- margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
378
- return false unless margin_measure_type_validator.valid?(@margin_measure_type)
379
- border_dash_style_validator = EnumAttributeValidator.new('String', ["Default", "Solid", "ShortDash", "ShortDot", "ShortDashDot", "ShortDashDotDot", "Dot", "Dash", "LongDash", "DashDot", "LongDashDot", "LongDashDotDot"])
380
- return false unless border_dash_style_validator.valid?(@border_dash_style)
381
- signature_implementation_validator = EnumAttributeValidator.new('String', ["TextAsImage", "Watermark"])
382
- return false unless signature_implementation_validator.valid?(@signature_implementation)
383
- text_horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
384
- return false unless text_horizontal_alignment_validator.valid?(@text_horizontal_alignment)
385
- text_vertical_alignment_validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
386
- return false unless text_vertical_alignment_validator.valid?(@text_vertical_alignment)
387
- return true
388
- end
389
-
390
- # Custom attribute writer method checking allowed values (enum).
391
- # @param [Object] location_measure_type Object to be assigned
392
- def location_measure_type=(location_measure_type)
393
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
394
- if location_measure_type.to_i == 0
395
- unless validator.valid?(location_measure_type)
396
- raise ArgumentError, "invalid value for 'location_measure_type', must be one of #{validator.allowable_values}."
397
- end
398
- @location_measure_type = location_measure_type
399
- else
400
- @location_measure_type = validator.allowable_values[location_measure_type.to_i]
401
- end
402
- end
403
-
404
- # Custom attribute writer method checking allowed values (enum).
405
- # @param [Object] size_measure_type Object to be assigned
406
- def size_measure_type=(size_measure_type)
407
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
408
- if size_measure_type.to_i == 0
409
- unless validator.valid?(size_measure_type)
410
- raise ArgumentError, "invalid value for 'size_measure_type', must be one of #{validator.allowable_values}."
411
- end
412
- @size_measure_type = size_measure_type
413
- else
414
- @size_measure_type = validator.allowable_values[size_measure_type.to_i]
415
- end
416
- end
417
-
418
- # Custom attribute writer method checking allowed values (enum).
419
- # @param [Object] stretch Object to be assigned
420
- def stretch=(stretch)
421
- validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
422
- if stretch.to_i == 0
423
- unless validator.valid?(stretch)
424
- raise ArgumentError, "invalid value for 'stretch', must be one of #{validator.allowable_values}."
425
- end
426
- @stretch = stretch
427
- else
428
- @stretch = validator.allowable_values[stretch.to_i]
429
- end
430
- end
431
-
432
- # Custom attribute writer method checking allowed values (enum).
433
- # @param [Object] horizontal_alignment Object to be assigned
434
- def horizontal_alignment=(horizontal_alignment)
435
- validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
436
- if horizontal_alignment.to_i == 0
437
- unless validator.valid?(horizontal_alignment)
438
- raise ArgumentError, "invalid value for 'horizontal_alignment', must be one of #{validator.allowable_values}."
439
- end
440
- @horizontal_alignment = horizontal_alignment
441
- else
442
- @horizontal_alignment = validator.allowable_values[horizontal_alignment.to_i]
443
- end
444
- end
445
-
446
- # Custom attribute writer method checking allowed values (enum).
447
- # @param [Object] vertical_alignment Object to be assigned
448
- def vertical_alignment=(vertical_alignment)
449
- validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
450
- if vertical_alignment.to_i == 0
451
- unless validator.valid?(vertical_alignment)
452
- raise ArgumentError, "invalid value for 'vertical_alignment', must be one of #{validator.allowable_values}."
453
- end
454
- @vertical_alignment = vertical_alignment
455
- else
456
- @vertical_alignment = validator.allowable_values[vertical_alignment.to_i]
457
- end
458
- end
459
-
460
- # Custom attribute writer method checking allowed values (enum).
461
- # @param [Object] margin_measure_type Object to be assigned
462
- def margin_measure_type=(margin_measure_type)
463
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
464
- if margin_measure_type.to_i == 0
465
- unless validator.valid?(margin_measure_type)
466
- raise ArgumentError, "invalid value for 'margin_measure_type', must be one of #{validator.allowable_values}."
467
- end
468
- @margin_measure_type = margin_measure_type
469
- else
470
- @margin_measure_type = validator.allowable_values[margin_measure_type.to_i]
471
- end
472
- end
473
-
474
- # Custom attribute writer method checking allowed values (enum).
475
- # @param [Object] border_dash_style Object to be assigned
476
- def border_dash_style=(border_dash_style)
477
- validator = EnumAttributeValidator.new('String', ["Default", "Solid", "ShortDash", "ShortDot", "ShortDashDot", "ShortDashDotDot", "Dot", "Dash", "LongDash", "DashDot", "LongDashDot", "LongDashDotDot"])
478
- if border_dash_style.to_i == 0
479
- unless validator.valid?(border_dash_style)
480
- raise ArgumentError, "invalid value for 'border_dash_style', must be one of #{validator.allowable_values}."
481
- end
482
- @border_dash_style = border_dash_style
483
- else
484
- @border_dash_style = validator.allowable_values[border_dash_style.to_i]
485
- end
486
- end
487
-
488
- # Custom attribute writer method checking allowed values (enum).
489
- # @param [Object] signature_implementation Object to be assigned
490
- def signature_implementation=(signature_implementation)
491
- validator = EnumAttributeValidator.new('String', ["TextAsImage", "Watermark"])
492
- if signature_implementation.to_i == 0
493
- unless validator.valid?(signature_implementation)
494
- raise ArgumentError, "invalid value for 'signature_implementation', must be one of #{validator.allowable_values}."
495
- end
496
- @signature_implementation = signature_implementation
497
- else
498
- @signature_implementation = validator.allowable_values[signature_implementation.to_i]
499
- end
500
- end
501
-
502
- # Custom attribute writer method checking allowed values (enum).
503
- # @param [Object] text_horizontal_alignment Object to be assigned
504
- def text_horizontal_alignment=(text_horizontal_alignment)
505
- validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
506
- if text_horizontal_alignment.to_i == 0
507
- unless validator.valid?(text_horizontal_alignment)
508
- raise ArgumentError, "invalid value for 'text_horizontal_alignment', must be one of #{validator.allowable_values}."
509
- end
510
- @text_horizontal_alignment = text_horizontal_alignment
511
- else
512
- @text_horizontal_alignment = validator.allowable_values[text_horizontal_alignment.to_i]
513
- end
514
- end
515
-
516
- # Custom attribute writer method checking allowed values (enum).
517
- # @param [Object] text_vertical_alignment Object to be assigned
518
- def text_vertical_alignment=(text_vertical_alignment)
519
- validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
520
- if text_vertical_alignment.to_i == 0
521
- unless validator.valid?(text_vertical_alignment)
522
- raise ArgumentError, "invalid value for 'text_vertical_alignment', must be one of #{validator.allowable_values}."
523
- end
524
- @text_vertical_alignment = text_vertical_alignment
525
- else
526
- @text_vertical_alignment = validator.allowable_values[text_vertical_alignment.to_i]
527
- end
528
- end
529
-
530
- # Checks equality by comparing each attribute.
531
- # @param [Object] Object to be compared
532
- def ==(other)
533
- return true if self.equal?(other)
534
- self.class == other.class &&
535
- document_page_number == other.document_page_number &&
536
- pages_setup == other.pages_setup &&
537
- options_type == other.options_type &&
538
- left == other.left &&
539
- top == other.top &&
540
- width == other.width &&
541
- height == other.height &&
542
- location_measure_type == other.location_measure_type &&
543
- size_measure_type == other.size_measure_type &&
544
- stretch == other.stretch &&
545
- rotation_angle == other.rotation_angle &&
546
- horizontal_alignment == other.horizontal_alignment &&
547
- vertical_alignment == other.vertical_alignment &&
548
- margin == other.margin &&
549
- margin_measure_type == other.margin_measure_type &&
550
- text == other.text &&
551
- sign_all_pages == other.sign_all_pages &&
552
- font == other.font &&
553
- fore_color == other.fore_color &&
554
- border_color == other.border_color &&
555
- background_color == other.background_color &&
556
- background_brush == other.background_brush &&
557
- border_dash_style == other.border_dash_style &&
558
- border_transparency == other.border_transparency &&
559
- border_weight == other.border_weight &&
560
- background_transparency == other.background_transparency &&
561
- signature_implementation == other.signature_implementation &&
562
- opacity == other.opacity &&
563
- text_horizontal_alignment == other.text_horizontal_alignment &&
564
- text_vertical_alignment == other.text_vertical_alignment
565
- end
566
-
567
- # @see the `==` method
568
- # @param [Object] Object to be compared
569
- def eql?(other)
570
- self == other
571
- end
572
-
573
- # Calculates hash code according to all attributes.
574
- # @return [Fixnum] Hash code
575
- def hash
576
- [document_page_number, pages_setup, options_type, left, top, width, height, location_measure_type, size_measure_type, stretch, rotation_angle, horizontal_alignment, vertical_alignment, margin, margin_measure_type, text, sign_all_pages, font, fore_color, border_color, background_color, background_brush, border_dash_style, border_transparency, border_weight, background_transparency, signature_implementation, opacity, text_horizontal_alignment, text_vertical_alignment].hash
577
- end
578
-
579
- # Builds the object from hash
580
- # @param [Hash] attributes Model attributes in the form of hash
581
- # @return [Object] Returns the model itself
582
- def build_from_hash(attributes)
583
- return nil unless attributes.is_a?(Hash)
584
- self.class.swagger_types.each_pair do |key, type|
585
-
586
- attributeName = self.class.attribute_map[key]
587
- attributeNameLowerStr = attributeName.to_s
588
- attributeNameLowerStr[0] = attributeNameLowerStr[0].downcase
589
- attributeNameLower = attributeNameLowerStr.to_sym
590
- attributeNameLowerStr2 = attributeName.to_s
591
- attributeNameLowerStr2[0] = attributeNameLowerStr[0].downcase
592
- attributeNameLowerStr2[1] = attributeNameLowerStr[1].downcase
593
- attributeNameLower2 = attributeNameLowerStr2.to_sym
594
-
595
- if type =~ /\AArray<(.*)>/i
596
- # check to ensure the input is an array given that the the attribute
597
- # is documented as an array but the input is not
598
- if attributes[attributeName].is_a?(Array)
599
- self.send("#{key}=", attributes[attributeName].map { |v| _deserialize($1, v) })
600
- end
601
- if attributes[attributeNameLower].is_a?(Array)
602
- self.send("#{key}=", attributes[attributeNameLower].map { |v| _deserialize($1, v) })
603
- end
604
- if attributes[attributeNameLower2].is_a?(Array)
605
- self.send("#{key}=", attributes[attributeNameLower2].map { |v| _deserialize($1, v) })
606
- end
607
- elsif !attributes[attributeName].nil?
608
- self.send("#{key}=", _deserialize(type, attributes[attributeName]))
609
- elsif !attributes[attributeNameLower].nil?
610
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower]))
611
- elsif !attributes[attributeNameLower2].nil?
612
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower2]))
613
- end
614
- # or else data not found in attributes(hash), not an issue as the data can be optional
615
- end
616
- self
617
- end
618
-
619
- # Deserializes the data based on type
620
- # @param string type Data type
621
- # @param string value Value to be deserialized
622
- # @return [Object] Deserialized data
623
- def _deserialize(type, value)
624
- case type.to_sym
625
- when :DateTime
626
- Time.at(/\d/.match(value)[0].to_f).to_datetime
627
- when :Date
628
- Time.at(/\d/.match(value)[0].to_f).to_date
629
- when :String
630
- value.to_s
631
- when :Integer
632
- value.to_i
633
- when :Float
634
- value.to_f
635
- when :BOOLEAN
636
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
637
- true
638
- else
639
- false
640
- end
641
- when :Object
642
- # generic object (usually a Hash), return directly
643
- value
644
- when /\AArray<(?<inner_type>.+)>\z/
645
- inner_type = Regexp.last_match[:inner_type]
646
- value.map { |v| _deserialize(inner_type, v) }
647
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
648
- k_type = Regexp.last_match[:k_type]
649
- v_type = Regexp.last_match[:v_type]
650
- {}.tap do |hash|
651
- value.each do |k, v|
652
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
653
- end
654
- end
655
- else
656
- # model
657
- temp_model = GroupDocsSignatureCloud.const_get(type).new
658
- temp_model.build_from_hash(value)
659
- end
660
- end
661
-
662
- # Returns the string representation of the object
663
- # @return [String] String presentation of the object
664
- def to_s
665
- to_hash.to_s
666
- end
667
-
668
- # to_body is an alias to to_hash (backward compatibility)
669
- # @return [Hash] Returns the object in the form of hash
670
- def to_body
671
- to_hash
672
- end
673
-
674
- # Returns the object in the form of hash
675
- # @return [Hash] Returns the object in the form of hash
676
- def to_hash
677
- hash = {}
678
- self.class.attribute_map.each_pair do |attr, param|
679
- value = self.send(attr)
680
- next if value.nil?
681
- hash[param] = _to_hash(value)
682
- end
683
- hash
684
- end
685
-
686
- # Outputs non-array value in the form of hash
687
- # For object, use to_hash. Otherwise, just return the value
688
- # @param [Object] value Any valid value
689
- # @return [Hash] Returns the value in the form of hash
690
- def _to_hash(value)
691
- if value.is_a?(Array)
692
- value.compact.map { |v| _to_hash(v) }
693
- elsif value.is_a?(Hash)
694
- {}.tap do |hash|
695
- value.each { |k, v| hash[k] = _to_hash(v) }
696
- end
697
- elsif value.respond_to? :to_hash
698
- value.to_hash
699
- else
700
- value
701
- end
702
- end
703
-
704
- end
705
-
706
- end
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="sign_barcode_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 Barcode signature options
32
+ class SignBarcodeOptions
33
+
34
+ # Specifies the type of document to process
35
+ attr_accessor :document_type
36
+
37
+ # Specifies the signature type of processing
38
+ attr_accessor :signature_type
39
+
40
+ # Gets or sets a document page number for processing. Value is optional
41
+ attr_accessor :page
42
+
43
+ # Process all document pages. Type of processing depends on SignatureType For Images Document Type it can be used only for multi-frames images like .tiff
44
+ attr_accessor :all_pages
45
+
46
+ # Options to specify pages for processing
47
+ attr_accessor :pages_setup
48
+
49
+ # Left X position of Signature on Document Page in Measure values (pixels or percent see MeasureType LocationMeasureType property)
50
+ attr_accessor :left
51
+
52
+ # Top Y Position of Signature on Document Page in Measure values (pixels or percent see MeasureType LocationMeasureType property)
53
+ attr_accessor :top
54
+
55
+ # Width of Signature area on Document Page in Measure values (pixels or percent see MeasureType SizeMeasureType property)
56
+ attr_accessor :width
57
+
58
+ # Height of Signature are on Document Page in Measure values (pixels or percent see MeasureType SizeMeasureType property)
59
+ attr_accessor :height
60
+
61
+ # Measure type (pixels or percent) for Left and Top properties
62
+ attr_accessor :location_measure_type
63
+
64
+ # Measure type (pixels or percent) for Width and Height properties
65
+ attr_accessor :size_measure_type
66
+
67
+ # Stretch mode on document page
68
+ attr_accessor :stretch
69
+
70
+ # Rotation angle of signature on document page (clockwise)
71
+ attr_accessor :rotation_angle
72
+
73
+ # Horizontal alignment of signature on document page
74
+ attr_accessor :horizontal_alignment
75
+
76
+ # Vertical alignment of signature on document page
77
+ attr_accessor :vertical_alignment
78
+
79
+ # Gets or sets the space between Sign and Document edges (works ONLY if horizontal or vertical alignment are specified)
80
+ attr_accessor :margin
81
+
82
+ # Gets or sets the measure type (pixels or percent) for Margin
83
+ attr_accessor :margin_measure_type
84
+
85
+ # Text of signature
86
+ attr_accessor :text
87
+
88
+ # Gets or sets the font of signature
89
+ attr_accessor :font
90
+
91
+ # Gets or sets the fore color of signature
92
+ attr_accessor :fore_color
93
+
94
+ # Gets or sets the border color of signature
95
+ attr_accessor :border_color
96
+
97
+ # Gets or sets the background color of signature
98
+ attr_accessor :background_color
99
+
100
+ # Gets or sets the signature background brush. Value by default is null. If this property has a value it will be used instead BackgroundBrush property. For Spreadsheet documents TextStamp implementation RadialGradientBrush is not applicable, it is replaced by LinearGradientBrush. Spreadsheets, Images, Presentations It is not used for Watermark implementation. PDF For Stamp implementation LinearGradientBrush (ColorStart) and RadialGradientBrush (ColorInner) are used as SolidBrush. PDF It is not used for Annotation, Sticker, TextToFormField and Watermark implementations. Presentations For TextStamp implementation RadialGradientBrush is not applicable, it is replaced by LinearGradientBrush. Word Processing For TextStamp implementation LinearGradientBrush (ColorStart) and RadialGradientBrush (ColorInner) are used as SolidBrush. Word Processing It is not used for TextToFormField and Watermark implementations
101
+ attr_accessor :background_brush
102
+
103
+ # Gets or sets the signature border visibility It is not suitable for PDF
104
+ attr_accessor :border_visiblity
105
+
106
+ # Gets or sets the signature border style It is not suitable for PDF
107
+ attr_accessor :border_dash_style
108
+
109
+ # Gets or sets the signature border transparency (value from 0.0 (opaque) through 1.0 (clear)) It is not suitable for PDF
110
+ attr_accessor :border_transparency
111
+
112
+ # Horizontal alignment of text inside a signature
113
+ attr_accessor :text_horizontal_alignment
114
+
115
+ # Vertical alignment of text inside a signature
116
+ attr_accessor :text_vertical_alignment
117
+
118
+ # Get or set Barcode type. Pick one from supported barcode types list
119
+ attr_accessor :barcode_type
120
+
121
+ # Gets or sets the weight of the signature border
122
+ attr_accessor :border_weight
123
+
124
+ # Gets or sets the signature opacity (value from 0.0 (clear) through 1.0 (opaque)). By default the value is 1.0
125
+ attr_accessor :opacity
126
+
127
+ # Gets or sets the alignment of text in the result Barcode Default value is None
128
+ attr_accessor :code_text_alignment
129
+
130
+ # Gets or sets the space between Barcode elements and result image borders
131
+ attr_accessor :inner_margins
132
+ class EnumAttributeValidator
133
+ attr_reader :datatype
134
+ attr_reader :allowable_values
135
+
136
+ def initialize(datatype, allowable_values)
137
+ @allowable_values = allowable_values.map do |value|
138
+ case datatype.to_s
139
+ when /Integer/i
140
+ value.to_i
141
+ when /Float/i
142
+ value.to_f
143
+ else
144
+ value
145
+ end
146
+ end
147
+ end
148
+
149
+ def valid?(value)
150
+ !value || allowable_values.include?(value)
151
+ end
152
+ end
153
+
154
+ # Attribute mapping from ruby-style variable name to JSON key.
155
+ def self.attribute_map
156
+ {
157
+ :'document_type' => :'DocumentType',
158
+ :'signature_type' => :'SignatureType',
159
+ :'page' => :'Page',
160
+ :'all_pages' => :'AllPages',
161
+ :'pages_setup' => :'PagesSetup',
162
+ :'left' => :'Left',
163
+ :'top' => :'Top',
164
+ :'width' => :'Width',
165
+ :'height' => :'Height',
166
+ :'location_measure_type' => :'LocationMeasureType',
167
+ :'size_measure_type' => :'SizeMeasureType',
168
+ :'stretch' => :'Stretch',
169
+ :'rotation_angle' => :'RotationAngle',
170
+ :'horizontal_alignment' => :'HorizontalAlignment',
171
+ :'vertical_alignment' => :'VerticalAlignment',
172
+ :'margin' => :'Margin',
173
+ :'margin_measure_type' => :'MarginMeasureType',
174
+ :'text' => :'Text',
175
+ :'font' => :'Font',
176
+ :'fore_color' => :'ForeColor',
177
+ :'border_color' => :'BorderColor',
178
+ :'background_color' => :'BackgroundColor',
179
+ :'background_brush' => :'BackgroundBrush',
180
+ :'border_visiblity' => :'BorderVisiblity',
181
+ :'border_dash_style' => :'BorderDashStyle',
182
+ :'border_transparency' => :'BorderTransparency',
183
+ :'text_horizontal_alignment' => :'TextHorizontalAlignment',
184
+ :'text_vertical_alignment' => :'TextVerticalAlignment',
185
+ :'barcode_type' => :'BarcodeType',
186
+ :'border_weight' => :'BorderWeight',
187
+ :'opacity' => :'Opacity',
188
+ :'code_text_alignment' => :'CodeTextAlignment',
189
+ :'inner_margins' => :'InnerMargins'
190
+ }
191
+ end
192
+
193
+ # Attribute type mapping.
194
+ def self.swagger_types
195
+ {
196
+ :'document_type' => :'String',
197
+ :'signature_type' => :'String',
198
+ :'page' => :'Integer',
199
+ :'all_pages' => :'BOOLEAN',
200
+ :'pages_setup' => :'PagesSetup',
201
+ :'left' => :'Integer',
202
+ :'top' => :'Integer',
203
+ :'width' => :'Integer',
204
+ :'height' => :'Integer',
205
+ :'location_measure_type' => :'String',
206
+ :'size_measure_type' => :'String',
207
+ :'stretch' => :'String',
208
+ :'rotation_angle' => :'Integer',
209
+ :'horizontal_alignment' => :'String',
210
+ :'vertical_alignment' => :'String',
211
+ :'margin' => :'Padding',
212
+ :'margin_measure_type' => :'String',
213
+ :'text' => :'String',
214
+ :'font' => :'SignatureFont',
215
+ :'fore_color' => :'Color',
216
+ :'border_color' => :'Color',
217
+ :'background_color' => :'Color',
218
+ :'background_brush' => :'Brush',
219
+ :'border_visiblity' => :'BOOLEAN',
220
+ :'border_dash_style' => :'String',
221
+ :'border_transparency' => :'Float',
222
+ :'text_horizontal_alignment' => :'String',
223
+ :'text_vertical_alignment' => :'String',
224
+ :'barcode_type' => :'String',
225
+ :'border_weight' => :'Float',
226
+ :'opacity' => :'Float',
227
+ :'code_text_alignment' => :'String',
228
+ :'inner_margins' => :'Padding'
229
+ }
230
+ end
231
+
232
+ # Initializes the object
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ def initialize(attributes = {})
235
+ return unless attributes.is_a?(Hash)
236
+
237
+ # convert string to symbol for hash key
238
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
239
+
240
+ if attributes.key?(:'DocumentType')
241
+ self.document_type = attributes[:'DocumentType']
242
+ end
243
+
244
+ if attributes.key?(:'SignatureType')
245
+ self.signature_type = attributes[:'SignatureType']
246
+ end
247
+
248
+ if attributes.key?(:'Page')
249
+ self.page = attributes[:'Page']
250
+ end
251
+
252
+ if attributes.key?(:'AllPages')
253
+ self.all_pages = attributes[:'AllPages']
254
+ end
255
+
256
+ if attributes.key?(:'PagesSetup')
257
+ self.pages_setup = attributes[:'PagesSetup']
258
+ end
259
+
260
+ if attributes.key?(:'Left')
261
+ self.left = attributes[:'Left']
262
+ end
263
+
264
+ if attributes.key?(:'Top')
265
+ self.top = attributes[:'Top']
266
+ end
267
+
268
+ if attributes.key?(:'Width')
269
+ self.width = attributes[:'Width']
270
+ end
271
+
272
+ if attributes.key?(:'Height')
273
+ self.height = attributes[:'Height']
274
+ end
275
+
276
+ if attributes.key?(:'LocationMeasureType')
277
+ self.location_measure_type = attributes[:'LocationMeasureType']
278
+ end
279
+
280
+ if attributes.key?(:'SizeMeasureType')
281
+ self.size_measure_type = attributes[:'SizeMeasureType']
282
+ end
283
+
284
+ if attributes.key?(:'Stretch')
285
+ self.stretch = attributes[:'Stretch']
286
+ end
287
+
288
+ if attributes.key?(:'RotationAngle')
289
+ self.rotation_angle = attributes[:'RotationAngle']
290
+ end
291
+
292
+ if attributes.key?(:'HorizontalAlignment')
293
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
294
+ end
295
+
296
+ if attributes.key?(:'VerticalAlignment')
297
+ self.vertical_alignment = attributes[:'VerticalAlignment']
298
+ end
299
+
300
+ if attributes.key?(:'Margin')
301
+ self.margin = attributes[:'Margin']
302
+ end
303
+
304
+ if attributes.key?(:'MarginMeasureType')
305
+ self.margin_measure_type = attributes[:'MarginMeasureType']
306
+ end
307
+
308
+ if attributes.key?(:'Text')
309
+ self.text = attributes[:'Text']
310
+ end
311
+
312
+ if attributes.key?(:'Font')
313
+ self.font = attributes[:'Font']
314
+ end
315
+
316
+ if attributes.key?(:'ForeColor')
317
+ self.fore_color = attributes[:'ForeColor']
318
+ end
319
+
320
+ if attributes.key?(:'BorderColor')
321
+ self.border_color = attributes[:'BorderColor']
322
+ end
323
+
324
+ if attributes.key?(:'BackgroundColor')
325
+ self.background_color = attributes[:'BackgroundColor']
326
+ end
327
+
328
+ if attributes.key?(:'BackgroundBrush')
329
+ self.background_brush = attributes[:'BackgroundBrush']
330
+ end
331
+
332
+ if attributes.key?(:'BorderVisiblity')
333
+ self.border_visiblity = attributes[:'BorderVisiblity']
334
+ end
335
+
336
+ if attributes.key?(:'BorderDashStyle')
337
+ self.border_dash_style = attributes[:'BorderDashStyle']
338
+ end
339
+
340
+ if attributes.key?(:'BorderTransparency')
341
+ self.border_transparency = attributes[:'BorderTransparency']
342
+ end
343
+
344
+ if attributes.key?(:'TextHorizontalAlignment')
345
+ self.text_horizontal_alignment = attributes[:'TextHorizontalAlignment']
346
+ end
347
+
348
+ if attributes.key?(:'TextVerticalAlignment')
349
+ self.text_vertical_alignment = attributes[:'TextVerticalAlignment']
350
+ end
351
+
352
+ if attributes.key?(:'BarcodeType')
353
+ self.barcode_type = attributes[:'BarcodeType']
354
+ end
355
+
356
+ if attributes.key?(:'BorderWeight')
357
+ self.border_weight = attributes[:'BorderWeight']
358
+ end
359
+
360
+ if attributes.key?(:'Opacity')
361
+ self.opacity = attributes[:'Opacity']
362
+ end
363
+
364
+ if attributes.key?(:'CodeTextAlignment')
365
+ self.code_text_alignment = attributes[:'CodeTextAlignment']
366
+ end
367
+
368
+ if attributes.key?(:'InnerMargins')
369
+ self.inner_margins = attributes[:'InnerMargins']
370
+ end
371
+
372
+ end
373
+
374
+ # Show invalid properties with the reasons. Usually used together with valid?
375
+ # @return Array for valid properies with the reasons
376
+ def list_invalid_properties
377
+ invalid_properties = []
378
+ if @document_type.nil?
379
+ invalid_properties.push("invalid value for 'document_type', document_type cannot be nil.")
380
+ end
381
+
382
+ if @signature_type.nil?
383
+ invalid_properties.push("invalid value for 'signature_type', signature_type cannot be nil.")
384
+ end
385
+
386
+ if @all_pages.nil?
387
+ invalid_properties.push("invalid value for 'all_pages', all_pages cannot be nil.")
388
+ end
389
+
390
+ if @left.nil?
391
+ invalid_properties.push("invalid value for 'left', left cannot be nil.")
392
+ end
393
+
394
+ if @top.nil?
395
+ invalid_properties.push("invalid value for 'top', top cannot be nil.")
396
+ end
397
+
398
+ if @width.nil?
399
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
400
+ end
401
+
402
+ if @height.nil?
403
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
404
+ end
405
+
406
+ if @location_measure_type.nil?
407
+ invalid_properties.push("invalid value for 'location_measure_type', location_measure_type cannot be nil.")
408
+ end
409
+
410
+ if @size_measure_type.nil?
411
+ invalid_properties.push("invalid value for 'size_measure_type', size_measure_type cannot be nil.")
412
+ end
413
+
414
+ if @stretch.nil?
415
+ invalid_properties.push("invalid value for 'stretch', stretch cannot be nil.")
416
+ end
417
+
418
+ if @rotation_angle.nil?
419
+ invalid_properties.push("invalid value for 'rotation_angle', rotation_angle cannot be nil.")
420
+ end
421
+
422
+ if @horizontal_alignment.nil?
423
+ invalid_properties.push("invalid value for 'horizontal_alignment', horizontal_alignment cannot be nil.")
424
+ end
425
+
426
+ if @vertical_alignment.nil?
427
+ invalid_properties.push("invalid value for 'vertical_alignment', vertical_alignment cannot be nil.")
428
+ end
429
+
430
+ if @margin_measure_type.nil?
431
+ invalid_properties.push("invalid value for 'margin_measure_type', margin_measure_type cannot be nil.")
432
+ end
433
+
434
+ if @border_visiblity.nil?
435
+ invalid_properties.push("invalid value for 'border_visiblity', border_visiblity cannot be nil.")
436
+ end
437
+
438
+ if @border_dash_style.nil?
439
+ invalid_properties.push("invalid value for 'border_dash_style', border_dash_style cannot be nil.")
440
+ end
441
+
442
+ if @border_transparency.nil?
443
+ invalid_properties.push("invalid value for 'border_transparency', border_transparency cannot be nil.")
444
+ end
445
+
446
+ if @text_horizontal_alignment.nil?
447
+ invalid_properties.push("invalid value for 'text_horizontal_alignment', text_horizontal_alignment cannot be nil.")
448
+ end
449
+
450
+ if @text_vertical_alignment.nil?
451
+ invalid_properties.push("invalid value for 'text_vertical_alignment', text_vertical_alignment cannot be nil.")
452
+ end
453
+
454
+ if @border_weight.nil?
455
+ invalid_properties.push("invalid value for 'border_weight', border_weight cannot be nil.")
456
+ end
457
+
458
+ if @code_text_alignment.nil?
459
+ invalid_properties.push("invalid value for 'code_text_alignment', code_text_alignment cannot be nil.")
460
+ end
461
+
462
+ return invalid_properties
463
+ end
464
+
465
+ # Check to see if the all the properties in the model are valid
466
+ # @return true if the model is valid
467
+ def valid?
468
+ return false if @document_type.nil?
469
+ document_type_validator = EnumAttributeValidator.new('String', ["Image", "Pdf", "Presentation", "Spreadsheet", "WordProcessing"])
470
+ return false unless document_type_validator.valid?(@document_type)
471
+ return false if @signature_type.nil?
472
+ signature_type_validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp"])
473
+ return false unless signature_type_validator.valid?(@signature_type)
474
+ return false if @all_pages.nil?
475
+ return false if @left.nil?
476
+ return false if @top.nil?
477
+ return false if @width.nil?
478
+ return false if @height.nil?
479
+ return false if @location_measure_type.nil?
480
+ location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
481
+ return false unless location_measure_type_validator.valid?(@location_measure_type)
482
+ return false if @size_measure_type.nil?
483
+ size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
484
+ return false unless size_measure_type_validator.valid?(@size_measure_type)
485
+ return false if @stretch.nil?
486
+ stretch_validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
487
+ return false unless stretch_validator.valid?(@stretch)
488
+ return false if @rotation_angle.nil?
489
+ return false if @horizontal_alignment.nil?
490
+ horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
491
+ return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
492
+ return false if @vertical_alignment.nil?
493
+ vertical_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
494
+ return false unless vertical_alignment_validator.valid?(@vertical_alignment)
495
+ return false if @margin_measure_type.nil?
496
+ margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
497
+ return false unless margin_measure_type_validator.valid?(@margin_measure_type)
498
+ return false if @border_visiblity.nil?
499
+ return false if @border_dash_style.nil?
500
+ border_dash_style_validator = EnumAttributeValidator.new('String', ["Dash", "DashDot", "DashDotDot", "DashLongDash", "DashLongDashDot", "RoundDot", "Solid", "SquareDot"])
501
+ return false unless border_dash_style_validator.valid?(@border_dash_style)
502
+ return false if @border_transparency.nil?
503
+ return false if @text_horizontal_alignment.nil?
504
+ text_horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
505
+ return false unless text_horizontal_alignment_validator.valid?(@text_horizontal_alignment)
506
+ return false if @text_vertical_alignment.nil?
507
+ text_vertical_alignment_validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
508
+ return false unless text_vertical_alignment_validator.valid?(@text_vertical_alignment)
509
+ return false if @border_weight.nil?
510
+ return false if @code_text_alignment.nil?
511
+ code_text_alignment_validator = EnumAttributeValidator.new('String', ["None", "Above", "Below", "Right"])
512
+ return false unless code_text_alignment_validator.valid?(@code_text_alignment)
513
+ return true
514
+ end
515
+
516
+ # Custom attribute writer method checking allowed values (enum).
517
+ # @param [Object] document_type Object to be assigned
518
+ def document_type=(document_type)
519
+ validator = EnumAttributeValidator.new('String', ["Image", "Pdf", "Presentation", "Spreadsheet", "WordProcessing"])
520
+ if document_type.to_i == 0
521
+ unless validator.valid?(document_type)
522
+ raise ArgumentError, "invalid value for 'document_type', must be one of #{validator.allowable_values}."
523
+ end
524
+ @document_type = document_type
525
+ else
526
+ @document_type = validator.allowable_values[document_type.to_i]
527
+ end
528
+ end
529
+
530
+ # Custom attribute writer method checking allowed values (enum).
531
+ # @param [Object] signature_type Object to be assigned
532
+ def signature_type=(signature_type)
533
+ validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp"])
534
+ if signature_type.to_i == 0
535
+ unless validator.valid?(signature_type)
536
+ raise ArgumentError, "invalid value for 'signature_type', must be one of #{validator.allowable_values}."
537
+ end
538
+ @signature_type = signature_type
539
+ else
540
+ @signature_type = validator.allowable_values[signature_type.to_i]
541
+ end
542
+ end
543
+
544
+ # Custom attribute writer method checking allowed values (enum).
545
+ # @param [Object] location_measure_type Object to be assigned
546
+ def location_measure_type=(location_measure_type)
547
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
548
+ if location_measure_type.to_i == 0
549
+ unless validator.valid?(location_measure_type)
550
+ raise ArgumentError, "invalid value for 'location_measure_type', must be one of #{validator.allowable_values}."
551
+ end
552
+ @location_measure_type = location_measure_type
553
+ else
554
+ @location_measure_type = validator.allowable_values[location_measure_type.to_i]
555
+ end
556
+ end
557
+
558
+ # Custom attribute writer method checking allowed values (enum).
559
+ # @param [Object] size_measure_type Object to be assigned
560
+ def size_measure_type=(size_measure_type)
561
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
562
+ if size_measure_type.to_i == 0
563
+ unless validator.valid?(size_measure_type)
564
+ raise ArgumentError, "invalid value for 'size_measure_type', must be one of #{validator.allowable_values}."
565
+ end
566
+ @size_measure_type = size_measure_type
567
+ else
568
+ @size_measure_type = validator.allowable_values[size_measure_type.to_i]
569
+ end
570
+ end
571
+
572
+ # Custom attribute writer method checking allowed values (enum).
573
+ # @param [Object] stretch Object to be assigned
574
+ def stretch=(stretch)
575
+ validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
576
+ if stretch.to_i == 0
577
+ unless validator.valid?(stretch)
578
+ raise ArgumentError, "invalid value for 'stretch', must be one of #{validator.allowable_values}."
579
+ end
580
+ @stretch = stretch
581
+ else
582
+ @stretch = validator.allowable_values[stretch.to_i]
583
+ end
584
+ end
585
+
586
+ # Custom attribute writer method checking allowed values (enum).
587
+ # @param [Object] horizontal_alignment Object to be assigned
588
+ def horizontal_alignment=(horizontal_alignment)
589
+ validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
590
+ if horizontal_alignment.to_i == 0
591
+ unless validator.valid?(horizontal_alignment)
592
+ raise ArgumentError, "invalid value for 'horizontal_alignment', must be one of #{validator.allowable_values}."
593
+ end
594
+ @horizontal_alignment = horizontal_alignment
595
+ else
596
+ @horizontal_alignment = validator.allowable_values[horizontal_alignment.to_i]
597
+ end
598
+ end
599
+
600
+ # Custom attribute writer method checking allowed values (enum).
601
+ # @param [Object] vertical_alignment Object to be assigned
602
+ def vertical_alignment=(vertical_alignment)
603
+ validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
604
+ if vertical_alignment.to_i == 0
605
+ unless validator.valid?(vertical_alignment)
606
+ raise ArgumentError, "invalid value for 'vertical_alignment', must be one of #{validator.allowable_values}."
607
+ end
608
+ @vertical_alignment = vertical_alignment
609
+ else
610
+ @vertical_alignment = validator.allowable_values[vertical_alignment.to_i]
611
+ end
612
+ end
613
+
614
+ # Custom attribute writer method checking allowed values (enum).
615
+ # @param [Object] margin_measure_type Object to be assigned
616
+ def margin_measure_type=(margin_measure_type)
617
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
618
+ if margin_measure_type.to_i == 0
619
+ unless validator.valid?(margin_measure_type)
620
+ raise ArgumentError, "invalid value for 'margin_measure_type', must be one of #{validator.allowable_values}."
621
+ end
622
+ @margin_measure_type = margin_measure_type
623
+ else
624
+ @margin_measure_type = validator.allowable_values[margin_measure_type.to_i]
625
+ end
626
+ end
627
+
628
+ # Custom attribute writer method checking allowed values (enum).
629
+ # @param [Object] border_dash_style Object to be assigned
630
+ def border_dash_style=(border_dash_style)
631
+ validator = EnumAttributeValidator.new('String', ["Dash", "DashDot", "DashDotDot", "DashLongDash", "DashLongDashDot", "RoundDot", "Solid", "SquareDot"])
632
+ if border_dash_style.to_i == 0
633
+ unless validator.valid?(border_dash_style)
634
+ raise ArgumentError, "invalid value for 'border_dash_style', must be one of #{validator.allowable_values}."
635
+ end
636
+ @border_dash_style = border_dash_style
637
+ else
638
+ @border_dash_style = validator.allowable_values[border_dash_style.to_i]
639
+ end
640
+ end
641
+
642
+ # Custom attribute writer method checking allowed values (enum).
643
+ # @param [Object] text_horizontal_alignment Object to be assigned
644
+ def text_horizontal_alignment=(text_horizontal_alignment)
645
+ validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
646
+ if text_horizontal_alignment.to_i == 0
647
+ unless validator.valid?(text_horizontal_alignment)
648
+ raise ArgumentError, "invalid value for 'text_horizontal_alignment', must be one of #{validator.allowable_values}."
649
+ end
650
+ @text_horizontal_alignment = text_horizontal_alignment
651
+ else
652
+ @text_horizontal_alignment = validator.allowable_values[text_horizontal_alignment.to_i]
653
+ end
654
+ end
655
+
656
+ # Custom attribute writer method checking allowed values (enum).
657
+ # @param [Object] text_vertical_alignment Object to be assigned
658
+ def text_vertical_alignment=(text_vertical_alignment)
659
+ validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
660
+ if text_vertical_alignment.to_i == 0
661
+ unless validator.valid?(text_vertical_alignment)
662
+ raise ArgumentError, "invalid value for 'text_vertical_alignment', must be one of #{validator.allowable_values}."
663
+ end
664
+ @text_vertical_alignment = text_vertical_alignment
665
+ else
666
+ @text_vertical_alignment = validator.allowable_values[text_vertical_alignment.to_i]
667
+ end
668
+ end
669
+
670
+ # Custom attribute writer method checking allowed values (enum).
671
+ # @param [Object] code_text_alignment Object to be assigned
672
+ def code_text_alignment=(code_text_alignment)
673
+ validator = EnumAttributeValidator.new('String', ["None", "Above", "Below", "Right"])
674
+ if code_text_alignment.to_i == 0
675
+ unless validator.valid?(code_text_alignment)
676
+ raise ArgumentError, "invalid value for 'code_text_alignment', must be one of #{validator.allowable_values}."
677
+ end
678
+ @code_text_alignment = code_text_alignment
679
+ else
680
+ @code_text_alignment = validator.allowable_values[code_text_alignment.to_i]
681
+ end
682
+ end
683
+
684
+ # Checks equality by comparing each attribute.
685
+ # @param [Object] Object to be compared
686
+ def ==(other)
687
+ return true if self.equal?(other)
688
+ self.class == other.class &&
689
+ document_type == other.document_type &&
690
+ signature_type == other.signature_type &&
691
+ page == other.page &&
692
+ all_pages == other.all_pages &&
693
+ pages_setup == other.pages_setup &&
694
+ left == other.left &&
695
+ top == other.top &&
696
+ width == other.width &&
697
+ height == other.height &&
698
+ location_measure_type == other.location_measure_type &&
699
+ size_measure_type == other.size_measure_type &&
700
+ stretch == other.stretch &&
701
+ rotation_angle == other.rotation_angle &&
702
+ horizontal_alignment == other.horizontal_alignment &&
703
+ vertical_alignment == other.vertical_alignment &&
704
+ margin == other.margin &&
705
+ margin_measure_type == other.margin_measure_type &&
706
+ text == other.text &&
707
+ font == other.font &&
708
+ fore_color == other.fore_color &&
709
+ border_color == other.border_color &&
710
+ background_color == other.background_color &&
711
+ background_brush == other.background_brush &&
712
+ border_visiblity == other.border_visiblity &&
713
+ border_dash_style == other.border_dash_style &&
714
+ border_transparency == other.border_transparency &&
715
+ text_horizontal_alignment == other.text_horizontal_alignment &&
716
+ text_vertical_alignment == other.text_vertical_alignment &&
717
+ barcode_type == other.barcode_type &&
718
+ border_weight == other.border_weight &&
719
+ opacity == other.opacity &&
720
+ code_text_alignment == other.code_text_alignment &&
721
+ inner_margins == other.inner_margins
722
+ end
723
+
724
+ # @see the `==` method
725
+ # @param [Object] Object to be compared
726
+ def eql?(other)
727
+ self == other
728
+ end
729
+
730
+ # Calculates hash code according to all attributes.
731
+ # @return [Fixnum] Hash code
732
+ def hash
733
+ [document_type, signature_type, page, all_pages, pages_setup, left, top, width, height, location_measure_type, size_measure_type, stretch, rotation_angle, horizontal_alignment, vertical_alignment, margin, margin_measure_type, text, font, fore_color, border_color, background_color, background_brush, border_visiblity, border_dash_style, border_transparency, text_horizontal_alignment, text_vertical_alignment, barcode_type, border_weight, opacity, code_text_alignment, inner_margins].hash
734
+ end
735
+
736
+ # Downcases first letter.
737
+ # @return downcased string
738
+ def uncap(str)
739
+ str[0, 1].downcase + str[1..-1]
740
+ end
741
+
742
+ # Builds the object from hash
743
+ # @param [Hash] attributes Model attributes in the form of hash
744
+ # @return [Object] Returns the model itself
745
+ def build_from_hash(attributes)
746
+ return nil unless attributes.is_a?(Hash)
747
+ self.class.swagger_types.each_pair do |key, type|
748
+ pname = uncap(self.class.attribute_map[key]).intern
749
+ value = attributes[pname]
750
+ if type =~ /\AArray<(.*)>/i
751
+ # check to ensure the input is an array given that the the attribute
752
+ # is documented as an array but the input is not
753
+ if value.is_a?(Array)
754
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
755
+ end
756
+ elsif !value.nil?
757
+ self.send("#{key}=", _deserialize(type, value))
758
+ end
759
+ # or else data not found in attributes(hash), not an issue as the data can be optional
760
+ end
761
+
762
+ self
763
+ end
764
+
765
+ # Deserializes the data based on type
766
+ # @param string type Data type
767
+ # @param string value Value to be deserialized
768
+ # @return [Object] Deserialized data
769
+ def _deserialize(type, value)
770
+ case type.to_sym
771
+ when :DateTime
772
+ Date.parse value
773
+ when :Date
774
+ Date.parse value
775
+ when :String
776
+ value.to_s
777
+ when :Integer
778
+ value.to_i
779
+ when :Float
780
+ value.to_f
781
+ when :BOOLEAN
782
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
783
+ true
784
+ else
785
+ false
786
+ end
787
+ when :Object
788
+ # generic object (usually a Hash), return directly
789
+ value
790
+ when /\AArray<(?<inner_type>.+)>\z/
791
+ inner_type = Regexp.last_match[:inner_type]
792
+ value.map { |v| _deserialize(inner_type, v) }
793
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
794
+ k_type = Regexp.last_match[:k_type]
795
+ v_type = Regexp.last_match[:v_type]
796
+ {}.tap do |hash|
797
+ value.each do |k, v|
798
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
799
+ end
800
+ end
801
+ else
802
+ # model
803
+ # Signature type fix
804
+ ttype = type
805
+ if value.is_a?(Hash) and !value[:signatureType].nil?
806
+ ttype = value[:signatureType] + 'Signature'
807
+ end
808
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
809
+ temp_model.build_from_hash(value)
810
+ end
811
+ end
812
+
813
+ # Returns the string representation of the object
814
+ # @return [String] String presentation of the object
815
+ def to_s
816
+ to_hash.to_s
817
+ end
818
+
819
+ # to_body is an alias to to_hash (backward compatibility)
820
+ # @return [Hash] Returns the object in the form of hash
821
+ def to_body
822
+ to_hash
823
+ end
824
+
825
+ # Returns the object in the form of hash
826
+ # @return [Hash] Returns the object in the form of hash
827
+ def to_hash
828
+ hash = {}
829
+ self.class.attribute_map.each_pair do |attr, param|
830
+ value = self.send(attr)
831
+ next if value.nil?
832
+ hash[param] = _to_hash(value)
833
+ end
834
+ hash
835
+ end
836
+
837
+ # Outputs non-array value in the form of hash
838
+ # For object, use to_hash. Otherwise, just return the value
839
+ # @param [Object] value Any valid value
840
+ # @return [Hash] Returns the value in the form of hash
841
+ def _to_hash(value)
842
+ if value.is_a?(Array)
843
+ value.compact.map { |v| _to_hash(v) }
844
+ elsif value.is_a?(Hash)
845
+ {}.tap do |hash|
846
+ value.each { |k, v| hash[k] = _to_hash(v) }
847
+ end
848
+ elsif value.respond_to? :to_hash
849
+ value.to_hash
850
+ else
851
+ value
852
+ end
853
+ end
854
+
855
+ end
856
+
857
+ end