aspose_pdf_cloud 1.0.2 → 18.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +42 -0
- data/.swagger-codegen-ignore +58 -0
- data/.swagger-codegen/VERSION +1 -0
- data/LICENSE +21 -22
- data/README.md +51 -43
- data/aspose_pdf_cloud.gemspec +32 -8
- data/lib/aspose_pdf_cloud.rb +93 -58
- data/lib/aspose_pdf_cloud/api/pdf_api.rb +2624 -1916
- data/lib/aspose_pdf_cloud/api_client.rb +280 -92
- data/lib/aspose_pdf_cloud/api_error.rb +29 -6
- data/lib/aspose_pdf_cloud/configuration.rb +86 -63
- data/lib/aspose_pdf_cloud/models/annotation.rb +218 -45
- data/lib/aspose_pdf_cloud/models/annotation_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/annotations.rb +187 -25
- data/lib/aspose_pdf_cloud/models/annotations_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/append_document.rb +198 -23
- data/lib/aspose_pdf_cloud/models/attachment.rb +224 -49
- data/lib/aspose_pdf_cloud/models/attachment_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/attachments.rb +187 -25
- data/lib/aspose_pdf_cloud/models/attachments_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/bookmarks.rb +187 -25
- data/lib/aspose_pdf_cloud/models/bookmarks_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/color.rb +214 -31
- data/lib/aspose_pdf_cloud/models/document.rb +194 -29
- data/lib/aspose_pdf_cloud/models/document_pages_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/document_properties.rb +187 -25
- data/lib/aspose_pdf_cloud/models/document_properties_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/document_property.rb +197 -33
- data/lib/aspose_pdf_cloud/models/document_property_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/document_response.rb +206 -34
- data/lib/aspose_pdf_cloud/models/document_text_replace_response.rb +203 -41
- data/lib/aspose_pdf_cloud/models/field.rb +213 -42
- data/lib/aspose_pdf_cloud/models/field_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/field_type.rb +44 -0
- data/lib/aspose_pdf_cloud/models/fields.rb +187 -25
- data/lib/aspose_pdf_cloud/models/fields_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/font_styles.rb +43 -0
- data/lib/aspose_pdf_cloud/models/horizontal_alignment.rb +44 -0
- data/lib/aspose_pdf_cloud/models/http_status_code.rb +87 -0
- data/lib/aspose_pdf_cloud/models/image.rb +194 -29
- data/lib/aspose_pdf_cloud/models/image_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/images.rb +187 -25
- data/lib/aspose_pdf_cloud/models/images_list_request.rb +205 -0
- data/lib/aspose_pdf_cloud/models/images_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/line_spacing.rb +43 -0
- data/lib/aspose_pdf_cloud/models/link.rb +194 -27
- data/lib/aspose_pdf_cloud/models/link_action_type.rb +46 -0
- data/lib/aspose_pdf_cloud/models/link_annotation.rb +204 -39
- data/lib/aspose_pdf_cloud/models/link_annotation_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/link_annotations.rb +187 -25
- data/lib/aspose_pdf_cloud/models/link_annotations_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/link_element.rb +175 -14
- data/lib/aspose_pdf_cloud/models/link_highlighting_mode.rb +45 -0
- data/lib/aspose_pdf_cloud/models/merge_documents.rb +175 -14
- data/lib/aspose_pdf_cloud/models/optimize_options.rb +293 -0
- data/lib/aspose_pdf_cloud/models/page.rb +198 -33
- data/lib/aspose_pdf_cloud/models/page_text_replace_response.rb +203 -41
- data/lib/aspose_pdf_cloud/models/page_word_count.rb +192 -19
- data/lib/aspose_pdf_cloud/models/pages.rb +187 -25
- data/lib/aspose_pdf_cloud/models/paragraph.rb +303 -0
- data/lib/aspose_pdf_cloud/models/rectangle.rb +210 -27
- data/lib/aspose_pdf_cloud/models/rotation.rb +44 -0
- data/lib/aspose_pdf_cloud/models/saa_spose_response.rb +213 -0
- data/lib/aspose_pdf_cloud/models/segment.rb +206 -0
- data/lib/aspose_pdf_cloud/models/signature.rb +278 -54
- data/lib/aspose_pdf_cloud/models/signature_type.rb +42 -0
- data/lib/aspose_pdf_cloud/models/split_result.rb +175 -14
- data/lib/aspose_pdf_cloud/models/split_result_document.rb +206 -37
- data/lib/aspose_pdf_cloud/models/split_result_response.rb +196 -34
- data/lib/aspose_pdf_cloud/models/stamp.rb +312 -104
- data/lib/aspose_pdf_cloud/models/stamp_type.rb +44 -0
- data/lib/aspose_pdf_cloud/models/text_format.rb +197 -33
- data/lib/aspose_pdf_cloud/models/text_format_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/text_horizontal_alignment.rb +47 -0
- data/lib/aspose_pdf_cloud/models/text_item.rb +192 -29
- data/lib/aspose_pdf_cloud/models/text_item_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/text_items.rb +187 -25
- data/lib/aspose_pdf_cloud/models/text_items_response.rb +195 -34
- data/lib/aspose_pdf_cloud/models/text_line.rb +210 -0
- data/lib/aspose_pdf_cloud/models/text_rect.rb +220 -0
- data/lib/aspose_pdf_cloud/models/text_rects.rb +199 -0
- data/lib/aspose_pdf_cloud/models/text_rects_response.rb +222 -0
- data/lib/aspose_pdf_cloud/models/text_replace.rb +225 -25
- data/lib/aspose_pdf_cloud/models/text_replace_list_request.rb +209 -16
- data/lib/aspose_pdf_cloud/models/text_replace_request.rb +262 -0
- data/lib/aspose_pdf_cloud/models/text_replace_response.rb +222 -0
- data/lib/aspose_pdf_cloud/models/text_state.rb +211 -32
- data/lib/aspose_pdf_cloud/models/tiff_export_options.rb +266 -75
- data/lib/aspose_pdf_cloud/models/vertical_alignment.rb +45 -0
- data/lib/aspose_pdf_cloud/models/word_count.rb +174 -14
- data/lib/aspose_pdf_cloud/models/word_count_response.rb +196 -34
- data/lib/aspose_pdf_cloud/models/wrap_mode.rb +44 -0
- data/lib/aspose_pdf_cloud/version.rb +23 -2
- data/test/pdf_tests.rb +1268 -623
- data/test_data/33539.jpg +0 -0
- data/test_data/44781.jpg +0 -0
- data/test_data/4pages.pdf +0 -0
- data/test_data/BlankWithSignature.pdf +0 -0
- data/test_data/Hello_world.pdf +0 -0
- data/test_data/HtmlExample1.html +27 -0
- data/test_data/Koala.jpg +0 -0
- data/test_data/PdfWithAcroForm.pdf +321 -0
- data/test_data/PdfWithAnnotations.pdf +720 -1
- data/test_data/PdfWithBookmarks.pdf +0 -0
- data/test_data/PdfWithEmbeddedFiles.pdf +0 -0
- data/test_data/PdfWithImages2.pdf +0 -0
- data/test_data/PdfWithLinks.pdf +0 -0
- data/test_data/Penguins.jpg +0 -0
- data/test_data/butterfly.jpg +0 -0
- data/test_data/marketing.pdf +0 -0
- data/test_data/rusdoc.pdf +0 -0
- data/test_data/test1234.pfx +0 -0
- metadata +54 -13
- data/lib/aspose_pdf_cloud/models/barcode_response_list.rb +0 -45
- data/lib/aspose_pdf_cloud/models/base_object.rb +0 -86
- data/lib/aspose_pdf_cloud/models/base_response.rb +0 -61
- data/lib/aspose_pdf_cloud/models/page_response.rb +0 -61
@@ -1,109 +1,333 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2018 Aspose.Pdf for Cloud
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
SOFTWARE.
|
19
|
+
--------------------------------------------------------------------------------------------------------------------
|
20
|
+
=end
|
21
|
+
|
22
|
+
require 'date'
|
23
|
+
|
24
|
+
module AsposePdfCloud
|
25
|
+
|
26
|
+
class Signature
|
27
|
+
# Gets or sets the signature path.
|
28
|
+
attr_accessor :signature_path
|
29
|
+
|
30
|
+
# Gets or sets the type of the signature.
|
31
|
+
attr_accessor :signature_type
|
32
|
+
|
33
|
+
# Gets or sets the signature password.
|
34
|
+
attr_accessor :password
|
35
|
+
|
36
|
+
# Sets or gets a graphic appearance for the signature. Property value represents an image file name.
|
37
|
+
attr_accessor :appearance
|
38
|
+
|
39
|
+
# Gets or sets the reason of the signature.
|
40
|
+
attr_accessor :reason
|
41
|
+
|
42
|
+
# Gets or sets the contact of the signature.
|
43
|
+
attr_accessor :contact
|
44
|
+
|
45
|
+
# Gets or sets the location of the signature.
|
46
|
+
attr_accessor :location
|
47
|
+
|
48
|
+
# Gets or sets a value indicating whether this is visible. Supports only when signing particular page.
|
49
|
+
attr_accessor :visible
|
50
|
+
|
51
|
+
# Gets or sets the visible rectangle of the signature. Supports only when signing particular page.
|
52
|
+
attr_accessor :rectangle
|
53
|
+
|
54
|
+
# Gets or sets the name of the signature field. Supports only when signing document with particular form field.
|
55
|
+
attr_accessor :form_field_name
|
56
|
+
|
57
|
+
# Gets or sets the name of the person or authority signing the document..
|
58
|
+
attr_accessor :authority
|
59
|
+
|
60
|
+
# Gets or sets the time of signing.
|
61
|
+
attr_accessor :date
|
62
|
+
|
63
|
+
# Gets or sets the showproperties in signature field
|
64
|
+
attr_accessor :show_properties
|
65
|
+
|
66
|
+
|
67
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
6
68
|
def self.attribute_map
|
7
69
|
{
|
8
|
-
|
9
|
-
# The SignaturePath
|
10
70
|
:'signature_path' => :'SignaturePath',
|
11
|
-
|
12
|
-
# The SignatureType
|
13
71
|
:'signature_type' => :'SignatureType',
|
14
|
-
|
15
|
-
# The Password
|
16
72
|
:'password' => :'Password',
|
17
|
-
|
18
|
-
|
73
|
+
:'appearance' => :'Appearance',
|
74
|
+
:'reason' => :'Reason',
|
19
75
|
:'contact' => :'Contact',
|
20
|
-
|
21
|
-
# The Location
|
22
76
|
:'location' => :'Location',
|
23
|
-
|
24
|
-
# The Visible
|
25
77
|
:'visible' => :'Visible',
|
26
|
-
|
27
|
-
# The Rectangle
|
28
78
|
:'rectangle' => :'Rectangle',
|
29
|
-
|
30
|
-
# The FormFieldName
|
31
79
|
:'form_field_name' => :'FormFieldName',
|
32
|
-
|
33
|
-
# The Authority
|
34
80
|
:'authority' => :'Authority',
|
35
|
-
|
36
|
-
|
37
|
-
:'date' => :'Date'
|
38
|
-
|
81
|
+
:'date' => :'Date',
|
82
|
+
:'show_properties' => :'ShowProperties'
|
39
83
|
}
|
40
84
|
end
|
41
85
|
|
42
|
-
#
|
86
|
+
# Attribute type mapping.
|
43
87
|
def self.swagger_types
|
44
88
|
{
|
45
89
|
:'signature_path' => :'String',
|
46
|
-
:'signature_type' => :'
|
90
|
+
:'signature_type' => :'SignatureType',
|
47
91
|
:'password' => :'String',
|
92
|
+
:'appearance' => :'String',
|
93
|
+
:'reason' => :'String',
|
48
94
|
:'contact' => :'String',
|
49
95
|
:'location' => :'String',
|
50
96
|
:'visible' => :'BOOLEAN',
|
51
97
|
:'rectangle' => :'Rectangle',
|
52
98
|
:'form_field_name' => :'String',
|
53
99
|
:'authority' => :'String',
|
54
|
-
:'date' => :'String'
|
55
|
-
|
100
|
+
:'date' => :'String',
|
101
|
+
:'show_properties' => :'BOOLEAN'
|
56
102
|
}
|
57
103
|
end
|
58
104
|
|
105
|
+
# Initializes the object
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
59
107
|
def initialize(attributes = {})
|
60
|
-
return
|
108
|
+
return unless attributes.is_a?(Hash)
|
61
109
|
|
62
110
|
# convert string to symbol for hash key
|
63
|
-
attributes = attributes.
|
111
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
64
112
|
|
65
|
-
|
66
|
-
if attributes[:'SignaturePath']
|
113
|
+
if attributes.has_key?(:'SignaturePath')
|
67
114
|
self.signature_path = attributes[:'SignaturePath']
|
68
115
|
end
|
69
|
-
|
70
|
-
if attributes
|
116
|
+
|
117
|
+
if attributes.has_key?(:'SignatureType')
|
71
118
|
self.signature_type = attributes[:'SignatureType']
|
72
119
|
end
|
73
|
-
|
74
|
-
if attributes
|
120
|
+
|
121
|
+
if attributes.has_key?(:'Password')
|
75
122
|
self.password = attributes[:'Password']
|
76
123
|
end
|
77
|
-
|
78
|
-
if attributes
|
124
|
+
|
125
|
+
if attributes.has_key?(:'Appearance')
|
126
|
+
self.appearance = attributes[:'Appearance']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.has_key?(:'Reason')
|
130
|
+
self.reason = attributes[:'Reason']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.has_key?(:'Contact')
|
79
134
|
self.contact = attributes[:'Contact']
|
80
135
|
end
|
81
|
-
|
82
|
-
if attributes
|
136
|
+
|
137
|
+
if attributes.has_key?(:'Location')
|
83
138
|
self.location = attributes[:'Location']
|
84
139
|
end
|
85
|
-
|
86
|
-
if attributes
|
140
|
+
|
141
|
+
if attributes.has_key?(:'Visible')
|
87
142
|
self.visible = attributes[:'Visible']
|
88
143
|
end
|
89
|
-
|
90
|
-
if attributes
|
144
|
+
|
145
|
+
if attributes.has_key?(:'Rectangle')
|
91
146
|
self.rectangle = attributes[:'Rectangle']
|
92
147
|
end
|
93
|
-
|
94
|
-
if attributes
|
148
|
+
|
149
|
+
if attributes.has_key?(:'FormFieldName')
|
95
150
|
self.form_field_name = attributes[:'FormFieldName']
|
96
151
|
end
|
97
|
-
|
98
|
-
if attributes
|
152
|
+
|
153
|
+
if attributes.has_key?(:'Authority')
|
99
154
|
self.authority = attributes[:'Authority']
|
100
155
|
end
|
101
|
-
|
102
|
-
if attributes
|
156
|
+
|
157
|
+
if attributes.has_key?(:'Date')
|
103
158
|
self.date = attributes[:'Date']
|
104
159
|
end
|
105
|
-
|
160
|
+
|
161
|
+
if attributes.has_key?(:'ShowProperties')
|
162
|
+
self.show_properties = attributes[:'ShowProperties']
|
163
|
+
end
|
164
|
+
|
165
|
+
end
|
166
|
+
|
167
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
168
|
+
# @return Array for valid properies with the reasons
|
169
|
+
def list_invalid_properties
|
170
|
+
invalid_properties = Array.new
|
171
|
+
if @signature_type.nil?
|
172
|
+
invalid_properties.push("invalid value for 'signature_type', signature_type cannot be nil.")
|
173
|
+
end
|
174
|
+
|
175
|
+
if @visible.nil?
|
176
|
+
invalid_properties.push("invalid value for 'visible', visible cannot be nil.")
|
177
|
+
end
|
178
|
+
|
179
|
+
if @show_properties.nil?
|
180
|
+
invalid_properties.push("invalid value for 'show_properties', show_properties cannot be nil.")
|
181
|
+
end
|
182
|
+
|
183
|
+
return invalid_properties
|
184
|
+
end
|
185
|
+
|
186
|
+
# Check to see if the all the properties in the model are valid
|
187
|
+
# @return true if the model is valid
|
188
|
+
def valid?
|
189
|
+
return false if @signature_type.nil?
|
190
|
+
return false if @visible.nil?
|
191
|
+
return false if @show_properties.nil?
|
192
|
+
return true
|
193
|
+
end
|
194
|
+
|
195
|
+
# Checks equality by comparing each attribute.
|
196
|
+
# @param [Object] Object to be compared
|
197
|
+
def ==(o)
|
198
|
+
return true if self.equal?(o)
|
199
|
+
self.class == o.class &&
|
200
|
+
signature_path == o.signature_path &&
|
201
|
+
signature_type == o.signature_type &&
|
202
|
+
password == o.password &&
|
203
|
+
appearance == o.appearance &&
|
204
|
+
reason == o.reason &&
|
205
|
+
contact == o.contact &&
|
206
|
+
location == o.location &&
|
207
|
+
visible == o.visible &&
|
208
|
+
rectangle == o.rectangle &&
|
209
|
+
form_field_name == o.form_field_name &&
|
210
|
+
authority == o.authority &&
|
211
|
+
date == o.date &&
|
212
|
+
show_properties == o.show_properties
|
213
|
+
end
|
214
|
+
|
215
|
+
# @see the `==` method
|
216
|
+
# @param [Object] Object to be compared
|
217
|
+
def eql?(o)
|
218
|
+
self == o
|
219
|
+
end
|
220
|
+
|
221
|
+
# Calculates hash code according to all attributes.
|
222
|
+
# @return [Fixnum] Hash code
|
223
|
+
def hash
|
224
|
+
[signature_path, signature_type, password, appearance, reason, contact, location, visible, rectangle, form_field_name, authority, date, show_properties].hash
|
225
|
+
end
|
226
|
+
|
227
|
+
# Builds the object from hash
|
228
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
229
|
+
# @return [Object] Returns the model itself
|
230
|
+
def build_from_hash(attributes)
|
231
|
+
return nil unless attributes.is_a?(Hash)
|
232
|
+
self.class.swagger_types.each_pair do |key, type|
|
233
|
+
if type =~ /\AArray<(.*)>/i
|
234
|
+
# check to ensure the input is an array given that the the attribute
|
235
|
+
# is documented as an array but the input is not
|
236
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
237
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
238
|
+
end
|
239
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
240
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
241
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
242
|
+
end
|
243
|
+
|
244
|
+
self
|
245
|
+
end
|
246
|
+
|
247
|
+
# Deserializes the data based on type
|
248
|
+
# @param string type Data type
|
249
|
+
# @param string value Value to be deserialized
|
250
|
+
# @return [Object] Deserialized data
|
251
|
+
def _deserialize(type, value)
|
252
|
+
case type.to_sym
|
253
|
+
when :DateTime
|
254
|
+
DateTime.parse(value)
|
255
|
+
when :Date
|
256
|
+
Date.parse(value)
|
257
|
+
when :String
|
258
|
+
value.to_s
|
259
|
+
when :Integer
|
260
|
+
value.to_i
|
261
|
+
when :Float
|
262
|
+
value.to_f
|
263
|
+
when :BOOLEAN
|
264
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
265
|
+
true
|
266
|
+
else
|
267
|
+
false
|
268
|
+
end
|
269
|
+
when :Object
|
270
|
+
# generic object (usually a Hash), return directly
|
271
|
+
value
|
272
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
273
|
+
inner_type = Regexp.last_match[:inner_type]
|
274
|
+
value.map { |v| _deserialize(inner_type, v) }
|
275
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
276
|
+
k_type = Regexp.last_match[:k_type]
|
277
|
+
v_type = Regexp.last_match[:v_type]
|
278
|
+
{}.tap do |hash|
|
279
|
+
value.each do |k, v|
|
280
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
281
|
+
end
|
282
|
+
end
|
283
|
+
else # model
|
284
|
+
temp_model = AsposePdfCloud.const_get(type).new
|
285
|
+
temp_model.build_from_hash(value)
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
# Returns the string representation of the object
|
290
|
+
# @return [String] String presentation of the object
|
291
|
+
def to_s
|
292
|
+
to_hash.to_s
|
293
|
+
end
|
294
|
+
|
295
|
+
# to_body is an alias to to_hash (backward compatibility)
|
296
|
+
# @return [Hash] Returns the object in the form of hash
|
297
|
+
def to_body
|
298
|
+
to_hash
|
299
|
+
end
|
300
|
+
|
301
|
+
# Returns the object in the form of hash
|
302
|
+
# @return [Hash] Returns the object in the form of hash
|
303
|
+
def to_hash
|
304
|
+
hash = {}
|
305
|
+
self.class.attribute_map.each_pair do |attr, param|
|
306
|
+
value = self.send(attr)
|
307
|
+
next if value.nil?
|
308
|
+
hash[param] = _to_hash(value)
|
309
|
+
end
|
310
|
+
hash
|
311
|
+
end
|
312
|
+
|
313
|
+
# Outputs non-array value in the form of hash
|
314
|
+
# For object, use to_hash. Otherwise, just return the value
|
315
|
+
# @param [Object] value Any valid value
|
316
|
+
# @return [Hash] Returns the value in the form of hash
|
317
|
+
def _to_hash(value)
|
318
|
+
if value.is_a?(Array)
|
319
|
+
value.compact.map{ |v| _to_hash(v) }
|
320
|
+
elsif value.is_a?(Hash)
|
321
|
+
{}.tap do |hash|
|
322
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
323
|
+
end
|
324
|
+
elsif value.respond_to? :to_hash
|
325
|
+
value.to_hash
|
326
|
+
else
|
327
|
+
value
|
328
|
+
end
|
106
329
|
end
|
107
330
|
|
108
331
|
end
|
332
|
+
|
109
333
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2018 Aspose.Pdf for Cloud
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
SOFTWARE.
|
19
|
+
--------------------------------------------------------------------------------------------------------------------
|
20
|
+
=end
|
21
|
+
|
22
|
+
require 'date'
|
23
|
+
|
24
|
+
module AsposePdfCloud
|
25
|
+
class SignatureType
|
26
|
+
|
27
|
+
PKCS_1 = 0.freeze
|
28
|
+
PKCS_7 = 1.freeze
|
29
|
+
PKCS_7_DETACHED = 2.freeze
|
30
|
+
|
31
|
+
# Builds the enum from string
|
32
|
+
# @param [Fixnum] The enum value in the form of the string
|
33
|
+
# @return [Fixnum] The enum value
|
34
|
+
def build_from_hash(value)
|
35
|
+
constantValues = SignatureType.constants.select{ |const_name| SignatureType.const_get(const_name) == value}
|
36
|
+
raise "Invalid ENUM value #{value} for class #SignatureType" if constantValues.empty?
|
37
|
+
value
|
38
|
+
#constantValues[0]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -1,39 +1,200 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2018 Aspose.Pdf for Cloud
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
SOFTWARE.
|
19
|
+
--------------------------------------------------------------------------------------------------------------------
|
20
|
+
=end
|
21
|
+
|
22
|
+
require 'date'
|
23
|
+
|
24
|
+
module AsposePdfCloud
|
25
|
+
# Represents split result object.
|
26
|
+
class SplitResult
|
27
|
+
# Gets or sets the list of documents.
|
4
28
|
attr_accessor :documents
|
5
|
-
|
29
|
+
|
30
|
+
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
6
32
|
def self.attribute_map
|
7
33
|
{
|
8
|
-
|
9
|
-
#
|
10
34
|
:'documents' => :'Documents'
|
11
|
-
|
12
35
|
}
|
13
36
|
end
|
14
37
|
|
15
|
-
#
|
38
|
+
# Attribute type mapping.
|
16
39
|
def self.swagger_types
|
17
40
|
{
|
18
41
|
:'documents' => :'Array<SplitResultDocument>'
|
19
|
-
|
20
42
|
}
|
21
43
|
end
|
22
44
|
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
23
47
|
def initialize(attributes = {})
|
24
|
-
return
|
48
|
+
return unless attributes.is_a?(Hash)
|
25
49
|
|
26
50
|
# convert string to symbol for hash key
|
27
|
-
attributes = attributes.
|
51
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
28
52
|
|
29
|
-
|
30
|
-
if attributes[:'Documents']
|
53
|
+
if attributes.has_key?(:'Documents')
|
31
54
|
if (value = attributes[:'Documents']).is_a?(Array)
|
32
55
|
self.documents = value
|
33
56
|
end
|
34
57
|
end
|
35
|
-
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
62
|
+
# @return Array for valid properies with the reasons
|
63
|
+
def list_invalid_properties
|
64
|
+
invalid_properties = Array.new
|
65
|
+
return invalid_properties
|
66
|
+
end
|
67
|
+
|
68
|
+
# Check to see if the all the properties in the model are valid
|
69
|
+
# @return true if the model is valid
|
70
|
+
def valid?
|
71
|
+
return true
|
72
|
+
end
|
73
|
+
|
74
|
+
# Checks equality by comparing each attribute.
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def ==(o)
|
77
|
+
return true if self.equal?(o)
|
78
|
+
self.class == o.class &&
|
79
|
+
documents == o.documents
|
80
|
+
end
|
81
|
+
|
82
|
+
# @see the `==` method
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def eql?(o)
|
85
|
+
self == o
|
86
|
+
end
|
87
|
+
|
88
|
+
# Calculates hash code according to all attributes.
|
89
|
+
# @return [Fixnum] Hash code
|
90
|
+
def hash
|
91
|
+
[documents].hash
|
92
|
+
end
|
93
|
+
|
94
|
+
# Builds the object from hash
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
# @return [Object] Returns the model itself
|
97
|
+
def build_from_hash(attributes)
|
98
|
+
return nil unless attributes.is_a?(Hash)
|
99
|
+
self.class.swagger_types.each_pair do |key, type|
|
100
|
+
if type =~ /\AArray<(.*)>/i
|
101
|
+
# check to ensure the input is an array given that the the attribute
|
102
|
+
# is documented as an array but the input is not
|
103
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
104
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
105
|
+
end
|
106
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
107
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
108
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
109
|
+
end
|
110
|
+
|
111
|
+
self
|
112
|
+
end
|
113
|
+
|
114
|
+
# Deserializes the data based on type
|
115
|
+
# @param string type Data type
|
116
|
+
# @param string value Value to be deserialized
|
117
|
+
# @return [Object] Deserialized data
|
118
|
+
def _deserialize(type, value)
|
119
|
+
case type.to_sym
|
120
|
+
when :DateTime
|
121
|
+
DateTime.parse(value)
|
122
|
+
when :Date
|
123
|
+
Date.parse(value)
|
124
|
+
when :String
|
125
|
+
value.to_s
|
126
|
+
when :Integer
|
127
|
+
value.to_i
|
128
|
+
when :Float
|
129
|
+
value.to_f
|
130
|
+
when :BOOLEAN
|
131
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
132
|
+
true
|
133
|
+
else
|
134
|
+
false
|
135
|
+
end
|
136
|
+
when :Object
|
137
|
+
# generic object (usually a Hash), return directly
|
138
|
+
value
|
139
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
140
|
+
inner_type = Regexp.last_match[:inner_type]
|
141
|
+
value.map { |v| _deserialize(inner_type, v) }
|
142
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
143
|
+
k_type = Regexp.last_match[:k_type]
|
144
|
+
v_type = Regexp.last_match[:v_type]
|
145
|
+
{}.tap do |hash|
|
146
|
+
value.each do |k, v|
|
147
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
else # model
|
151
|
+
temp_model = AsposePdfCloud.const_get(type).new
|
152
|
+
temp_model.build_from_hash(value)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
# Returns the string representation of the object
|
157
|
+
# @return [String] String presentation of the object
|
158
|
+
def to_s
|
159
|
+
to_hash.to_s
|
160
|
+
end
|
161
|
+
|
162
|
+
# to_body is an alias to to_hash (backward compatibility)
|
163
|
+
# @return [Hash] Returns the object in the form of hash
|
164
|
+
def to_body
|
165
|
+
to_hash
|
166
|
+
end
|
167
|
+
|
168
|
+
# Returns the object in the form of hash
|
169
|
+
# @return [Hash] Returns the object in the form of hash
|
170
|
+
def to_hash
|
171
|
+
hash = {}
|
172
|
+
self.class.attribute_map.each_pair do |attr, param|
|
173
|
+
value = self.send(attr)
|
174
|
+
next if value.nil?
|
175
|
+
hash[param] = _to_hash(value)
|
176
|
+
end
|
177
|
+
hash
|
178
|
+
end
|
179
|
+
|
180
|
+
# Outputs non-array value in the form of hash
|
181
|
+
# For object, use to_hash. Otherwise, just return the value
|
182
|
+
# @param [Object] value Any valid value
|
183
|
+
# @return [Hash] Returns the value in the form of hash
|
184
|
+
def _to_hash(value)
|
185
|
+
if value.is_a?(Array)
|
186
|
+
value.compact.map{ |v| _to_hash(v) }
|
187
|
+
elsif value.is_a?(Hash)
|
188
|
+
{}.tap do |hash|
|
189
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
190
|
+
end
|
191
|
+
elsif value.respond_to? :to_hash
|
192
|
+
value.to_hash
|
193
|
+
else
|
194
|
+
value
|
195
|
+
end
|
36
196
|
end
|
37
197
|
|
38
198
|
end
|
199
|
+
|
39
200
|
end
|