aspose_pdf_cloud 18.7.0 → 18.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/aspose_pdf_cloud.gemspec +53 -49
  3. data/lib/aspose_pdf_cloud.rb +150 -145
  4. data/lib/aspose_pdf_cloud/api/pdf_api.rb +12907 -11705
  5. data/lib/aspose_pdf_cloud/api_client.rb +2 -2
  6. data/lib/aspose_pdf_cloud/api_error.rb +47 -47
  7. data/lib/aspose_pdf_cloud/configuration.rb +175 -185
  8. data/lib/aspose_pdf_cloud/models/annotation.rb +332 -260
  9. data/lib/aspose_pdf_cloud/models/annotation_flags.rb +52 -0
  10. data/lib/aspose_pdf_cloud/models/annotation_info.rb +342 -0
  11. data/lib/aspose_pdf_cloud/models/annotation_state.rb +49 -0
  12. data/lib/aspose_pdf_cloud/models/annotation_type.rb +69 -0
  13. data/lib/aspose_pdf_cloud/models/{annotations.rb → annotations_info.rb} +211 -211
  14. data/lib/aspose_pdf_cloud/models/{annotations_response.rb → annotations_info_response.rb} +222 -222
  15. data/lib/aspose_pdf_cloud/models/antialiasing_processing_type.rb +43 -43
  16. data/lib/aspose_pdf_cloud/models/append_document.rb +233 -228
  17. data/lib/aspose_pdf_cloud/models/{saa_spose_response.rb → aspose_response.rb} +213 -213
  18. data/lib/aspose_pdf_cloud/models/attachment.rb +270 -270
  19. data/lib/aspose_pdf_cloud/models/attachment_response.rb +222 -222
  20. data/lib/aspose_pdf_cloud/models/attachments.rb +211 -211
  21. data/lib/aspose_pdf_cloud/models/attachments_response.rb +222 -222
  22. data/lib/aspose_pdf_cloud/models/color.rb +244 -244
  23. data/lib/aspose_pdf_cloud/models/color_depth.rb +45 -45
  24. data/lib/aspose_pdf_cloud/models/compression_type.rb +46 -46
  25. data/lib/aspose_pdf_cloud/models/doc_format.rb +43 -43
  26. data/lib/aspose_pdf_cloud/models/doc_recognition_mode.rb +43 -43
  27. data/lib/aspose_pdf_cloud/models/document.rb +220 -220
  28. data/lib/aspose_pdf_cloud/models/{text_item_response.rb → document_page_response.rb} +222 -222
  29. data/lib/aspose_pdf_cloud/models/document_pages_response.rb +222 -222
  30. data/lib/aspose_pdf_cloud/models/document_privilege.rb +298 -298
  31. data/lib/aspose_pdf_cloud/models/document_properties.rb +211 -211
  32. data/lib/aspose_pdf_cloud/models/document_properties_response.rb +222 -222
  33. data/lib/aspose_pdf_cloud/models/document_property.rb +227 -227
  34. data/lib/aspose_pdf_cloud/models/document_property_response.rb +222 -222
  35. data/lib/aspose_pdf_cloud/models/document_response.rb +233 -233
  36. data/lib/aspose_pdf_cloud/models/epub_recognition_mode.rb +44 -44
  37. data/lib/aspose_pdf_cloud/models/field.rb +254 -254
  38. data/lib/aspose_pdf_cloud/models/field_response.rb +222 -222
  39. data/lib/aspose_pdf_cloud/models/field_type.rb +45 -44
  40. data/lib/aspose_pdf_cloud/models/fields.rb +211 -211
  41. data/lib/aspose_pdf_cloud/models/fields_response.rb +222 -222
  42. data/lib/aspose_pdf_cloud/models/font_encoding_rules.rb +43 -43
  43. data/lib/aspose_pdf_cloud/models/font_saving_modes.rb +45 -45
  44. data/lib/aspose_pdf_cloud/models/font_styles.rb +45 -43
  45. data/lib/aspose_pdf_cloud/models/free_text_annotation.rb +382 -0
  46. data/lib/aspose_pdf_cloud/models/{annotation_response.rb → free_text_annotation_response.rb} +222 -222
  47. data/lib/aspose_pdf_cloud/models/{text_items.rb → free_text_annotations.rb} +211 -211
  48. data/lib/aspose_pdf_cloud/models/{text_items_response.rb → free_text_annotations_response.rb} +222 -222
  49. data/lib/aspose_pdf_cloud/models/free_text_intent.rb +44 -0
  50. data/lib/aspose_pdf_cloud/models/horizontal_alignment.rb +45 -44
  51. data/lib/aspose_pdf_cloud/models/html_document_type.rb +43 -43
  52. data/lib/aspose_pdf_cloud/models/html_markup_generation_modes.rb +43 -43
  53. data/lib/aspose_pdf_cloud/models/image.rb +250 -220
  54. data/lib/aspose_pdf_cloud/models/image_response.rb +222 -222
  55. data/lib/aspose_pdf_cloud/models/image_src_type.rb +43 -43
  56. data/lib/aspose_pdf_cloud/models/image_template.rb +281 -281
  57. data/lib/aspose_pdf_cloud/models/image_templates_request.rb +230 -230
  58. data/lib/aspose_pdf_cloud/models/images.rb +211 -211
  59. data/lib/aspose_pdf_cloud/models/images_response.rb +222 -222
  60. data/lib/aspose_pdf_cloud/models/justification.rb +44 -0
  61. data/lib/aspose_pdf_cloud/models/letters_positioning_methods.rb +43 -43
  62. data/lib/aspose_pdf_cloud/models/line_spacing.rb +43 -43
  63. data/lib/aspose_pdf_cloud/models/link.rb +228 -228
  64. data/lib/aspose_pdf_cloud/models/link_action_type.rb +47 -46
  65. data/lib/aspose_pdf_cloud/models/link_annotation.rb +254 -236
  66. data/lib/aspose_pdf_cloud/models/link_annotation_response.rb +222 -222
  67. data/lib/aspose_pdf_cloud/models/link_annotations.rb +211 -211
  68. data/lib/aspose_pdf_cloud/models/link_annotations_response.rb +222 -222
  69. data/lib/aspose_pdf_cloud/models/link_element.rb +200 -200
  70. data/lib/aspose_pdf_cloud/models/link_highlighting_mode.rb +46 -45
  71. data/lib/aspose_pdf_cloud/models/margin_info.rb +244 -244
  72. data/lib/aspose_pdf_cloud/models/markup_annotation.rb +342 -0
  73. data/lib/aspose_pdf_cloud/models/merge_documents.rb +205 -200
  74. data/lib/aspose_pdf_cloud/models/optimize_options.rb +293 -293
  75. data/lib/aspose_pdf_cloud/models/page.rb +228 -228
  76. data/lib/aspose_pdf_cloud/models/page_word_count.rb +218 -218
  77. data/lib/aspose_pdf_cloud/models/pages.rb +211 -211
  78. data/lib/aspose_pdf_cloud/models/paragraph.rb +303 -303
  79. data/lib/aspose_pdf_cloud/models/parts_embedding_modes.rb +44 -44
  80. data/lib/aspose_pdf_cloud/models/pdf_a_type.rb +43 -43
  81. data/lib/aspose_pdf_cloud/models/raster_images_saving_modes.rb +44 -44
  82. data/lib/aspose_pdf_cloud/models/{document_text_replace_response.rb → rectangle_pdf.rb} +244 -231
  83. data/lib/aspose_pdf_cloud/models/rotation.rb +45 -44
  84. data/lib/aspose_pdf_cloud/models/segment.rb +211 -206
  85. data/lib/aspose_pdf_cloud/models/shape_type.rb +44 -44
  86. data/lib/aspose_pdf_cloud/models/signature.rb +338 -333
  87. data/lib/aspose_pdf_cloud/models/signature_type.rb +44 -42
  88. data/lib/aspose_pdf_cloud/models/signature_verify_response.rb +223 -223
  89. data/lib/aspose_pdf_cloud/models/split_result.rb +200 -200
  90. data/lib/aspose_pdf_cloud/models/split_result_document.rb +238 -238
  91. data/lib/aspose_pdf_cloud/models/split_result_response.rb +223 -223
  92. data/lib/aspose_pdf_cloud/models/stamp.rb +413 -413
  93. data/lib/aspose_pdf_cloud/models/stamp_type.rb +45 -44
  94. data/lib/aspose_pdf_cloud/models/{tiff_export_options.rb → text_annotation.rb} +382 -348
  95. data/lib/aspose_pdf_cloud/models/text_annotation_response.rb +222 -0
  96. data/lib/aspose_pdf_cloud/models/{text_item.rb → text_annotations.rb} +211 -218
  97. data/lib/aspose_pdf_cloud/models/text_annotations_response.rb +222 -0
  98. data/lib/aspose_pdf_cloud/models/text_horizontal_alignment.rb +47 -47
  99. data/lib/aspose_pdf_cloud/models/text_icon.rb +52 -0
  100. data/lib/aspose_pdf_cloud/models/text_line.rb +215 -210
  101. data/lib/aspose_pdf_cloud/models/text_rect.rb +220 -220
  102. data/lib/aspose_pdf_cloud/models/text_rects.rb +199 -199
  103. data/lib/aspose_pdf_cloud/models/text_rects_response.rb +222 -222
  104. data/lib/aspose_pdf_cloud/models/text_replace.rb +253 -253
  105. data/lib/aspose_pdf_cloud/models/text_replace_list_request.rb +232 -232
  106. data/lib/aspose_pdf_cloud/models/text_replace_response.rb +222 -222
  107. data/lib/aspose_pdf_cloud/models/text_state.rb +248 -248
  108. data/lib/aspose_pdf_cloud/models/{text_format.rb → text_style.rb} +233 -227
  109. data/lib/aspose_pdf_cloud/models/vertical_alignment.rb +45 -45
  110. data/lib/aspose_pdf_cloud/models/word_count.rb +199 -199
  111. data/lib/aspose_pdf_cloud/models/word_count_response.rb +223 -223
  112. data/lib/aspose_pdf_cloud/models/wrap_mode.rb +44 -44
  113. data/lib/aspose_pdf_cloud/version.rb +24 -24
  114. data/test/pdf_tests.rb +1496 -1325
  115. data/test_data/TexExample.tex +304 -304
  116. metadata +24 -21
  117. data/.gitignore +0 -46
  118. data/.swagger-codegen-ignore +0 -58
  119. data/lib/aspose_pdf_cloud/models/http_status_code.rb +0 -87
  120. data/lib/aspose_pdf_cloud/models/images_list_request.rb +0 -205
  121. data/lib/aspose_pdf_cloud/models/page_text_replace_response.rb +0 -231
  122. data/lib/aspose_pdf_cloud/models/rectangle.rb +0 -244
  123. data/lib/aspose_pdf_cloud/models/text_format_response.rb +0 -222
  124. data/lib/aspose_pdf_cloud/models/text_replace_request.rb +0 -262
@@ -1,260 +1,332 @@
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
- # Provides annotation.
26
- class Annotation
27
- # Link to the document.
28
- attr_accessor :links
29
-
30
- # Get the annotation color.
31
- attr_accessor :color
32
-
33
- # Get the annotation content.
34
- attr_accessor :contents
35
-
36
- # The date and time when the annotation was created.
37
- attr_accessor :creation_date
38
-
39
- # Get the annotation subject.
40
- attr_accessor :subject
41
-
42
- # Get the annotation title.
43
- attr_accessor :title
44
-
45
- # The date and time when the annotation was last modified.
46
- attr_accessor :modified
47
-
48
-
49
- # Attribute mapping from ruby-style variable name to JSON key.
50
- def self.attribute_map
51
- {
52
- :'links' => :'Links',
53
- :'color' => :'Color',
54
- :'contents' => :'Contents',
55
- :'creation_date' => :'CreationDate',
56
- :'subject' => :'Subject',
57
- :'title' => :'Title',
58
- :'modified' => :'Modified'
59
- }
60
- end
61
-
62
- # Attribute type mapping.
63
- def self.swagger_types
64
- {
65
- :'links' => :'Array<Link>',
66
- :'color' => :'Color',
67
- :'contents' => :'String',
68
- :'creation_date' => :'String',
69
- :'subject' => :'String',
70
- :'title' => :'String',
71
- :'modified' => :'String'
72
- }
73
- end
74
-
75
- # Initializes the object
76
- # @param [Hash] attributes Model attributes in the form of hash
77
- def initialize(attributes = {})
78
- return unless attributes.is_a?(Hash)
79
-
80
- # convert string to symbol for hash key
81
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
82
-
83
- if attributes.has_key?(:'Links')
84
- if (value = attributes[:'Links']).is_a?(Array)
85
- self.links = value
86
- end
87
- end
88
-
89
- if attributes.has_key?(:'Color')
90
- self.color = attributes[:'Color']
91
- end
92
-
93
- if attributes.has_key?(:'Contents')
94
- self.contents = attributes[:'Contents']
95
- end
96
-
97
- if attributes.has_key?(:'CreationDate')
98
- self.creation_date = attributes[:'CreationDate']
99
- end
100
-
101
- if attributes.has_key?(:'Subject')
102
- self.subject = attributes[:'Subject']
103
- end
104
-
105
- if attributes.has_key?(:'Title')
106
- self.title = attributes[:'Title']
107
- end
108
-
109
- if attributes.has_key?(:'Modified')
110
- self.modified = attributes[:'Modified']
111
- end
112
-
113
- end
114
-
115
- # Show invalid properties with the reasons. Usually used together with valid?
116
- # @return Array for valid properies with the reasons
117
- def list_invalid_properties
118
- invalid_properties = Array.new
119
- return invalid_properties
120
- end
121
-
122
- # Check to see if the all the properties in the model are valid
123
- # @return true if the model is valid
124
- def valid?
125
- return true
126
- end
127
-
128
- # Checks equality by comparing each attribute.
129
- # @param [Object] Object to be compared
130
- def ==(o)
131
- return true if self.equal?(o)
132
- self.class == o.class &&
133
- links == o.links &&
134
- color == o.color &&
135
- contents == o.contents &&
136
- creation_date == o.creation_date &&
137
- subject == o.subject &&
138
- title == o.title &&
139
- modified == o.modified
140
- end
141
-
142
- # @see the `==` method
143
- # @param [Object] Object to be compared
144
- def eql?(o)
145
- self == o
146
- end
147
-
148
- # Calculates hash code according to all attributes.
149
- # @return [Fixnum] Hash code
150
- def hash
151
- [links, color, contents, creation_date, subject, title, modified].hash
152
- end
153
-
154
- # Builds the object from hash
155
- # @param [Hash] attributes Model attributes in the form of hash
156
- # @return [Object] Returns the model itself
157
- def build_from_hash(attributes)
158
- return nil unless attributes.is_a?(Hash)
159
- self.class.swagger_types.each_pair do |key, type|
160
- if type =~ /\AArray<(.*)>/i
161
- # check to ensure the input is an array given that the the attribute
162
- # is documented as an array but the input is not
163
- if attributes[self.class.attribute_map[key]].is_a?(Array)
164
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
165
- end
166
- elsif !attributes[self.class.attribute_map[key]].nil?
167
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
168
- end # or else data not found in attributes(hash), not an issue as the data can be optional
169
- end
170
-
171
- self
172
- end
173
-
174
- # Deserializes the data based on type
175
- # @param string type Data type
176
- # @param string value Value to be deserialized
177
- # @return [Object] Deserialized data
178
- def _deserialize(type, value)
179
- case type.to_sym
180
- when :DateTime
181
- DateTime.parse(value)
182
- when :Date
183
- Date.parse(value)
184
- when :String
185
- value.to_s
186
- when :Integer
187
- value.to_i
188
- when :Float
189
- value.to_f
190
- when :BOOLEAN
191
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
- true
193
- else
194
- false
195
- end
196
- when :Object
197
- # generic object (usually a Hash), return directly
198
- value
199
- when /\AArray<(?<inner_type>.+)>\z/
200
- inner_type = Regexp.last_match[:inner_type]
201
- value.map { |v| _deserialize(inner_type, v) }
202
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
- k_type = Regexp.last_match[:k_type]
204
- v_type = Regexp.last_match[:v_type]
205
- {}.tap do |hash|
206
- value.each do |k, v|
207
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
- end
209
- end
210
- else # model
211
- temp_model = AsposePdfCloud.const_get(type).new
212
- temp_model.build_from_hash(value)
213
- end
214
- end
215
-
216
- # Returns the string representation of the object
217
- # @return [String] String presentation of the object
218
- def to_s
219
- to_hash.to_s
220
- end
221
-
222
- # to_body is an alias to to_hash (backward compatibility)
223
- # @return [Hash] Returns the object in the form of hash
224
- def to_body
225
- to_hash
226
- end
227
-
228
- # Returns the object in the form of hash
229
- # @return [Hash] Returns the object in the form of hash
230
- def to_hash
231
- hash = {}
232
- self.class.attribute_map.each_pair do |attr, param|
233
- value = self.send(attr)
234
- next if value.nil?
235
- hash[param] = _to_hash(value)
236
- end
237
- hash
238
- end
239
-
240
- # Outputs non-array value in the form of hash
241
- # For object, use to_hash. Otherwise, just return the value
242
- # @param [Object] value Any valid value
243
- # @return [Hash] Returns the value in the form of hash
244
- def _to_hash(value)
245
- if value.is_a?(Array)
246
- value.compact.map{ |v| _to_hash(v) }
247
- elsif value.is_a?(Hash)
248
- {}.tap do |hash|
249
- value.each { |k, v| hash[k] = _to_hash(v) }
250
- end
251
- elsif value.respond_to? :to_hash
252
- value.to_hash
253
- else
254
- value
255
- end
256
- end
257
-
258
- end
259
-
260
- 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
+ # Provides annotation.
26
+ class Annotation
27
+ # Link to the document.
28
+ attr_accessor :links
29
+
30
+ # Get the annotation content.
31
+ attr_accessor :contents
32
+
33
+ # The date and time when the annotation was created.
34
+ attr_accessor :creation_date
35
+
36
+ # Get the annotation subject.
37
+ attr_accessor :subject
38
+
39
+ # Get the annotation title.
40
+ attr_accessor :title
41
+
42
+ # The date and time when the annotation was last modified.
43
+ attr_accessor :modified
44
+
45
+ # Gets ID of the annotation.
46
+ attr_accessor :id
47
+
48
+ # Gets Flags of the annotation.
49
+ attr_accessor :flags
50
+
51
+ # Gets Name of the annotation.
52
+ attr_accessor :name
53
+
54
+ # Gets Rect of the annotation.
55
+ attr_accessor :rect
56
+
57
+ # Gets PageIndex of the annotation.
58
+ attr_accessor :page_index
59
+
60
+ # Gets ZIndex of the annotation.
61
+ attr_accessor :z_index
62
+
63
+ # Gets HorizontalAlignment of the annotation.
64
+ attr_accessor :horizontal_alignment
65
+
66
+ # Gets VerticalAlignment of the annotation.
67
+ attr_accessor :vertical_alignment
68
+
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ :'links' => :'Links',
74
+ :'contents' => :'Contents',
75
+ :'creation_date' => :'CreationDate',
76
+ :'subject' => :'Subject',
77
+ :'title' => :'Title',
78
+ :'modified' => :'Modified',
79
+ :'id' => :'Id',
80
+ :'flags' => :'Flags',
81
+ :'name' => :'Name',
82
+ :'rect' => :'Rect',
83
+ :'page_index' => :'PageIndex',
84
+ :'z_index' => :'ZIndex',
85
+ :'horizontal_alignment' => :'HorizontalAlignment',
86
+ :'vertical_alignment' => :'VerticalAlignment'
87
+ }
88
+ end
89
+
90
+ # Attribute type mapping.
91
+ def self.swagger_types
92
+ {
93
+ :'links' => :'Array<Link>',
94
+ :'contents' => :'String',
95
+ :'creation_date' => :'String',
96
+ :'subject' => :'String',
97
+ :'title' => :'String',
98
+ :'modified' => :'String',
99
+ :'id' => :'String',
100
+ :'flags' => :'Array<AnnotationFlags>',
101
+ :'name' => :'String',
102
+ :'rect' => :'RectanglePdf',
103
+ :'page_index' => :'Integer',
104
+ :'z_index' => :'Integer',
105
+ :'horizontal_alignment' => :'HorizontalAlignment',
106
+ :'vertical_alignment' => :'VerticalAlignment'
107
+ }
108
+ end
109
+
110
+ # Initializes the object
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ def initialize(attributes = {})
113
+ return unless attributes.is_a?(Hash)
114
+
115
+ # convert string to symbol for hash key
116
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
117
+
118
+ if attributes.has_key?(:'Links')
119
+ if (value = attributes[:'Links']).is_a?(Array)
120
+ self.links = value
121
+ end
122
+ end
123
+
124
+ if attributes.has_key?(:'Contents')
125
+ self.contents = attributes[:'Contents']
126
+ end
127
+
128
+ if attributes.has_key?(:'CreationDate')
129
+ self.creation_date = attributes[:'CreationDate']
130
+ end
131
+
132
+ if attributes.has_key?(:'Subject')
133
+ self.subject = attributes[:'Subject']
134
+ end
135
+
136
+ if attributes.has_key?(:'Title')
137
+ self.title = attributes[:'Title']
138
+ end
139
+
140
+ if attributes.has_key?(:'Modified')
141
+ self.modified = attributes[:'Modified']
142
+ end
143
+
144
+ if attributes.has_key?(:'Id')
145
+ self.id = attributes[:'Id']
146
+ end
147
+
148
+ if attributes.has_key?(:'Flags')
149
+ if (value = attributes[:'Flags']).is_a?(Array)
150
+ self.flags = value
151
+ end
152
+ end
153
+
154
+ if attributes.has_key?(:'Name')
155
+ self.name = attributes[:'Name']
156
+ end
157
+
158
+ if attributes.has_key?(:'Rect')
159
+ self.rect = attributes[:'Rect']
160
+ end
161
+
162
+ if attributes.has_key?(:'PageIndex')
163
+ self.page_index = attributes[:'PageIndex']
164
+ end
165
+
166
+ if attributes.has_key?(:'ZIndex')
167
+ self.z_index = attributes[:'ZIndex']
168
+ end
169
+
170
+ if attributes.has_key?(:'HorizontalAlignment')
171
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
172
+ end
173
+
174
+ if attributes.has_key?(:'VerticalAlignment')
175
+ self.vertical_alignment = attributes[:'VerticalAlignment']
176
+ end
177
+
178
+ end
179
+
180
+ # Show invalid properties with the reasons. Usually used together with valid?
181
+ # @return Array for valid properies with the reasons
182
+ def list_invalid_properties
183
+ invalid_properties = Array.new
184
+ return invalid_properties
185
+ end
186
+
187
+ # Check to see if the all the properties in the model are valid
188
+ # @return true if the model is valid
189
+ def valid?
190
+ return true
191
+ end
192
+
193
+ # Checks equality by comparing each attribute.
194
+ # @param [Object] Object to be compared
195
+ def ==(o)
196
+ return true if self.equal?(o)
197
+ self.class == o.class &&
198
+ links == o.links &&
199
+ contents == o.contents &&
200
+ creation_date == o.creation_date &&
201
+ subject == o.subject &&
202
+ title == o.title &&
203
+ modified == o.modified &&
204
+ id == o.id &&
205
+ flags == o.flags &&
206
+ name == o.name &&
207
+ rect == o.rect &&
208
+ page_index == o.page_index &&
209
+ z_index == o.z_index &&
210
+ horizontal_alignment == o.horizontal_alignment &&
211
+ vertical_alignment == o.vertical_alignment
212
+ end
213
+
214
+ # @see the `==` method
215
+ # @param [Object] Object to be compared
216
+ def eql?(o)
217
+ self == o
218
+ end
219
+
220
+ # Calculates hash code according to all attributes.
221
+ # @return [Fixnum] Hash code
222
+ def hash
223
+ [links, contents, creation_date, subject, title, modified, id, flags, name, rect, page_index, z_index, horizontal_alignment, vertical_alignment].hash
224
+ end
225
+
226
+ # Builds the object from hash
227
+ # @param [Hash] attributes Model attributes in the form of hash
228
+ # @return [Object] Returns the model itself
229
+ def build_from_hash(attributes)
230
+ return nil unless attributes.is_a?(Hash)
231
+ self.class.swagger_types.each_pair do |key, type|
232
+ if type =~ /\AArray<(.*)>/i
233
+ # check to ensure the input is an array given that the the attribute
234
+ # is documented as an array but the input is not
235
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
236
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
237
+ end
238
+ elsif !attributes[self.class.attribute_map[key]].nil?
239
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
240
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
241
+ end
242
+
243
+ self
244
+ end
245
+
246
+ # Deserializes the data based on type
247
+ # @param string type Data type
248
+ # @param string value Value to be deserialized
249
+ # @return [Object] Deserialized data
250
+ def _deserialize(type, value)
251
+ case type.to_sym
252
+ when :DateTime
253
+ DateTime.parse(value)
254
+ when :Date
255
+ Date.parse(value)
256
+ when :String
257
+ value.to_s
258
+ when :Integer
259
+ value.to_i
260
+ when :Float
261
+ value.to_f
262
+ when :BOOLEAN
263
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
264
+ true
265
+ else
266
+ false
267
+ end
268
+ when :Object
269
+ # generic object (usually a Hash), return directly
270
+ value
271
+ when /\AArray<(?<inner_type>.+)>\z/
272
+ inner_type = Regexp.last_match[:inner_type]
273
+ value.map { |v| _deserialize(inner_type, v) }
274
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
275
+ k_type = Regexp.last_match[:k_type]
276
+ v_type = Regexp.last_match[:v_type]
277
+ {}.tap do |hash|
278
+ value.each do |k, v|
279
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
280
+ end
281
+ end
282
+ else # model
283
+ temp_model = AsposePdfCloud.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