aspose_pdf_cloud 18.6.0 → 18.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +4 -4
- data/aspose_pdf_cloud.gemspec +49 -49
- data/lib/aspose_pdf_cloud.rb +145 -145
- data/lib/aspose_pdf_cloud/api/pdf_api.rb +11705 -10569
- data/lib/aspose_pdf_cloud/api_client.rb +60 -6
- data/lib/aspose_pdf_cloud/api_error.rb +47 -47
- data/lib/aspose_pdf_cloud/configuration.rb +185 -185
- data/lib/aspose_pdf_cloud/models/annotation.rb +260 -260
- data/lib/aspose_pdf_cloud/models/annotation_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/annotations.rb +211 -211
- data/lib/aspose_pdf_cloud/models/annotations_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/antialiasing_processing_type.rb +43 -43
- data/lib/aspose_pdf_cloud/models/append_document.rb +228 -228
- data/lib/aspose_pdf_cloud/models/attachment.rb +270 -270
- data/lib/aspose_pdf_cloud/models/attachment_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/attachments.rb +211 -211
- data/lib/aspose_pdf_cloud/models/attachments_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/color.rb +244 -244
- data/lib/aspose_pdf_cloud/models/color_depth.rb +45 -45
- data/lib/aspose_pdf_cloud/models/compression_type.rb +46 -46
- data/lib/aspose_pdf_cloud/models/doc_format.rb +43 -43
- data/lib/aspose_pdf_cloud/models/doc_recognition_mode.rb +43 -43
- data/lib/aspose_pdf_cloud/models/document.rb +220 -220
- data/lib/aspose_pdf_cloud/models/document_pages_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/document_privilege.rb +298 -298
- data/lib/aspose_pdf_cloud/models/document_properties.rb +211 -211
- data/lib/aspose_pdf_cloud/models/document_properties_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/document_property.rb +227 -227
- data/lib/aspose_pdf_cloud/models/document_property_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/document_response.rb +233 -233
- data/lib/aspose_pdf_cloud/models/document_text_replace_response.rb +231 -231
- data/lib/aspose_pdf_cloud/models/epub_recognition_mode.rb +44 -44
- data/lib/aspose_pdf_cloud/models/field.rb +254 -254
- data/lib/aspose_pdf_cloud/models/field_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/field_type.rb +1 -1
- data/lib/aspose_pdf_cloud/models/fields.rb +211 -211
- data/lib/aspose_pdf_cloud/models/fields_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/font_encoding_rules.rb +43 -43
- data/lib/aspose_pdf_cloud/models/font_saving_modes.rb +45 -45
- data/lib/aspose_pdf_cloud/models/font_styles.rb +1 -1
- data/lib/aspose_pdf_cloud/models/horizontal_alignment.rb +1 -1
- data/lib/aspose_pdf_cloud/models/html_document_type.rb +43 -43
- data/lib/aspose_pdf_cloud/models/html_markup_generation_modes.rb +43 -43
- data/lib/aspose_pdf_cloud/models/http_status_code.rb +1 -1
- data/lib/aspose_pdf_cloud/models/image.rb +220 -220
- data/lib/aspose_pdf_cloud/models/image_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/image_src_type.rb +43 -43
- data/lib/aspose_pdf_cloud/models/image_template.rb +281 -281
- data/lib/aspose_pdf_cloud/models/image_templates_request.rb +230 -230
- data/lib/aspose_pdf_cloud/models/images.rb +211 -211
- data/lib/aspose_pdf_cloud/models/images_list_request.rb +205 -205
- data/lib/aspose_pdf_cloud/models/images_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/letters_positioning_methods.rb +43 -43
- data/lib/aspose_pdf_cloud/models/line_spacing.rb +43 -43
- data/lib/aspose_pdf_cloud/models/link.rb +228 -228
- data/lib/aspose_pdf_cloud/models/link_action_type.rb +1 -1
- data/lib/aspose_pdf_cloud/models/link_annotation.rb +236 -236
- data/lib/aspose_pdf_cloud/models/link_annotation_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/link_annotations.rb +211 -211
- data/lib/aspose_pdf_cloud/models/link_annotations_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/link_element.rb +200 -200
- data/lib/aspose_pdf_cloud/models/link_highlighting_mode.rb +1 -1
- data/lib/aspose_pdf_cloud/models/margin_info.rb +244 -244
- data/lib/aspose_pdf_cloud/models/merge_documents.rb +200 -200
- data/lib/aspose_pdf_cloud/models/optimize_options.rb +293 -293
- data/lib/aspose_pdf_cloud/models/page.rb +228 -228
- data/lib/aspose_pdf_cloud/models/page_text_replace_response.rb +231 -231
- data/lib/aspose_pdf_cloud/models/page_word_count.rb +218 -218
- data/lib/aspose_pdf_cloud/models/pages.rb +211 -211
- data/lib/aspose_pdf_cloud/models/paragraph.rb +303 -303
- data/lib/aspose_pdf_cloud/models/parts_embedding_modes.rb +44 -44
- data/lib/aspose_pdf_cloud/models/pdf_a_type.rb +43 -43
- data/lib/aspose_pdf_cloud/models/raster_images_saving_modes.rb +44 -44
- data/lib/aspose_pdf_cloud/models/rectangle.rb +244 -244
- data/lib/aspose_pdf_cloud/models/rotation.rb +1 -1
- data/lib/aspose_pdf_cloud/models/saa_spose_response.rb +213 -213
- data/lib/aspose_pdf_cloud/models/segment.rb +206 -206
- data/lib/aspose_pdf_cloud/models/shape_type.rb +44 -44
- data/lib/aspose_pdf_cloud/models/signature.rb +333 -333
- data/lib/aspose_pdf_cloud/models/signature_type.rb +1 -1
- data/lib/aspose_pdf_cloud/models/signature_verify_response.rb +223 -223
- data/lib/aspose_pdf_cloud/models/split_result.rb +200 -200
- data/lib/aspose_pdf_cloud/models/split_result_document.rb +238 -238
- data/lib/aspose_pdf_cloud/models/split_result_response.rb +223 -223
- data/lib/aspose_pdf_cloud/models/stamp.rb +413 -413
- data/lib/aspose_pdf_cloud/models/stamp_type.rb +1 -1
- data/lib/aspose_pdf_cloud/models/text_format.rb +227 -227
- data/lib/aspose_pdf_cloud/models/text_format_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/text_horizontal_alignment.rb +47 -47
- data/lib/aspose_pdf_cloud/models/text_item.rb +218 -218
- data/lib/aspose_pdf_cloud/models/text_item_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/text_items.rb +211 -211
- data/lib/aspose_pdf_cloud/models/text_items_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/text_line.rb +210 -210
- data/lib/aspose_pdf_cloud/models/text_rect.rb +220 -220
- data/lib/aspose_pdf_cloud/models/text_rects.rb +199 -199
- data/lib/aspose_pdf_cloud/models/text_rects_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/text_replace.rb +253 -253
- data/lib/aspose_pdf_cloud/models/text_replace_list_request.rb +232 -232
- data/lib/aspose_pdf_cloud/models/text_replace_request.rb +262 -262
- data/lib/aspose_pdf_cloud/models/text_replace_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/text_state.rb +248 -248
- data/lib/aspose_pdf_cloud/models/tiff_export_options.rb +348 -348
- data/lib/aspose_pdf_cloud/models/vertical_alignment.rb +45 -45
- data/lib/aspose_pdf_cloud/models/word_count.rb +199 -199
- data/lib/aspose_pdf_cloud/models/word_count_response.rb +223 -223
- data/lib/aspose_pdf_cloud/models/wrap_mode.rb +44 -44
- data/lib/aspose_pdf_cloud/version.rb +24 -24
- data/test/pdf_tests.rb +3 -3
- data/test_data/.gitattributes +1 -0
- data/test_data/TexExample.tex +304 -304
- metadata +13 -12
@@ -1,222 +1,222 @@
|
|
1
|
-
=begin
|
2
|
-
--------------------------------------------------------------------------------------------------------------------
|
3
|
-
Copyright (c) 2018 Aspose.
|
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 LinkAnnotationsResponse
|
27
|
-
# Response status code.
|
28
|
-
attr_accessor :code
|
29
|
-
|
30
|
-
# Response status.
|
31
|
-
attr_accessor :status
|
32
|
-
|
33
|
-
attr_accessor :links
|
34
|
-
|
35
|
-
|
36
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
37
|
-
def self.attribute_map
|
38
|
-
{
|
39
|
-
:'code' => :'Code',
|
40
|
-
:'status' => :'Status',
|
41
|
-
:'links' => :'Links'
|
42
|
-
}
|
43
|
-
end
|
44
|
-
|
45
|
-
# Attribute type mapping.
|
46
|
-
def self.swagger_types
|
47
|
-
{
|
48
|
-
:'code' => :'HttpStatusCode',
|
49
|
-
:'status' => :'String',
|
50
|
-
:'links' => :'LinkAnnotations'
|
51
|
-
}
|
52
|
-
end
|
53
|
-
|
54
|
-
# Initializes the object
|
55
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
56
|
-
def initialize(attributes = {})
|
57
|
-
return unless attributes.is_a?(Hash)
|
58
|
-
|
59
|
-
# convert string to symbol for hash key
|
60
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
61
|
-
|
62
|
-
if attributes.has_key?(:'Code')
|
63
|
-
self.code = attributes[:'Code']
|
64
|
-
end
|
65
|
-
|
66
|
-
if attributes.has_key?(:'Status')
|
67
|
-
self.status = attributes[:'Status']
|
68
|
-
end
|
69
|
-
|
70
|
-
if attributes.has_key?(:'Links')
|
71
|
-
self.links = attributes[:'Links']
|
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 = Array.new
|
80
|
-
if @code.nil?
|
81
|
-
invalid_properties.push("invalid value for 'code', code cannot be nil.")
|
82
|
-
end
|
83
|
-
|
84
|
-
return invalid_properties
|
85
|
-
end
|
86
|
-
|
87
|
-
# Check to see if the all the properties in the model are valid
|
88
|
-
# @return true if the model is valid
|
89
|
-
def valid?
|
90
|
-
return false if @code.nil?
|
91
|
-
return true
|
92
|
-
end
|
93
|
-
|
94
|
-
# Checks equality by comparing each attribute.
|
95
|
-
# @param [Object] Object to be compared
|
96
|
-
def ==(o)
|
97
|
-
return true if self.equal?(o)
|
98
|
-
self.class == o.class &&
|
99
|
-
code == o.code &&
|
100
|
-
status == o.status &&
|
101
|
-
links == o.links
|
102
|
-
end
|
103
|
-
|
104
|
-
# @see the `==` method
|
105
|
-
# @param [Object] Object to be compared
|
106
|
-
def eql?(o)
|
107
|
-
self == o
|
108
|
-
end
|
109
|
-
|
110
|
-
# Calculates hash code according to all attributes.
|
111
|
-
# @return [Fixnum] Hash code
|
112
|
-
def hash
|
113
|
-
[code, status, links].hash
|
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
|
-
if type =~ /\AArray<(.*)>/i
|
123
|
-
# check to ensure the input is an array given that the the attribute
|
124
|
-
# is documented as an array but the input is not
|
125
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
126
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
127
|
-
end
|
128
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
129
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
130
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
131
|
-
end
|
132
|
-
|
133
|
-
self
|
134
|
-
end
|
135
|
-
|
136
|
-
# Deserializes the data based on type
|
137
|
-
# @param string type Data type
|
138
|
-
# @param string value Value to be deserialized
|
139
|
-
# @return [Object] Deserialized data
|
140
|
-
def _deserialize(type, value)
|
141
|
-
case type.to_sym
|
142
|
-
when :DateTime
|
143
|
-
DateTime.parse(value)
|
144
|
-
when :Date
|
145
|
-
Date.parse(value)
|
146
|
-
when :String
|
147
|
-
value.to_s
|
148
|
-
when :Integer
|
149
|
-
value.to_i
|
150
|
-
when :Float
|
151
|
-
value.to_f
|
152
|
-
when :BOOLEAN
|
153
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
154
|
-
true
|
155
|
-
else
|
156
|
-
false
|
157
|
-
end
|
158
|
-
when :Object
|
159
|
-
# generic object (usually a Hash), return directly
|
160
|
-
value
|
161
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
162
|
-
inner_type = Regexp.last_match[:inner_type]
|
163
|
-
value.map { |v| _deserialize(inner_type, v) }
|
164
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
165
|
-
k_type = Regexp.last_match[:k_type]
|
166
|
-
v_type = Regexp.last_match[:v_type]
|
167
|
-
{}.tap do |hash|
|
168
|
-
value.each do |k, v|
|
169
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
170
|
-
end
|
171
|
-
end
|
172
|
-
else # model
|
173
|
-
temp_model = AsposePdfCloud.const_get(type).new
|
174
|
-
temp_model.build_from_hash(value)
|
175
|
-
end
|
176
|
-
end
|
177
|
-
|
178
|
-
# Returns the string representation of the object
|
179
|
-
# @return [String] String presentation of the object
|
180
|
-
def to_s
|
181
|
-
to_hash.to_s
|
182
|
-
end
|
183
|
-
|
184
|
-
# to_body is an alias to to_hash (backward compatibility)
|
185
|
-
# @return [Hash] Returns the object in the form of hash
|
186
|
-
def to_body
|
187
|
-
to_hash
|
188
|
-
end
|
189
|
-
|
190
|
-
# Returns the object in the form of hash
|
191
|
-
# @return [Hash] Returns the object in the form of hash
|
192
|
-
def to_hash
|
193
|
-
hash = {}
|
194
|
-
self.class.attribute_map.each_pair do |attr, param|
|
195
|
-
value = self.send(attr)
|
196
|
-
next if value.nil?
|
197
|
-
hash[param] = _to_hash(value)
|
198
|
-
end
|
199
|
-
hash
|
200
|
-
end
|
201
|
-
|
202
|
-
# Outputs non-array value in the form of hash
|
203
|
-
# For object, use to_hash. Otherwise, just return the value
|
204
|
-
# @param [Object] value Any valid value
|
205
|
-
# @return [Hash] Returns the value in the form of hash
|
206
|
-
def _to_hash(value)
|
207
|
-
if value.is_a?(Array)
|
208
|
-
value.compact.map{ |v| _to_hash(v) }
|
209
|
-
elsif value.is_a?(Hash)
|
210
|
-
{}.tap do |hash|
|
211
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
212
|
-
end
|
213
|
-
elsif value.respond_to? :to_hash
|
214
|
-
value.to_hash
|
215
|
-
else
|
216
|
-
value
|
217
|
-
end
|
218
|
-
end
|
219
|
-
|
220
|
-
end
|
221
|
-
|
222
|
-
end
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2018 Aspose.PDF 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 LinkAnnotationsResponse
|
27
|
+
# Response status code.
|
28
|
+
attr_accessor :code
|
29
|
+
|
30
|
+
# Response status.
|
31
|
+
attr_accessor :status
|
32
|
+
|
33
|
+
attr_accessor :links
|
34
|
+
|
35
|
+
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
37
|
+
def self.attribute_map
|
38
|
+
{
|
39
|
+
:'code' => :'Code',
|
40
|
+
:'status' => :'Status',
|
41
|
+
:'links' => :'Links'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.swagger_types
|
47
|
+
{
|
48
|
+
:'code' => :'HttpStatusCode',
|
49
|
+
:'status' => :'String',
|
50
|
+
:'links' => :'LinkAnnotations'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Initializes the object
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
56
|
+
def initialize(attributes = {})
|
57
|
+
return unless attributes.is_a?(Hash)
|
58
|
+
|
59
|
+
# convert string to symbol for hash key
|
60
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
61
|
+
|
62
|
+
if attributes.has_key?(:'Code')
|
63
|
+
self.code = attributes[:'Code']
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.has_key?(:'Status')
|
67
|
+
self.status = attributes[:'Status']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.has_key?(:'Links')
|
71
|
+
self.links = attributes[:'Links']
|
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 = Array.new
|
80
|
+
if @code.nil?
|
81
|
+
invalid_properties.push("invalid value for 'code', code cannot be nil.")
|
82
|
+
end
|
83
|
+
|
84
|
+
return invalid_properties
|
85
|
+
end
|
86
|
+
|
87
|
+
# Check to see if the all the properties in the model are valid
|
88
|
+
# @return true if the model is valid
|
89
|
+
def valid?
|
90
|
+
return false if @code.nil?
|
91
|
+
return true
|
92
|
+
end
|
93
|
+
|
94
|
+
# Checks equality by comparing each attribute.
|
95
|
+
# @param [Object] Object to be compared
|
96
|
+
def ==(o)
|
97
|
+
return true if self.equal?(o)
|
98
|
+
self.class == o.class &&
|
99
|
+
code == o.code &&
|
100
|
+
status == o.status &&
|
101
|
+
links == o.links
|
102
|
+
end
|
103
|
+
|
104
|
+
# @see the `==` method
|
105
|
+
# @param [Object] Object to be compared
|
106
|
+
def eql?(o)
|
107
|
+
self == o
|
108
|
+
end
|
109
|
+
|
110
|
+
# Calculates hash code according to all attributes.
|
111
|
+
# @return [Fixnum] Hash code
|
112
|
+
def hash
|
113
|
+
[code, status, links].hash
|
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
|
+
if type =~ /\AArray<(.*)>/i
|
123
|
+
# check to ensure the input is an array given that the the attribute
|
124
|
+
# is documented as an array but the input is not
|
125
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
126
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
127
|
+
end
|
128
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
129
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
130
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
131
|
+
end
|
132
|
+
|
133
|
+
self
|
134
|
+
end
|
135
|
+
|
136
|
+
# Deserializes the data based on type
|
137
|
+
# @param string type Data type
|
138
|
+
# @param string value Value to be deserialized
|
139
|
+
# @return [Object] Deserialized data
|
140
|
+
def _deserialize(type, value)
|
141
|
+
case type.to_sym
|
142
|
+
when :DateTime
|
143
|
+
DateTime.parse(value)
|
144
|
+
when :Date
|
145
|
+
Date.parse(value)
|
146
|
+
when :String
|
147
|
+
value.to_s
|
148
|
+
when :Integer
|
149
|
+
value.to_i
|
150
|
+
when :Float
|
151
|
+
value.to_f
|
152
|
+
when :BOOLEAN
|
153
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
154
|
+
true
|
155
|
+
else
|
156
|
+
false
|
157
|
+
end
|
158
|
+
when :Object
|
159
|
+
# generic object (usually a Hash), return directly
|
160
|
+
value
|
161
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
162
|
+
inner_type = Regexp.last_match[:inner_type]
|
163
|
+
value.map { |v| _deserialize(inner_type, v) }
|
164
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
165
|
+
k_type = Regexp.last_match[:k_type]
|
166
|
+
v_type = Regexp.last_match[:v_type]
|
167
|
+
{}.tap do |hash|
|
168
|
+
value.each do |k, v|
|
169
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
else # model
|
173
|
+
temp_model = AsposePdfCloud.const_get(type).new
|
174
|
+
temp_model.build_from_hash(value)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns the string representation of the object
|
179
|
+
# @return [String] String presentation of the object
|
180
|
+
def to_s
|
181
|
+
to_hash.to_s
|
182
|
+
end
|
183
|
+
|
184
|
+
# to_body is an alias to to_hash (backward compatibility)
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
186
|
+
def to_body
|
187
|
+
to_hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the object in the form of hash
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
192
|
+
def to_hash
|
193
|
+
hash = {}
|
194
|
+
self.class.attribute_map.each_pair do |attr, param|
|
195
|
+
value = self.send(attr)
|
196
|
+
next if value.nil?
|
197
|
+
hash[param] = _to_hash(value)
|
198
|
+
end
|
199
|
+
hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Outputs non-array value in the form of hash
|
203
|
+
# For object, use to_hash. Otherwise, just return the value
|
204
|
+
# @param [Object] value Any valid value
|
205
|
+
# @return [Hash] Returns the value in the form of hash
|
206
|
+
def _to_hash(value)
|
207
|
+
if value.is_a?(Array)
|
208
|
+
value.compact.map{ |v| _to_hash(v) }
|
209
|
+
elsif value.is_a?(Hash)
|
210
|
+
{}.tap do |hash|
|
211
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
212
|
+
end
|
213
|
+
elsif value.respond_to? :to_hash
|
214
|
+
value.to_hash
|
215
|
+
else
|
216
|
+
value
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|
221
|
+
|
222
|
+
end
|
@@ -1,200 +1,200 @@
|
|
1
|
-
=begin
|
2
|
-
--------------------------------------------------------------------------------------------------------------------
|
3
|
-
Copyright (c) 2018 Aspose.
|
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 base DTO object.
|
26
|
-
class LinkElement
|
27
|
-
# Link to the document.
|
28
|
-
attr_accessor :links
|
29
|
-
|
30
|
-
|
31
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
32
|
-
def self.attribute_map
|
33
|
-
{
|
34
|
-
:'links' => :'Links'
|
35
|
-
}
|
36
|
-
end
|
37
|
-
|
38
|
-
# Attribute type mapping.
|
39
|
-
def self.swagger_types
|
40
|
-
{
|
41
|
-
:'links' => :'Array<Link>'
|
42
|
-
}
|
43
|
-
end
|
44
|
-
|
45
|
-
# Initializes the object
|
46
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
-
def initialize(attributes = {})
|
48
|
-
return unless attributes.is_a?(Hash)
|
49
|
-
|
50
|
-
# convert string to symbol for hash key
|
51
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
52
|
-
|
53
|
-
if attributes.has_key?(:'Links')
|
54
|
-
if (value = attributes[:'Links']).is_a?(Array)
|
55
|
-
self.links = value
|
56
|
-
end
|
57
|
-
end
|
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
|
-
links == o.links
|
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
|
-
[links].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
|
196
|
-
end
|
197
|
-
|
198
|
-
end
|
199
|
-
|
200
|
-
end
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2018 Aspose.PDF 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 base DTO object.
|
26
|
+
class LinkElement
|
27
|
+
# Link to the document.
|
28
|
+
attr_accessor :links
|
29
|
+
|
30
|
+
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
32
|
+
def self.attribute_map
|
33
|
+
{
|
34
|
+
:'links' => :'Links'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.swagger_types
|
40
|
+
{
|
41
|
+
:'links' => :'Array<Link>'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
return unless attributes.is_a?(Hash)
|
49
|
+
|
50
|
+
# convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
52
|
+
|
53
|
+
if attributes.has_key?(:'Links')
|
54
|
+
if (value = attributes[:'Links']).is_a?(Array)
|
55
|
+
self.links = value
|
56
|
+
end
|
57
|
+
end
|
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
|
+
links == o.links
|
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
|
+
[links].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
|
196
|
+
end
|
197
|
+
|
198
|
+
end
|
199
|
+
|
200
|
+
end
|