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,61 +1,222 @@
|
|
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 DocumentPropertiesResponse
|
27
|
+
# Response status code.
|
28
|
+
attr_accessor :code
|
29
|
+
|
30
|
+
# Response status.
|
31
|
+
attr_accessor :status
|
32
|
+
|
33
|
+
attr_accessor :document_properties
|
34
|
+
|
35
|
+
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
6
37
|
def self.attribute_map
|
7
38
|
{
|
8
|
-
|
9
|
-
#
|
10
|
-
:'document_properties' => :'DocumentProperties',
|
11
|
-
|
12
|
-
#
|
39
|
+
:'code' => :'Code',
|
13
40
|
:'status' => :'Status',
|
14
|
-
|
15
|
-
#
|
16
|
-
:'code' => :'Code'
|
17
|
-
|
41
|
+
:'document_properties' => :'DocumentProperties'
|
18
42
|
}
|
19
43
|
end
|
20
44
|
|
21
|
-
#
|
45
|
+
# Attribute type mapping.
|
22
46
|
def self.swagger_types
|
23
47
|
{
|
24
|
-
:'
|
48
|
+
:'code' => :'HttpStatusCode',
|
25
49
|
:'status' => :'String',
|
26
|
-
:'
|
27
|
-
|
50
|
+
:'document_properties' => :'DocumentProperties'
|
28
51
|
}
|
29
52
|
end
|
30
53
|
|
54
|
+
# Initializes the object
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
31
56
|
def initialize(attributes = {})
|
32
|
-
return
|
57
|
+
return unless attributes.is_a?(Hash)
|
33
58
|
|
34
59
|
# convert string to symbol for hash key
|
35
|
-
attributes = attributes.
|
60
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
36
61
|
|
37
|
-
|
38
|
-
|
39
|
-
self.document_properties = attributes[:'DocumentProperties']
|
62
|
+
if attributes.has_key?(:'Code')
|
63
|
+
self.code = attributes[:'Code']
|
40
64
|
end
|
41
|
-
|
42
|
-
if attributes
|
65
|
+
|
66
|
+
if attributes.has_key?(:'Status')
|
43
67
|
self.status = attributes[:'Status']
|
44
68
|
end
|
45
|
-
|
46
|
-
if attributes
|
47
|
-
self.
|
69
|
+
|
70
|
+
if attributes.has_key?(:'DocumentProperties')
|
71
|
+
self.document_properties = attributes[:'DocumentProperties']
|
48
72
|
end
|
49
|
-
|
73
|
+
|
50
74
|
end
|
51
75
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
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
|
+
document_properties == o.document_properties
|
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, document_properties].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
|
56
217
|
end
|
57
|
-
@status = status
|
58
218
|
end
|
59
219
|
|
60
220
|
end
|
221
|
+
|
61
222
|
end
|
@@ -1,63 +1,227 @@
|
|
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
|
+
# Pdf document property.
|
26
|
+
class DocumentProperty
|
27
|
+
# Link to the document.
|
28
|
+
attr_accessor :links
|
29
|
+
|
30
|
+
attr_accessor :name
|
31
|
+
|
32
|
+
attr_accessor :value
|
33
|
+
|
34
|
+
attr_accessor :built_in
|
35
|
+
|
36
|
+
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
6
38
|
def self.attribute_map
|
7
39
|
{
|
8
|
-
|
9
|
-
#
|
40
|
+
:'links' => :'Links',
|
10
41
|
:'name' => :'Name',
|
11
|
-
|
12
|
-
#
|
13
42
|
:'value' => :'Value',
|
14
|
-
|
15
|
-
#
|
16
|
-
:'built_in' => :'BuiltIn',
|
17
|
-
|
18
|
-
#
|
19
|
-
:'links' => :'Links'
|
20
|
-
|
43
|
+
:'built_in' => :'BuiltIn'
|
21
44
|
}
|
22
45
|
end
|
23
46
|
|
24
|
-
#
|
47
|
+
# Attribute type mapping.
|
25
48
|
def self.swagger_types
|
26
49
|
{
|
50
|
+
:'links' => :'Array<Link>',
|
27
51
|
:'name' => :'String',
|
28
52
|
:'value' => :'String',
|
29
|
-
:'built_in' => :'BOOLEAN'
|
30
|
-
:'links' => :'Array<Link>'
|
31
|
-
|
53
|
+
:'built_in' => :'BOOLEAN'
|
32
54
|
}
|
33
55
|
end
|
34
56
|
|
57
|
+
# Initializes the object
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
59
|
def initialize(attributes = {})
|
36
|
-
return
|
60
|
+
return unless attributes.is_a?(Hash)
|
37
61
|
|
38
62
|
# convert string to symbol for hash key
|
39
|
-
attributes = attributes.
|
63
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
64
|
+
|
65
|
+
if attributes.has_key?(:'Links')
|
66
|
+
if (value = attributes[:'Links']).is_a?(Array)
|
67
|
+
self.links = value
|
68
|
+
end
|
69
|
+
end
|
40
70
|
|
41
|
-
|
42
|
-
if attributes[:'Name']
|
71
|
+
if attributes.has_key?(:'Name')
|
43
72
|
self.name = attributes[:'Name']
|
44
73
|
end
|
45
|
-
|
46
|
-
if attributes
|
74
|
+
|
75
|
+
if attributes.has_key?(:'Value')
|
47
76
|
self.value = attributes[:'Value']
|
48
77
|
end
|
49
|
-
|
50
|
-
if attributes
|
78
|
+
|
79
|
+
if attributes.has_key?(:'BuiltIn')
|
51
80
|
self.built_in = attributes[:'BuiltIn']
|
52
81
|
end
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
86
|
+
# @return Array for valid properies with the reasons
|
87
|
+
def list_invalid_properties
|
88
|
+
invalid_properties = Array.new
|
89
|
+
return invalid_properties
|
90
|
+
end
|
91
|
+
|
92
|
+
# Check to see if the all the properties in the model are valid
|
93
|
+
# @return true if the model is valid
|
94
|
+
def valid?
|
95
|
+
return true
|
96
|
+
end
|
97
|
+
|
98
|
+
# Checks equality by comparing each attribute.
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def ==(o)
|
101
|
+
return true if self.equal?(o)
|
102
|
+
self.class == o.class &&
|
103
|
+
links == o.links &&
|
104
|
+
name == o.name &&
|
105
|
+
value == o.value &&
|
106
|
+
built_in == o.built_in
|
107
|
+
end
|
108
|
+
|
109
|
+
# @see the `==` method
|
110
|
+
# @param [Object] Object to be compared
|
111
|
+
def eql?(o)
|
112
|
+
self == o
|
113
|
+
end
|
114
|
+
|
115
|
+
# Calculates hash code according to all attributes.
|
116
|
+
# @return [Fixnum] Hash code
|
117
|
+
def hash
|
118
|
+
[links, name, value, built_in].hash
|
119
|
+
end
|
120
|
+
|
121
|
+
# Builds the object from hash
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
# @return [Object] Returns the model itself
|
124
|
+
def build_from_hash(attributes)
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
126
|
+
self.class.swagger_types.each_pair do |key, type|
|
127
|
+
if type =~ /\AArray<(.*)>/i
|
128
|
+
# check to ensure the input is an array given that the the attribute
|
129
|
+
# is documented as an array but the input is not
|
130
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
131
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
132
|
+
end
|
133
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
134
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
135
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
136
|
+
end
|
137
|
+
|
138
|
+
self
|
139
|
+
end
|
140
|
+
|
141
|
+
# Deserializes the data based on type
|
142
|
+
# @param string type Data type
|
143
|
+
# @param string value Value to be deserialized
|
144
|
+
# @return [Object] Deserialized data
|
145
|
+
def _deserialize(type, value)
|
146
|
+
case type.to_sym
|
147
|
+
when :DateTime
|
148
|
+
DateTime.parse(value)
|
149
|
+
when :Date
|
150
|
+
Date.parse(value)
|
151
|
+
when :String
|
152
|
+
value.to_s
|
153
|
+
when :Integer
|
154
|
+
value.to_i
|
155
|
+
when :Float
|
156
|
+
value.to_f
|
157
|
+
when :BOOLEAN
|
158
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
159
|
+
true
|
160
|
+
else
|
161
|
+
false
|
162
|
+
end
|
163
|
+
when :Object
|
164
|
+
# generic object (usually a Hash), return directly
|
165
|
+
value
|
166
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
167
|
+
inner_type = Regexp.last_match[:inner_type]
|
168
|
+
value.map { |v| _deserialize(inner_type, v) }
|
169
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
170
|
+
k_type = Regexp.last_match[:k_type]
|
171
|
+
v_type = Regexp.last_match[:v_type]
|
172
|
+
{}.tap do |hash|
|
173
|
+
value.each do |k, v|
|
174
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
175
|
+
end
|
57
176
|
end
|
177
|
+
else # model
|
178
|
+
temp_model = AsposePdfCloud.const_get(type).new
|
179
|
+
temp_model.build_from_hash(value)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the string representation of the object
|
184
|
+
# @return [String] String presentation of the object
|
185
|
+
def to_s
|
186
|
+
to_hash.to_s
|
187
|
+
end
|
188
|
+
|
189
|
+
# to_body is an alias to to_hash (backward compatibility)
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_body
|
192
|
+
to_hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the object in the form of hash
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_hash
|
198
|
+
hash = {}
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
200
|
+
value = self.send(attr)
|
201
|
+
next if value.nil?
|
202
|
+
hash[param] = _to_hash(value)
|
203
|
+
end
|
204
|
+
hash
|
205
|
+
end
|
206
|
+
|
207
|
+
# Outputs non-array value in the form of hash
|
208
|
+
# For object, use to_hash. Otherwise, just return the value
|
209
|
+
# @param [Object] value Any valid value
|
210
|
+
# @return [Hash] Returns the value in the form of hash
|
211
|
+
def _to_hash(value)
|
212
|
+
if value.is_a?(Array)
|
213
|
+
value.compact.map{ |v| _to_hash(v) }
|
214
|
+
elsif value.is_a?(Hash)
|
215
|
+
{}.tap do |hash|
|
216
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
217
|
+
end
|
218
|
+
elsif value.respond_to? :to_hash
|
219
|
+
value.to_hash
|
220
|
+
else
|
221
|
+
value
|
58
222
|
end
|
59
|
-
|
60
223
|
end
|
61
224
|
|
62
225
|
end
|
226
|
+
|
63
227
|
end
|