groupdocs_signature_cloud 18.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. checksums.yaml +7 -0
  2. data/lib/groupdocs_signature_cloud.rb +191 -0
  3. data/lib/groupdocs_signature_cloud/api/signature_api.rb +2590 -0
  4. data/lib/groupdocs_signature_cloud/api_client.rb +380 -0
  5. data/lib/groupdocs_signature_cloud/api_error.rb +58 -0
  6. data/lib/groupdocs_signature_cloud/configuration.rb +110 -0
  7. data/lib/groupdocs_signature_cloud/models/barcode_collection.rb +232 -0
  8. data/lib/groupdocs_signature_cloud/models/barcode_signature_data.rb +250 -0
  9. data/lib/groupdocs_signature_cloud/models/barcode_type.rb +230 -0
  10. data/lib/groupdocs_signature_cloud/models/base_signature_data.rb +230 -0
  11. data/lib/groupdocs_signature_cloud/models/border_line_data.rb +312 -0
  12. data/lib/groupdocs_signature_cloud/models/brush_data.rb +230 -0
  13. data/lib/groupdocs_signature_cloud/models/cells_barcode_signature_data.rb +250 -0
  14. data/lib/groupdocs_signature_cloud/models/cells_digital_signature_data.rb +307 -0
  15. data/lib/groupdocs_signature_cloud/models/cells_qr_code_signature_data.rb +250 -0
  16. data/lib/groupdocs_signature_cloud/models/cells_search_barcode_options_data.rb +332 -0
  17. data/lib/groupdocs_signature_cloud/models/cells_search_digital_options_data.rb +265 -0
  18. data/lib/groupdocs_signature_cloud/models/cells_search_qr_code_options_data.rb +332 -0
  19. data/lib/groupdocs_signature_cloud/models/cells_sign_barcode_options_data.rb +694 -0
  20. data/lib/groupdocs_signature_cloud/models/cells_sign_digital_options_data.rb +546 -0
  21. data/lib/groupdocs_signature_cloud/models/cells_sign_image_options_data.rb +526 -0
  22. data/lib/groupdocs_signature_cloud/models/cells_sign_qr_code_options_data.rb +704 -0
  23. data/lib/groupdocs_signature_cloud/models/cells_sign_stamp_options_data.rb +622 -0
  24. data/lib/groupdocs_signature_cloud/models/cells_sign_text_options_data.rb +736 -0
  25. data/lib/groupdocs_signature_cloud/models/cells_verify_barcode_options_data.rb +342 -0
  26. data/lib/groupdocs_signature_cloud/models/cells_verify_digital_options_data.rb +315 -0
  27. data/lib/groupdocs_signature_cloud/models/cells_verify_qr_code_options_data.rb +342 -0
  28. data/lib/groupdocs_signature_cloud/models/cells_verify_text_options_data.rb +285 -0
  29. data/lib/groupdocs_signature_cloud/models/color.rb +245 -0
  30. data/lib/groupdocs_signature_cloud/models/digital_signature_data.rb +307 -0
  31. data/lib/groupdocs_signature_cloud/models/document_info.rb +300 -0
  32. data/lib/groupdocs_signature_cloud/models/document_response.rb +302 -0
  33. data/lib/groupdocs_signature_cloud/models/format.rb +240 -0
  34. data/lib/groupdocs_signature_cloud/models/format_collection.rb +232 -0
  35. data/lib/groupdocs_signature_cloud/models/images_barcode_signature_data.rb +250 -0
  36. data/lib/groupdocs_signature_cloud/models/images_qr_code_signature_data.rb +250 -0
  37. data/lib/groupdocs_signature_cloud/models/images_search_barcode_options_data.rb +332 -0
  38. data/lib/groupdocs_signature_cloud/models/images_search_qr_code_options_data.rb +332 -0
  39. data/lib/groupdocs_signature_cloud/models/images_sign_barcode_options_data.rb +664 -0
  40. data/lib/groupdocs_signature_cloud/models/images_sign_image_options_data.rb +496 -0
  41. data/lib/groupdocs_signature_cloud/models/images_sign_qr_code_options_data.rb +674 -0
  42. data/lib/groupdocs_signature_cloud/models/images_sign_stamp_options_data.rb +592 -0
  43. data/lib/groupdocs_signature_cloud/models/images_sign_text_options_data.rb +706 -0
  44. data/lib/groupdocs_signature_cloud/models/images_verify_barcode_options_data.rb +342 -0
  45. data/lib/groupdocs_signature_cloud/models/images_verify_qr_code_options_data.rb +342 -0
  46. data/lib/groupdocs_signature_cloud/models/linear_gradient_brush_data.rb +260 -0
  47. data/lib/groupdocs_signature_cloud/models/padding_data.rb +295 -0
  48. data/lib/groupdocs_signature_cloud/models/page_info.rb +305 -0
  49. data/lib/groupdocs_signature_cloud/models/pages_info.rb +247 -0
  50. data/lib/groupdocs_signature_cloud/models/pages_setup_data.rb +292 -0
  51. data/lib/groupdocs_signature_cloud/models/pdf_barcode_signature_data.rb +250 -0
  52. data/lib/groupdocs_signature_cloud/models/pdf_digital_signature_data.rb +307 -0
  53. data/lib/groupdocs_signature_cloud/models/pdf_qr_code_signature_data.rb +250 -0
  54. data/lib/groupdocs_signature_cloud/models/pdf_search_barcode_options_data.rb +332 -0
  55. data/lib/groupdocs_signature_cloud/models/pdf_search_digital_options_data.rb +265 -0
  56. data/lib/groupdocs_signature_cloud/models/pdf_search_qr_code_options_data.rb +332 -0
  57. data/lib/groupdocs_signature_cloud/models/pdf_sign_barcode_options_data.rb +664 -0
  58. data/lib/groupdocs_signature_cloud/models/pdf_sign_digital_options_data.rb +556 -0
  59. data/lib/groupdocs_signature_cloud/models/pdf_sign_image_options_data.rb +496 -0
  60. data/lib/groupdocs_signature_cloud/models/pdf_sign_qr_code_options_data.rb +674 -0
  61. data/lib/groupdocs_signature_cloud/models/pdf_sign_stamp_options_data.rb +592 -0
  62. data/lib/groupdocs_signature_cloud/models/pdf_sign_text_options_data.rb +696 -0
  63. data/lib/groupdocs_signature_cloud/models/pdf_verify_barcode_options_data.rb +342 -0
  64. data/lib/groupdocs_signature_cloud/models/pdf_verify_digital_options_data.rb +315 -0
  65. data/lib/groupdocs_signature_cloud/models/pdf_verify_qr_code_options_data.rb +342 -0
  66. data/lib/groupdocs_signature_cloud/models/pdf_verify_text_options_data.rb +342 -0
  67. data/lib/groupdocs_signature_cloud/models/qr_code_collection.rb +232 -0
  68. data/lib/groupdocs_signature_cloud/models/qr_code_signature_data.rb +250 -0
  69. data/lib/groupdocs_signature_cloud/models/qr_code_type.rb +230 -0
  70. data/lib/groupdocs_signature_cloud/models/radial_gradient_brush_data.rb +250 -0
  71. data/lib/groupdocs_signature_cloud/models/requests/get_document_info_from_url_request.rb +55 -0
  72. data/lib/groupdocs_signature_cloud/models/requests/get_document_info_request.rb +59 -0
  73. data/lib/groupdocs_signature_cloud/models/requests/post_barcode_from_url_request.rb +59 -0
  74. data/lib/groupdocs_signature_cloud/models/requests/post_barcode_request.rb +63 -0
  75. data/lib/groupdocs_signature_cloud/models/requests/post_collection_from_url_request.rb +59 -0
  76. data/lib/groupdocs_signature_cloud/models/requests/post_collection_request.rb +63 -0
  77. data/lib/groupdocs_signature_cloud/models/requests/post_digital_from_url_request.rb +67 -0
  78. data/lib/groupdocs_signature_cloud/models/requests/post_digital_request.rb +71 -0
  79. data/lib/groupdocs_signature_cloud/models/requests/post_image_from_url_request.rb +63 -0
  80. data/lib/groupdocs_signature_cloud/models/requests/post_image_request.rb +67 -0
  81. data/lib/groupdocs_signature_cloud/models/requests/post_qr_code_from_url_request.rb +59 -0
  82. data/lib/groupdocs_signature_cloud/models/requests/post_qr_code_request.rb +63 -0
  83. data/lib/groupdocs_signature_cloud/models/requests/post_search_barcode_from_url_request.rb +59 -0
  84. data/lib/groupdocs_signature_cloud/models/requests/post_search_barcode_request.rb +63 -0
  85. data/lib/groupdocs_signature_cloud/models/requests/post_search_collection_from_url_request.rb +59 -0
  86. data/lib/groupdocs_signature_cloud/models/requests/post_search_collection_request.rb +63 -0
  87. data/lib/groupdocs_signature_cloud/models/requests/post_search_digital_from_url_request.rb +59 -0
  88. data/lib/groupdocs_signature_cloud/models/requests/post_search_digital_request.rb +63 -0
  89. data/lib/groupdocs_signature_cloud/models/requests/post_search_qr_code_from_url_request.rb +59 -0
  90. data/lib/groupdocs_signature_cloud/models/requests/post_search_qr_code_request.rb +63 -0
  91. data/lib/groupdocs_signature_cloud/models/requests/post_stamp_from_url_request.rb +59 -0
  92. data/lib/groupdocs_signature_cloud/models/requests/post_stamp_request.rb +63 -0
  93. data/lib/groupdocs_signature_cloud/models/requests/post_text_from_url_request.rb +59 -0
  94. data/lib/groupdocs_signature_cloud/models/requests/post_text_request.rb +63 -0
  95. data/lib/groupdocs_signature_cloud/models/requests/post_verification_barcode_from_url_request.rb +59 -0
  96. data/lib/groupdocs_signature_cloud/models/requests/post_verification_barcode_request.rb +63 -0
  97. data/lib/groupdocs_signature_cloud/models/requests/post_verification_collection_from_url_request.rb +59 -0
  98. data/lib/groupdocs_signature_cloud/models/requests/post_verification_collection_request.rb +63 -0
  99. data/lib/groupdocs_signature_cloud/models/requests/post_verification_digital_from_url_request.rb +63 -0
  100. data/lib/groupdocs_signature_cloud/models/requests/post_verification_digital_request.rb +67 -0
  101. data/lib/groupdocs_signature_cloud/models/requests/post_verification_qr_code_from_url_request.rb +59 -0
  102. data/lib/groupdocs_signature_cloud/models/requests/post_verification_qr_code_request.rb +63 -0
  103. data/lib/groupdocs_signature_cloud/models/requests/post_verification_text_from_url_request.rb +57 -0
  104. data/lib/groupdocs_signature_cloud/models/requests/post_verification_text_request.rb +63 -0
  105. data/lib/groupdocs_signature_cloud/models/search_barcode_options_data.rb +332 -0
  106. data/lib/groupdocs_signature_cloud/models/search_digital_options_data.rb +265 -0
  107. data/lib/groupdocs_signature_cloud/models/search_document_response.rb +305 -0
  108. data/lib/groupdocs_signature_cloud/models/search_options_collection_data.rb +232 -0
  109. data/lib/groupdocs_signature_cloud/models/search_options_data.rb +265 -0
  110. data/lib/groupdocs_signature_cloud/models/search_qr_code_options_data.rb +332 -0
  111. data/lib/groupdocs_signature_cloud/models/sign_barcode_options_data.rb +664 -0
  112. data/lib/groupdocs_signature_cloud/models/sign_digital_options_data.rb +516 -0
  113. data/lib/groupdocs_signature_cloud/models/sign_image_options_data.rb +496 -0
  114. data/lib/groupdocs_signature_cloud/models/sign_options_collection_data.rb +232 -0
  115. data/lib/groupdocs_signature_cloud/models/sign_options_data.rb +255 -0
  116. data/lib/groupdocs_signature_cloud/models/sign_qr_code_options_data.rb +674 -0
  117. data/lib/groupdocs_signature_cloud/models/sign_stamp_options_data.rb +592 -0
  118. data/lib/groupdocs_signature_cloud/models/sign_text_options_data.rb +562 -0
  119. data/lib/groupdocs_signature_cloud/models/signature_document_response.rb +290 -0
  120. data/lib/groupdocs_signature_cloud/models/signature_font_data.rb +290 -0
  121. data/lib/groupdocs_signature_cloud/models/slides_barcode_signature_data.rb +250 -0
  122. data/lib/groupdocs_signature_cloud/models/slides_qr_code_signature_data.rb +250 -0
  123. data/lib/groupdocs_signature_cloud/models/slides_search_barcode_options_data.rb +332 -0
  124. data/lib/groupdocs_signature_cloud/models/slides_search_qr_code_options_data.rb +332 -0
  125. data/lib/groupdocs_signature_cloud/models/slides_sign_barcode_options_data.rb +664 -0
  126. data/lib/groupdocs_signature_cloud/models/slides_sign_image_options_data.rb +496 -0
  127. data/lib/groupdocs_signature_cloud/models/slides_sign_qr_code_options_data.rb +674 -0
  128. data/lib/groupdocs_signature_cloud/models/slides_sign_stamp_options_data.rb +592 -0
  129. data/lib/groupdocs_signature_cloud/models/slides_sign_text_options_data.rb +670 -0
  130. data/lib/groupdocs_signature_cloud/models/slides_verify_barcode_options_data.rb +342 -0
  131. data/lib/groupdocs_signature_cloud/models/slides_verify_qr_code_options_data.rb +342 -0
  132. data/lib/groupdocs_signature_cloud/models/slides_verify_text_options_data.rb +285 -0
  133. data/lib/groupdocs_signature_cloud/models/solid_brush_data.rb +240 -0
  134. data/lib/groupdocs_signature_cloud/models/stamp_line_data.rb +377 -0
  135. data/lib/groupdocs_signature_cloud/models/texture_brush_data.rb +240 -0
  136. data/lib/groupdocs_signature_cloud/models/verified_document_response.rb +300 -0
  137. data/lib/groupdocs_signature_cloud/models/verify_barcode_options_data.rb +342 -0
  138. data/lib/groupdocs_signature_cloud/models/verify_digital_options_data.rb +285 -0
  139. data/lib/groupdocs_signature_cloud/models/verify_options_collection_data.rb +247 -0
  140. data/lib/groupdocs_signature_cloud/models/verify_options_data.rb +265 -0
  141. data/lib/groupdocs_signature_cloud/models/verify_qr_code_options_data.rb +342 -0
  142. data/lib/groupdocs_signature_cloud/models/verify_text_options_data.rb +285 -0
  143. data/lib/groupdocs_signature_cloud/models/words_barcode_signature_data.rb +250 -0
  144. data/lib/groupdocs_signature_cloud/models/words_digital_signature_data.rb +307 -0
  145. data/lib/groupdocs_signature_cloud/models/words_qr_code_signature_data.rb +250 -0
  146. data/lib/groupdocs_signature_cloud/models/words_search_barcode_options_data.rb +332 -0
  147. data/lib/groupdocs_signature_cloud/models/words_search_digital_options_data.rb +265 -0
  148. data/lib/groupdocs_signature_cloud/models/words_search_qr_code_options_data.rb +332 -0
  149. data/lib/groupdocs_signature_cloud/models/words_sign_barcode_options_data.rb +664 -0
  150. data/lib/groupdocs_signature_cloud/models/words_sign_digital_options_data.rb +516 -0
  151. data/lib/groupdocs_signature_cloud/models/words_sign_image_options_data.rb +496 -0
  152. data/lib/groupdocs_signature_cloud/models/words_sign_qr_code_options_data.rb +674 -0
  153. data/lib/groupdocs_signature_cloud/models/words_sign_stamp_options_data.rb +592 -0
  154. data/lib/groupdocs_signature_cloud/models/words_sign_text_options_data.rb +696 -0
  155. data/lib/groupdocs_signature_cloud/models/words_verify_barcode_options_data.rb +342 -0
  156. data/lib/groupdocs_signature_cloud/models/words_verify_digital_options_data.rb +315 -0
  157. data/lib/groupdocs_signature_cloud/models/words_verify_qr_code_options_data.rb +342 -0
  158. data/lib/groupdocs_signature_cloud/models/words_verify_text_options_data.rb +285 -0
  159. data/lib/groupdocs_signature_cloud/version.rb +29 -0
  160. metadata +290 -0
@@ -0,0 +1,250 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="cells_qr_code_signature_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
+ # Describes QRCode signature for cells documents.
32
+ class CellsQRCodeSignatureData
33
+
34
+ # Property that specify the name of Signature.
35
+ attr_accessor :signature_type
36
+
37
+ # Specifies the QRCode type.
38
+ attr_accessor :qr_code_type_name
39
+
40
+ # Specifies text of Bar-code.
41
+ attr_accessor :text
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'signature_type' => :'SignatureType',
47
+ :'qr_code_type_name' => :'QRCodeTypeName',
48
+ :'text' => :'Text'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+ :'signature_type' => :'String',
56
+ :'qr_code_type_name' => :'String',
57
+ :'text' => :'String'
58
+ }
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ return unless attributes.is_a?(Hash)
65
+
66
+ # convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
+
69
+ if attributes.key?(:'SignatureType')
70
+ self.signature_type = attributes[:'SignatureType']
71
+ end
72
+
73
+ if attributes.key?(:'QRCodeTypeName')
74
+ self.qr_code_type_name = attributes[:'QRCodeTypeName']
75
+ end
76
+
77
+ if attributes.key?(:'Text')
78
+ self.text = attributes[:'Text']
79
+ end
80
+
81
+
82
+ if !((defined? options_type) == nil)
83
+ self.options_type = "CellsQRCodeSignatureData"
84
+ end
85
+
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properies with the reasons
90
+ def list_invalid_properties
91
+ invalid_properties = []
92
+ return invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ return true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(other)
104
+ return true if self.equal?(other)
105
+ self.class == other.class &&
106
+ signature_type == other.signature_type &&
107
+ qr_code_type_name == other.qr_code_type_name &&
108
+ text == other.text
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(other)
114
+ self == other
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Fixnum] Hash code
119
+ def hash
120
+ [signature_type, qr_code_type_name, text].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ self.class.swagger_types.each_pair do |key, type|
129
+
130
+ attributeName = self.class.attribute_map[key]
131
+ attributeNameLowerStr = attributeName.to_s
132
+ attributeNameLowerStr[0] = attributeNameLowerStr[0].downcase
133
+ attributeNameLower = attributeNameLowerStr.to_sym
134
+ attributeNameLowerStr2 = attributeName.to_s
135
+ attributeNameLowerStr2[0] = attributeNameLowerStr[0].downcase
136
+ attributeNameLowerStr2[1] = attributeNameLowerStr[1].downcase
137
+ attributeNameLower2 = attributeNameLowerStr2.to_sym
138
+
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[attributeName].is_a?(Array)
143
+ self.send("#{key}=", attributes[attributeName].map { |v| _deserialize($1, v) })
144
+ end
145
+ if attributes[attributeNameLower].is_a?(Array)
146
+ self.send("#{key}=", attributes[attributeNameLower].map { |v| _deserialize($1, v) })
147
+ end
148
+ if attributes[attributeNameLower2].is_a?(Array)
149
+ self.send("#{key}=", attributes[attributeNameLower2].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[attributeName].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[attributeName]))
153
+ elsif !attributes[attributeNameLower].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[attributeNameLower]))
155
+ elsif !attributes[attributeNameLower2].nil?
156
+ self.send("#{key}=", _deserialize(type, attributes[attributeNameLower2]))
157
+ end
158
+ # or else data not found in attributes(hash), not an issue as the data can be optional
159
+ end
160
+ self
161
+ end
162
+
163
+ # Deserializes the data based on type
164
+ # @param string type Data type
165
+ # @param string value Value to be deserialized
166
+ # @return [Object] Deserialized data
167
+ def _deserialize(type, value)
168
+ case type.to_sym
169
+ when :DateTime
170
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
171
+ when :Date
172
+ Time.at(/\d/.match(value)[0].to_f).to_date
173
+ when :String
174
+ value.to_s
175
+ when :Integer
176
+ value.to_i
177
+ when :Float
178
+ value.to_f
179
+ when :BOOLEAN
180
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
181
+ true
182
+ else
183
+ false
184
+ end
185
+ when :Object
186
+ # generic object (usually a Hash), return directly
187
+ value
188
+ when /\AArray<(?<inner_type>.+)>\z/
189
+ inner_type = Regexp.last_match[:inner_type]
190
+ value.map { |v| _deserialize(inner_type, v) }
191
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
192
+ k_type = Regexp.last_match[:k_type]
193
+ v_type = Regexp.last_match[:v_type]
194
+ {}.tap do |hash|
195
+ value.each do |k, v|
196
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
197
+ end
198
+ end
199
+ else
200
+ # model
201
+ temp_model = GroupDocsSignatureCloud.const_get(type).new
202
+ temp_model.build_from_hash(value)
203
+ end
204
+ end
205
+
206
+ # Returns the string representation of the object
207
+ # @return [String] String presentation of the object
208
+ def to_s
209
+ to_hash.to_s
210
+ end
211
+
212
+ # to_body is an alias to to_hash (backward compatibility)
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_body
215
+ to_hash
216
+ end
217
+
218
+ # Returns the object in the form of hash
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_hash
221
+ hash = {}
222
+ self.class.attribute_map.each_pair do |attr, param|
223
+ value = self.send(attr)
224
+ next if value.nil?
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end
@@ -0,0 +1,332 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="cells_search_barcode_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 barcode search options for cells documents.
32
+ class CellsSearchBarcodeOptionsData
33
+
34
+ # Gets or sets Document page number for searching. Value is optional.
35
+ attr_accessor :document_page_number
36
+
37
+ # Options to specify pages for Signature searching.
38
+ attr_accessor :pages_setup
39
+
40
+ # Flag to search on each Document page.
41
+ attr_accessor :search_all_pages
42
+
43
+ # Internal property that specify the name of Options.
44
+ attr_accessor :options_type
45
+
46
+ # Specifies Encode Type property to search barcodes. If this value is not set, search is processed for all supported barcode Types.
47
+ attr_accessor :barcode_type_name
48
+
49
+ # Specifies text for searching and matching in barcode signature.
50
+ attr_accessor :text
51
+
52
+ # Get or set barcode text Match Type search. It is used only when Text property is set.
53
+ attr_accessor :match_type
54
+ class EnumAttributeValidator
55
+ attr_reader :datatype
56
+ attr_reader :allowable_values
57
+
58
+ def initialize(datatype, allowable_values)
59
+ @allowable_values = allowable_values.map do |value|
60
+ case datatype.to_s
61
+ when /Integer/i
62
+ value.to_i
63
+ when /Float/i
64
+ value.to_f
65
+ else
66
+ value
67
+ end
68
+ end
69
+ end
70
+
71
+ def valid?(value)
72
+ !value || allowable_values.include?(value)
73
+ end
74
+ end
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+ :'document_page_number' => :'DocumentPageNumber',
80
+ :'pages_setup' => :'PagesSetup',
81
+ :'search_all_pages' => :'SearchAllPages',
82
+ :'options_type' => :'OptionsType',
83
+ :'barcode_type_name' => :'BarcodeTypeName',
84
+ :'text' => :'Text',
85
+ :'match_type' => :'MatchType'
86
+ }
87
+ end
88
+
89
+ # Attribute type mapping.
90
+ def self.swagger_types
91
+ {
92
+ :'document_page_number' => :'Integer',
93
+ :'pages_setup' => :'PagesSetupData',
94
+ :'search_all_pages' => :'BOOLEAN',
95
+ :'options_type' => :'String',
96
+ :'barcode_type_name' => :'String',
97
+ :'text' => :'String',
98
+ :'match_type' => :'String'
99
+ }
100
+ end
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ def initialize(attributes = {})
105
+ return unless attributes.is_a?(Hash)
106
+
107
+ # convert string to symbol for hash key
108
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
109
+
110
+ if attributes.key?(:'DocumentPageNumber')
111
+ self.document_page_number = attributes[:'DocumentPageNumber']
112
+ end
113
+
114
+ if attributes.key?(:'PagesSetup')
115
+ self.pages_setup = attributes[:'PagesSetup']
116
+ end
117
+
118
+ if attributes.key?(:'SearchAllPages')
119
+ self.search_all_pages = attributes[:'SearchAllPages']
120
+ end
121
+
122
+ if attributes.key?(:'OptionsType')
123
+ self.options_type = attributes[:'OptionsType']
124
+ end
125
+
126
+ if attributes.key?(:'BarcodeTypeName')
127
+ self.barcode_type_name = attributes[:'BarcodeTypeName']
128
+ end
129
+
130
+ if attributes.key?(:'Text')
131
+ self.text = attributes[:'Text']
132
+ end
133
+
134
+ if attributes.key?(:'MatchType')
135
+ self.match_type = attributes[:'MatchType']
136
+ end
137
+
138
+
139
+ if !((defined? options_type) == nil)
140
+ self.options_type = "CellsSearchBarcodeOptionsData"
141
+ end
142
+
143
+ end
144
+
145
+ # Show invalid properties with the reasons. Usually used together with valid?
146
+ # @return Array for valid properies with the reasons
147
+ def list_invalid_properties
148
+ invalid_properties = []
149
+ if @search_all_pages.nil?
150
+ invalid_properties.push("invalid value for 'search_all_pages', search_all_pages cannot be nil.")
151
+ end
152
+
153
+ return invalid_properties
154
+ end
155
+
156
+ # Check to see if the all the properties in the model are valid
157
+ # @return true if the model is valid
158
+ def valid?
159
+ return false if @search_all_pages.nil?
160
+ match_type_validator = EnumAttributeValidator.new('String', ["Exact", "StartsWith", "EndsWith", "Contains"])
161
+ return false unless match_type_validator.valid?(@match_type)
162
+ return true
163
+ end
164
+
165
+ # Custom attribute writer method checking allowed values (enum).
166
+ # @param [Object] match_type Object to be assigned
167
+ def match_type=(match_type)
168
+ validator = EnumAttributeValidator.new('String', ["Exact", "StartsWith", "EndsWith", "Contains"])
169
+ if match_type.to_i == 0
170
+ unless validator.valid?(match_type)
171
+ raise ArgumentError, "invalid value for 'match_type', must be one of #{validator.allowable_values}."
172
+ end
173
+ @match_type = match_type
174
+ else
175
+ @match_type = validator.allowable_values[match_type.to_i]
176
+ end
177
+ end
178
+
179
+ # Checks equality by comparing each attribute.
180
+ # @param [Object] Object to be compared
181
+ def ==(other)
182
+ return true if self.equal?(other)
183
+ self.class == other.class &&
184
+ document_page_number == other.document_page_number &&
185
+ pages_setup == other.pages_setup &&
186
+ search_all_pages == other.search_all_pages &&
187
+ options_type == other.options_type &&
188
+ barcode_type_name == other.barcode_type_name &&
189
+ text == other.text &&
190
+ match_type == other.match_type
191
+ end
192
+
193
+ # @see the `==` method
194
+ # @param [Object] Object to be compared
195
+ def eql?(other)
196
+ self == other
197
+ end
198
+
199
+ # Calculates hash code according to all attributes.
200
+ # @return [Fixnum] Hash code
201
+ def hash
202
+ [document_page_number, pages_setup, search_all_pages, options_type, barcode_type_name, text, match_type].hash
203
+ end
204
+
205
+ # Builds the object from hash
206
+ # @param [Hash] attributes Model attributes in the form of hash
207
+ # @return [Object] Returns the model itself
208
+ def build_from_hash(attributes)
209
+ return nil unless attributes.is_a?(Hash)
210
+ self.class.swagger_types.each_pair do |key, type|
211
+
212
+ attributeName = self.class.attribute_map[key]
213
+ attributeNameLowerStr = attributeName.to_s
214
+ attributeNameLowerStr[0] = attributeNameLowerStr[0].downcase
215
+ attributeNameLower = attributeNameLowerStr.to_sym
216
+ attributeNameLowerStr2 = attributeName.to_s
217
+ attributeNameLowerStr2[0] = attributeNameLowerStr[0].downcase
218
+ attributeNameLowerStr2[1] = attributeNameLowerStr[1].downcase
219
+ attributeNameLower2 = attributeNameLowerStr2.to_sym
220
+
221
+ if type =~ /\AArray<(.*)>/i
222
+ # check to ensure the input is an array given that the the attribute
223
+ # is documented as an array but the input is not
224
+ if attributes[attributeName].is_a?(Array)
225
+ self.send("#{key}=", attributes[attributeName].map { |v| _deserialize($1, v) })
226
+ end
227
+ if attributes[attributeNameLower].is_a?(Array)
228
+ self.send("#{key}=", attributes[attributeNameLower].map { |v| _deserialize($1, v) })
229
+ end
230
+ if attributes[attributeNameLower2].is_a?(Array)
231
+ self.send("#{key}=", attributes[attributeNameLower2].map { |v| _deserialize($1, v) })
232
+ end
233
+ elsif !attributes[attributeName].nil?
234
+ self.send("#{key}=", _deserialize(type, attributes[attributeName]))
235
+ elsif !attributes[attributeNameLower].nil?
236
+ self.send("#{key}=", _deserialize(type, attributes[attributeNameLower]))
237
+ elsif !attributes[attributeNameLower2].nil?
238
+ self.send("#{key}=", _deserialize(type, attributes[attributeNameLower2]))
239
+ end
240
+ # or else data not found in attributes(hash), not an issue as the data can be optional
241
+ end
242
+ self
243
+ end
244
+
245
+ # Deserializes the data based on type
246
+ # @param string type Data type
247
+ # @param string value Value to be deserialized
248
+ # @return [Object] Deserialized data
249
+ def _deserialize(type, value)
250
+ case type.to_sym
251
+ when :DateTime
252
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
253
+ when :Date
254
+ Time.at(/\d/.match(value)[0].to_f).to_date
255
+ when :String
256
+ value.to_s
257
+ when :Integer
258
+ value.to_i
259
+ when :Float
260
+ value.to_f
261
+ when :BOOLEAN
262
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
263
+ true
264
+ else
265
+ false
266
+ end
267
+ when :Object
268
+ # generic object (usually a Hash), return directly
269
+ value
270
+ when /\AArray<(?<inner_type>.+)>\z/
271
+ inner_type = Regexp.last_match[:inner_type]
272
+ value.map { |v| _deserialize(inner_type, v) }
273
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
274
+ k_type = Regexp.last_match[:k_type]
275
+ v_type = Regexp.last_match[:v_type]
276
+ {}.tap do |hash|
277
+ value.each do |k, v|
278
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
279
+ end
280
+ end
281
+ else
282
+ # model
283
+ temp_model = GroupDocsSignatureCloud.const_get(type).new
284
+ temp_model.build_from_hash(value)
285
+ end
286
+ end
287
+
288
+ # Returns the string representation of the object
289
+ # @return [String] String presentation of the object
290
+ def to_s
291
+ to_hash.to_s
292
+ end
293
+
294
+ # to_body is an alias to to_hash (backward compatibility)
295
+ # @return [Hash] Returns the object in the form of hash
296
+ def to_body
297
+ to_hash
298
+ end
299
+
300
+ # Returns the object in the form of hash
301
+ # @return [Hash] Returns the object in the form of hash
302
+ def to_hash
303
+ hash = {}
304
+ self.class.attribute_map.each_pair do |attr, param|
305
+ value = self.send(attr)
306
+ next if value.nil?
307
+ hash[param] = _to_hash(value)
308
+ end
309
+ hash
310
+ end
311
+
312
+ # Outputs non-array value in the form of hash
313
+ # For object, use to_hash. Otherwise, just return the value
314
+ # @param [Object] value Any valid value
315
+ # @return [Hash] Returns the value in the form of hash
316
+ def _to_hash(value)
317
+ if value.is_a?(Array)
318
+ value.compact.map { |v| _to_hash(v) }
319
+ elsif value.is_a?(Hash)
320
+ {}.tap do |hash|
321
+ value.each { |k, v| hash[k] = _to_hash(v) }
322
+ end
323
+ elsif value.respond_to? :to_hash
324
+ value.to_hash
325
+ else
326
+ value
327
+ end
328
+ end
329
+
330
+ end
331
+
332
+ end