aspose_pdf_cloud 18.10.0 → 18.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +75 -6
  3. data/docs/Annotation.md +0 -3
  4. data/docs/AnnotationInfo.md +0 -3
  5. data/docs/CapStyle.md +11 -0
  6. data/docs/CaretAnnotation.md +26 -0
  7. data/docs/CaretAnnotationResponse.md +11 -0
  8. data/docs/CaretAnnotations.md +10 -0
  9. data/docs/CaretAnnotationsResponse.md +11 -0
  10. data/docs/CaretSymbol.md +11 -0
  11. data/docs/CircleAnnotation.md +3 -3
  12. data/docs/CommonFigureAnnotation.md +3 -3
  13. data/docs/File.md +13 -0
  14. data/docs/FilesResponse.md +11 -0
  15. data/docs/FreeTextAnnotation.md +3 -3
  16. data/docs/HighlightAnnotation.md +25 -0
  17. data/docs/HighlightAnnotationResponse.md +11 -0
  18. data/docs/HighlightAnnotations.md +10 -0
  19. data/docs/HighlightAnnotationsResponse.md +11 -0
  20. data/docs/InkAnnotation.md +26 -0
  21. data/docs/InkAnnotationResponse.md +11 -0
  22. data/docs/InkAnnotations.md +10 -0
  23. data/docs/InkAnnotationsResponse.md +11 -0
  24. data/docs/LineAnnotation.md +3 -3
  25. data/docs/MarkupAnnotation.md +3 -3
  26. data/docs/PdfApi.md +1036 -69
  27. data/docs/PolyAnnotation.md +3 -3
  28. data/docs/PolyLineAnnotation.md +3 -3
  29. data/docs/PolygonAnnotation.md +3 -3
  30. data/docs/PopupAnnotation.md +21 -0
  31. data/docs/PopupAnnotationResponse.md +11 -0
  32. data/docs/PopupAnnotationWithParent.md +22 -0
  33. data/docs/PopupAnnotations.md +10 -0
  34. data/docs/PopupAnnotationsResponse.md +11 -0
  35. data/docs/SquareAnnotation.md +3 -3
  36. data/docs/SquigglyAnnotation.md +25 -0
  37. data/docs/SquigglyAnnotationResponse.md +11 -0
  38. data/docs/SquigglyAnnotations.md +10 -0
  39. data/docs/SquigglyAnnotationsResponse.md +11 -0
  40. data/docs/StrikeOutAnnotation.md +25 -0
  41. data/docs/StrikeOutAnnotationResponse.md +11 -0
  42. data/docs/StrikeOutAnnotations.md +10 -0
  43. data/docs/StrikeOutAnnotationsResponse.md +11 -0
  44. data/docs/TextAnnotation.md +3 -3
  45. data/docs/UnderlineAnnotation.md +25 -0
  46. data/docs/UnderlineAnnotationResponse.md +11 -0
  47. data/docs/UnderlineAnnotations.md +10 -0
  48. data/docs/UnderlineAnnotationsResponse.md +11 -0
  49. data/lib/aspose_pdf_cloud.rb +33 -0
  50. data/lib/aspose_pdf_cloud/api/pdf_api.rb +4978 -2084
  51. data/lib/aspose_pdf_cloud/models/annotation.rb +6 -33
  52. data/lib/aspose_pdf_cloud/models/annotation_flags.rb +1 -0
  53. data/lib/aspose_pdf_cloud/models/annotation_info.rb +6 -33
  54. data/lib/aspose_pdf_cloud/models/annotation_state.rb +1 -0
  55. data/lib/aspose_pdf_cloud/models/annotation_type.rb +1 -0
  56. data/lib/aspose_pdf_cloud/models/annotations_info.rb +5 -2
  57. data/lib/aspose_pdf_cloud/models/annotations_info_response.rb +5 -2
  58. data/lib/aspose_pdf_cloud/models/antialiasing_processing_type.rb +1 -0
  59. data/lib/aspose_pdf_cloud/models/append_document.rb +5 -2
  60. data/lib/aspose_pdf_cloud/models/aspose_response.rb +5 -2
  61. data/lib/aspose_pdf_cloud/models/attachment.rb +5 -2
  62. data/lib/aspose_pdf_cloud/models/attachment_response.rb +5 -2
  63. data/lib/aspose_pdf_cloud/models/attachments.rb +5 -2
  64. data/lib/aspose_pdf_cloud/models/attachments_response.rb +5 -2
  65. data/lib/aspose_pdf_cloud/models/cap_style.rb +44 -0
  66. data/lib/aspose_pdf_cloud/models/caption_position.rb +1 -0
  67. data/lib/aspose_pdf_cloud/models/caret_annotation.rb +375 -0
  68. data/lib/aspose_pdf_cloud/models/caret_annotation_response.rb +225 -0
  69. data/lib/aspose_pdf_cloud/models/caret_annotations.rb +214 -0
  70. data/lib/aspose_pdf_cloud/models/caret_annotations_response.rb +225 -0
  71. data/lib/aspose_pdf_cloud/models/caret_symbol.rb +44 -0
  72. data/lib/aspose_pdf_cloud/models/circle_annotation.rb +36 -33
  73. data/lib/aspose_pdf_cloud/models/circle_annotation_response.rb +5 -2
  74. data/lib/aspose_pdf_cloud/models/circle_annotations.rb +5 -2
  75. data/lib/aspose_pdf_cloud/models/circle_annotations_response.rb +5 -2
  76. data/lib/aspose_pdf_cloud/models/color.rb +5 -2
  77. data/lib/aspose_pdf_cloud/models/color_depth.rb +1 -0
  78. data/lib/aspose_pdf_cloud/models/common_figure_annotation.rb +36 -33
  79. data/lib/aspose_pdf_cloud/models/compression_type.rb +1 -0
  80. data/lib/aspose_pdf_cloud/models/doc_format.rb +1 -0
  81. data/lib/aspose_pdf_cloud/models/doc_recognition_mode.rb +1 -0
  82. data/lib/aspose_pdf_cloud/models/document.rb +5 -2
  83. data/lib/aspose_pdf_cloud/models/document_page_response.rb +5 -2
  84. data/lib/aspose_pdf_cloud/models/document_pages_response.rb +5 -2
  85. data/lib/aspose_pdf_cloud/models/document_privilege.rb +5 -2
  86. data/lib/aspose_pdf_cloud/models/document_properties.rb +5 -2
  87. data/lib/aspose_pdf_cloud/models/document_properties_response.rb +5 -2
  88. data/lib/aspose_pdf_cloud/models/document_property.rb +5 -2
  89. data/lib/aspose_pdf_cloud/models/document_property_response.rb +5 -2
  90. data/lib/aspose_pdf_cloud/models/document_response.rb +5 -2
  91. data/lib/aspose_pdf_cloud/models/epub_recognition_mode.rb +1 -0
  92. data/lib/aspose_pdf_cloud/models/field.rb +5 -2
  93. data/lib/aspose_pdf_cloud/models/field_response.rb +5 -2
  94. data/lib/aspose_pdf_cloud/models/field_type.rb +1 -0
  95. data/lib/aspose_pdf_cloud/models/fields.rb +5 -2
  96. data/lib/aspose_pdf_cloud/models/fields_response.rb +5 -2
  97. data/lib/aspose_pdf_cloud/models/file.rb +246 -0
  98. data/lib/aspose_pdf_cloud/models/files_response.rb +227 -0
  99. data/lib/aspose_pdf_cloud/models/font_encoding_rules.rb +1 -0
  100. data/lib/aspose_pdf_cloud/models/font_saving_modes.rb +1 -0
  101. data/lib/aspose_pdf_cloud/models/font_styles.rb +1 -0
  102. data/lib/aspose_pdf_cloud/models/free_text_annotation.rb +36 -33
  103. data/lib/aspose_pdf_cloud/models/free_text_annotation_response.rb +5 -2
  104. data/lib/aspose_pdf_cloud/models/free_text_annotations.rb +5 -2
  105. data/lib/aspose_pdf_cloud/models/free_text_annotations_response.rb +5 -2
  106. data/lib/aspose_pdf_cloud/models/free_text_intent.rb +1 -0
  107. data/lib/aspose_pdf_cloud/models/highlight_annotation.rb +367 -0
  108. data/lib/aspose_pdf_cloud/models/highlight_annotation_response.rb +225 -0
  109. data/lib/aspose_pdf_cloud/models/highlight_annotations.rb +214 -0
  110. data/lib/aspose_pdf_cloud/models/highlight_annotations_response.rb +225 -0
  111. data/lib/aspose_pdf_cloud/models/horizontal_alignment.rb +1 -0
  112. data/lib/aspose_pdf_cloud/models/html_document_type.rb +1 -0
  113. data/lib/aspose_pdf_cloud/models/html_markup_generation_modes.rb +1 -0
  114. data/lib/aspose_pdf_cloud/models/image.rb +5 -2
  115. data/lib/aspose_pdf_cloud/models/image_response.rb +5 -2
  116. data/lib/aspose_pdf_cloud/models/image_src_type.rb +1 -0
  117. data/lib/aspose_pdf_cloud/models/image_template.rb +5 -2
  118. data/lib/aspose_pdf_cloud/models/image_templates_request.rb +5 -2
  119. data/lib/aspose_pdf_cloud/models/images.rb +5 -2
  120. data/lib/aspose_pdf_cloud/models/images_response.rb +5 -2
  121. data/lib/aspose_pdf_cloud/models/ink_annotation.rb +377 -0
  122. data/lib/aspose_pdf_cloud/models/ink_annotation_response.rb +225 -0
  123. data/lib/aspose_pdf_cloud/models/ink_annotations.rb +214 -0
  124. data/lib/aspose_pdf_cloud/models/ink_annotations_response.rb +225 -0
  125. data/lib/aspose_pdf_cloud/models/justification.rb +1 -0
  126. data/lib/aspose_pdf_cloud/models/letters_positioning_methods.rb +1 -0
  127. data/lib/aspose_pdf_cloud/models/line_annotation.rb +36 -33
  128. data/lib/aspose_pdf_cloud/models/line_annotation_response.rb +5 -2
  129. data/lib/aspose_pdf_cloud/models/line_annotations.rb +5 -2
  130. data/lib/aspose_pdf_cloud/models/line_annotations_response.rb +5 -2
  131. data/lib/aspose_pdf_cloud/models/line_ending.rb +1 -0
  132. data/lib/aspose_pdf_cloud/models/line_intent.rb +1 -0
  133. data/lib/aspose_pdf_cloud/models/line_spacing.rb +1 -0
  134. data/lib/aspose_pdf_cloud/models/link.rb +5 -2
  135. data/lib/aspose_pdf_cloud/models/link_action_type.rb +1 -0
  136. data/lib/aspose_pdf_cloud/models/link_annotation.rb +5 -2
  137. data/lib/aspose_pdf_cloud/models/link_annotation_response.rb +5 -2
  138. data/lib/aspose_pdf_cloud/models/link_annotations.rb +5 -2
  139. data/lib/aspose_pdf_cloud/models/link_annotations_response.rb +5 -2
  140. data/lib/aspose_pdf_cloud/models/link_element.rb +5 -2
  141. data/lib/aspose_pdf_cloud/models/link_highlighting_mode.rb +1 -0
  142. data/lib/aspose_pdf_cloud/models/margin_info.rb +5 -2
  143. data/lib/aspose_pdf_cloud/models/markup_annotation.rb +36 -33
  144. data/lib/aspose_pdf_cloud/models/merge_documents.rb +5 -2
  145. data/lib/aspose_pdf_cloud/models/optimize_options.rb +5 -2
  146. data/lib/aspose_pdf_cloud/models/page.rb +5 -2
  147. data/lib/aspose_pdf_cloud/models/page_word_count.rb +5 -2
  148. data/lib/aspose_pdf_cloud/models/pages.rb +5 -2
  149. data/lib/aspose_pdf_cloud/models/paragraph.rb +5 -2
  150. data/lib/aspose_pdf_cloud/models/parts_embedding_modes.rb +1 -0
  151. data/lib/aspose_pdf_cloud/models/pdf_a_type.rb +1 -0
  152. data/lib/aspose_pdf_cloud/models/point.rb +5 -2
  153. data/lib/aspose_pdf_cloud/models/poly_annotation.rb +36 -33
  154. data/lib/aspose_pdf_cloud/models/poly_intent.rb +1 -0
  155. data/lib/aspose_pdf_cloud/models/poly_line_annotation.rb +36 -33
  156. data/lib/aspose_pdf_cloud/models/poly_line_annotation_response.rb +5 -2
  157. data/lib/aspose_pdf_cloud/models/poly_line_annotations.rb +5 -2
  158. data/lib/aspose_pdf_cloud/models/poly_line_annotations_response.rb +5 -2
  159. data/lib/aspose_pdf_cloud/models/polygon_annotation.rb +36 -33
  160. data/lib/aspose_pdf_cloud/models/polygon_annotation_response.rb +5 -2
  161. data/lib/aspose_pdf_cloud/models/polygon_annotations.rb +5 -2
  162. data/lib/aspose_pdf_cloud/models/polygon_annotations_response.rb +5 -2
  163. data/lib/aspose_pdf_cloud/models/popup_annotation.rb +325 -0
  164. data/lib/aspose_pdf_cloud/models/popup_annotation_response.rb +225 -0
  165. data/lib/aspose_pdf_cloud/models/popup_annotation_with_parent.rb +335 -0
  166. data/lib/aspose_pdf_cloud/models/popup_annotations.rb +214 -0
  167. data/lib/aspose_pdf_cloud/models/popup_annotations_response.rb +225 -0
  168. data/lib/aspose_pdf_cloud/models/raster_images_saving_modes.rb +1 -0
  169. data/lib/aspose_pdf_cloud/models/rectangle_pdf.rb +5 -2
  170. data/lib/aspose_pdf_cloud/models/rotation.rb +1 -0
  171. data/lib/aspose_pdf_cloud/models/segment.rb +5 -2
  172. data/lib/aspose_pdf_cloud/models/shape_type.rb +1 -0
  173. data/lib/aspose_pdf_cloud/models/signature.rb +5 -2
  174. data/lib/aspose_pdf_cloud/models/signature_type.rb +1 -0
  175. data/lib/aspose_pdf_cloud/models/signature_verify_response.rb +5 -2
  176. data/lib/aspose_pdf_cloud/models/split_result.rb +5 -2
  177. data/lib/aspose_pdf_cloud/models/split_result_document.rb +5 -2
  178. data/lib/aspose_pdf_cloud/models/split_result_response.rb +5 -2
  179. data/lib/aspose_pdf_cloud/models/square_annotation.rb +36 -33
  180. data/lib/aspose_pdf_cloud/models/square_annotation_response.rb +5 -2
  181. data/lib/aspose_pdf_cloud/models/square_annotations.rb +5 -2
  182. data/lib/aspose_pdf_cloud/models/square_annotations_response.rb +5 -2
  183. data/lib/aspose_pdf_cloud/models/squiggly_annotation.rb +367 -0
  184. data/lib/aspose_pdf_cloud/models/squiggly_annotation_response.rb +225 -0
  185. data/lib/aspose_pdf_cloud/models/squiggly_annotations.rb +214 -0
  186. data/lib/aspose_pdf_cloud/models/squiggly_annotations_response.rb +225 -0
  187. data/lib/aspose_pdf_cloud/models/stamp.rb +5 -2
  188. data/lib/aspose_pdf_cloud/models/stamp_type.rb +1 -0
  189. data/lib/aspose_pdf_cloud/models/strike_out_annotation.rb +367 -0
  190. data/lib/aspose_pdf_cloud/models/strike_out_annotation_response.rb +225 -0
  191. data/lib/aspose_pdf_cloud/models/strike_out_annotations.rb +214 -0
  192. data/lib/aspose_pdf_cloud/models/strike_out_annotations_response.rb +225 -0
  193. data/lib/aspose_pdf_cloud/models/text_annotation.rb +36 -33
  194. data/lib/aspose_pdf_cloud/models/text_annotation_response.rb +5 -2
  195. data/lib/aspose_pdf_cloud/models/text_annotations.rb +5 -2
  196. data/lib/aspose_pdf_cloud/models/text_annotations_response.rb +5 -2
  197. data/lib/aspose_pdf_cloud/models/text_horizontal_alignment.rb +1 -0
  198. data/lib/aspose_pdf_cloud/models/text_icon.rb +1 -0
  199. data/lib/aspose_pdf_cloud/models/text_line.rb +5 -2
  200. data/lib/aspose_pdf_cloud/models/text_rect.rb +5 -2
  201. data/lib/aspose_pdf_cloud/models/text_rects.rb +5 -2
  202. data/lib/aspose_pdf_cloud/models/text_rects_response.rb +5 -2
  203. data/lib/aspose_pdf_cloud/models/text_replace.rb +5 -2
  204. data/lib/aspose_pdf_cloud/models/text_replace_list_request.rb +5 -2
  205. data/lib/aspose_pdf_cloud/models/text_replace_response.rb +5 -2
  206. data/lib/aspose_pdf_cloud/models/text_state.rb +5 -2
  207. data/lib/aspose_pdf_cloud/models/text_style.rb +5 -2
  208. data/lib/aspose_pdf_cloud/models/underline_annotation.rb +367 -0
  209. data/lib/aspose_pdf_cloud/models/underline_annotation_response.rb +225 -0
  210. data/lib/aspose_pdf_cloud/models/underline_annotations.rb +214 -0
  211. data/lib/aspose_pdf_cloud/models/underline_annotations_response.rb +225 -0
  212. data/lib/aspose_pdf_cloud/models/vertical_alignment.rb +1 -0
  213. data/lib/aspose_pdf_cloud/models/word_count.rb +5 -2
  214. data/lib/aspose_pdf_cloud/models/word_count_response.rb +5 -2
  215. data/lib/aspose_pdf_cloud/models/wrap_mode.rb +1 -0
  216. data/lib/aspose_pdf_cloud/version.rb +1 -1
  217. data/test/pdf_tests.rb +757 -21
  218. metadata +68 -2
@@ -0,0 +1,214 @@
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
+ require 'time'
24
+
25
+ module AsposePdfCloud
26
+ # List of annotations.
27
+ class HighlightAnnotations
28
+ # Link to the document.
29
+ attr_accessor :links
30
+
31
+ attr_accessor :list
32
+
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'links' => :'Links',
38
+ :'list' => :'List'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'links' => :'Array<Link>',
46
+ :'list' => :'Array<HighlightAnnotation>'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
57
+
58
+ if attributes.has_key?(:'Links')
59
+ if (value = attributes[:'Links']).is_a?(Array)
60
+ self.links = value
61
+ end
62
+ end
63
+
64
+ if attributes.has_key?(:'List')
65
+ if (value = attributes[:'List']).is_a?(Array)
66
+ self.list = value
67
+ end
68
+ end
69
+
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properies with the reasons
74
+ def list_invalid_properties
75
+ invalid_properties = Array.new
76
+ return invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ return true
83
+ end
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] Object to be compared
87
+ def ==(o)
88
+ return true if self.equal?(o)
89
+ self.class == o.class &&
90
+ links == o.links &&
91
+ list == o.list
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Fixnum] Hash code
102
+ def hash
103
+ [links, list].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.swagger_types.each_pair do |key, type|
112
+ if type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
116
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
117
+ end
118
+ elsif !attributes[self.class.attribute_map[key]].nil?
119
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
121
+ end
122
+
123
+ self
124
+ end
125
+
126
+ # Deserializes the data based on type
127
+ # @param string type Data type
128
+ # @param string value Value to be deserialized
129
+ # @return [Object] Deserialized data
130
+ def _deserialize(type, value)
131
+ case type.to_sym
132
+ when :DateTime
133
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
134
+ Time.strptime(value, format).utc.to_datetime
135
+ when :Date
136
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
137
+ Time.strptime(value, format).utc.to_datetime.to_date
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :BOOLEAN
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ temp_model = AsposePdfCloud.const_get(type).new
166
+ temp_model.build_from_hash(value)
167
+ end
168
+ end
169
+
170
+ # Returns the string representation of the object
171
+ # @return [String] String presentation of the object
172
+ def to_s
173
+ to_hash.to_s
174
+ end
175
+
176
+ # to_body is an alias to to_hash (backward compatibility)
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_body
179
+ to_hash
180
+ end
181
+
182
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ next if value.nil?
189
+ hash[param] = _to_hash(value)
190
+ end
191
+ hash
192
+ end
193
+
194
+ # Outputs non-array value in the form of hash
195
+ # For object, use to_hash. Otherwise, just return the value
196
+ # @param [Object] value Any valid value
197
+ # @return [Hash] Returns the value in the form of hash
198
+ def _to_hash(value)
199
+ if value.is_a?(Array)
200
+ value.compact.map{ |v| _to_hash(v) }
201
+ elsif value.is_a?(Hash)
202
+ {}.tap do |hash|
203
+ value.each { |k, v| hash[k] = _to_hash(v) }
204
+ end
205
+ elsif value.respond_to? :to_hash
206
+ value.to_hash
207
+ else
208
+ value
209
+ end
210
+ end
211
+
212
+ end
213
+
214
+ end
@@ -0,0 +1,225 @@
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
+ require 'time'
24
+
25
+ module AsposePdfCloud
26
+
27
+ class HighlightAnnotationsResponse
28
+ # Response status code.
29
+ attr_accessor :code
30
+
31
+ # Response status.
32
+ attr_accessor :status
33
+
34
+ attr_accessor :annotations
35
+
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'code' => :'Code',
41
+ :'status' => :'Status',
42
+ :'annotations' => :'Annotations'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ :'code' => :'Integer',
50
+ :'status' => :'String',
51
+ :'annotations' => :'HighlightAnnotations'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ return unless attributes.is_a?(Hash)
59
+
60
+ # convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
62
+
63
+ if attributes.has_key?(:'Code')
64
+ self.code = attributes[:'Code']
65
+ end
66
+
67
+ if attributes.has_key?(:'Status')
68
+ self.status = attributes[:'Status']
69
+ end
70
+
71
+ if attributes.has_key?(:'Annotations')
72
+ self.annotations = attributes[:'Annotations']
73
+ end
74
+
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properies with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ if @code.nil?
82
+ invalid_properties.push("invalid value for 'code', code cannot be nil.")
83
+ end
84
+
85
+ return invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ return false if @code.nil?
92
+ return true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ code == o.code &&
101
+ status == o.status &&
102
+ annotations == o.annotations
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Fixnum] Hash code
113
+ def hash
114
+ [code, status, annotations].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ self.class.swagger_types.each_pair do |key, type|
123
+ if type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :DateTime
144
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
145
+ Time.strptime(value, format).utc.to_datetime
146
+ when :Date
147
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
148
+ Time.strptime(value, format).utc.to_datetime.to_date
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :BOOLEAN
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ temp_model = AsposePdfCloud.const_get(type).new
177
+ temp_model.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map{ |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+
223
+ end
224
+
225
+ end
@@ -20,6 +20,7 @@ SOFTWARE.
20
20
  =end
21
21
 
22
22
  require 'date'
23
+ require 'time'
23
24
 
24
25
  module AsposePdfCloud
25
26
  class HorizontalAlignment
@@ -20,6 +20,7 @@ SOFTWARE.
20
20
  =end
21
21
 
22
22
  require 'date'
23
+ require 'time'
23
24
 
24
25
  module AsposePdfCloud
25
26
  class HtmlDocumentType