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
@@ -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
 
@@ -140,9 +141,11 @@ module AsposePdfCloud
140
141
  def _deserialize(type, value)
141
142
  case type.to_sym
142
143
  when :DateTime
143
- DateTime.parse(value)
144
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
145
+ Time.strptime(value, format).utc.to_datetime
144
146
  when :Date
145
- Date.parse(value)
147
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
148
+ Time.strptime(value, format).utc.to_datetime.to_date
146
149
  when :String
147
150
  value.to_s
148
151
  when :Integer
@@ -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
  # List of annotations.
@@ -129,9 +130,11 @@ module AsposePdfCloud
129
130
  def _deserialize(type, value)
130
131
  case type.to_sym
131
132
  when :DateTime
132
- DateTime.parse(value)
133
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
134
+ Time.strptime(value, format).utc.to_datetime
133
135
  when :Date
134
- Date.parse(value)
136
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
137
+ Time.strptime(value, format).utc.to_datetime.to_date
135
138
  when :String
136
139
  value.to_s
137
140
  when :Integer
@@ -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
 
@@ -140,9 +141,11 @@ module AsposePdfCloud
140
141
  def _deserialize(type, value)
141
142
  case type.to_sym
142
143
  when :DateTime
143
- DateTime.parse(value)
144
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
145
+ Time.strptime(value, format).utc.to_datetime
144
146
  when :Date
145
- Date.parse(value)
147
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
148
+ Time.strptime(value, format).utc.to_datetime.to_date
146
149
  when :String
147
150
  value.to_s
148
151
  when :Integer
@@ -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
  # Provides PolygonAnnotation.
@@ -30,15 +31,6 @@ module AsposePdfCloud
30
31
  # Get the annotation content.
31
32
  attr_accessor :contents
32
33
 
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
34
  # The date and time when the annotation was last modified.
43
35
  attr_accessor :modified
44
36
 
@@ -66,6 +58,15 @@ module AsposePdfCloud
66
58
  # Gets VerticalAlignment of the annotation.
67
59
  attr_accessor :vertical_alignment
68
60
 
61
+ # The date and time when the annotation was created.
62
+ attr_accessor :creation_date
63
+
64
+ # Get the annotation subject.
65
+ attr_accessor :subject
66
+
67
+ # Get the annotation title.
68
+ attr_accessor :title
69
+
69
70
  # Get the annotation RichText.
70
71
  attr_accessor :rich_text
71
72
 
@@ -93,9 +94,6 @@ module AsposePdfCloud
93
94
  {
94
95
  :'links' => :'Links',
95
96
  :'contents' => :'Contents',
96
- :'creation_date' => :'CreationDate',
97
- :'subject' => :'Subject',
98
- :'title' => :'Title',
99
97
  :'modified' => :'Modified',
100
98
  :'id' => :'Id',
101
99
  :'flags' => :'Flags',
@@ -105,6 +103,9 @@ module AsposePdfCloud
105
103
  :'z_index' => :'ZIndex',
106
104
  :'horizontal_alignment' => :'HorizontalAlignment',
107
105
  :'vertical_alignment' => :'VerticalAlignment',
106
+ :'creation_date' => :'CreationDate',
107
+ :'subject' => :'Subject',
108
+ :'title' => :'Title',
108
109
  :'rich_text' => :'RichText',
109
110
  :'interior_color' => :'InteriorColor',
110
111
  :'starting_style' => :'StartingStyle',
@@ -120,9 +121,6 @@ module AsposePdfCloud
120
121
  {
121
122
  :'links' => :'Array<Link>',
122
123
  :'contents' => :'String',
123
- :'creation_date' => :'String',
124
- :'subject' => :'String',
125
- :'title' => :'String',
126
124
  :'modified' => :'String',
127
125
  :'id' => :'String',
128
126
  :'flags' => :'Array<AnnotationFlags>',
@@ -132,6 +130,9 @@ module AsposePdfCloud
132
130
  :'z_index' => :'Integer',
133
131
  :'horizontal_alignment' => :'HorizontalAlignment',
134
132
  :'vertical_alignment' => :'VerticalAlignment',
133
+ :'creation_date' => :'String',
134
+ :'subject' => :'String',
135
+ :'title' => :'String',
135
136
  :'rich_text' => :'String',
136
137
  :'interior_color' => :'Color',
137
138
  :'starting_style' => :'LineEnding',
@@ -160,18 +161,6 @@ module AsposePdfCloud
160
161
  self.contents = attributes[:'Contents']
161
162
  end
162
163
 
163
- if attributes.has_key?(:'CreationDate')
164
- self.creation_date = attributes[:'CreationDate']
165
- end
166
-
167
- if attributes.has_key?(:'Subject')
168
- self.subject = attributes[:'Subject']
169
- end
170
-
171
- if attributes.has_key?(:'Title')
172
- self.title = attributes[:'Title']
173
- end
174
-
175
164
  if attributes.has_key?(:'Modified')
176
165
  self.modified = attributes[:'Modified']
177
166
  end
@@ -210,6 +199,18 @@ module AsposePdfCloud
210
199
  self.vertical_alignment = attributes[:'VerticalAlignment']
211
200
  end
212
201
 
202
+ if attributes.has_key?(:'CreationDate')
203
+ self.creation_date = attributes[:'CreationDate']
204
+ end
205
+
206
+ if attributes.has_key?(:'Subject')
207
+ self.subject = attributes[:'Subject']
208
+ end
209
+
210
+ if attributes.has_key?(:'Title')
211
+ self.title = attributes[:'Title']
212
+ end
213
+
213
214
  if attributes.has_key?(:'RichText')
214
215
  self.rich_text = attributes[:'RichText']
215
216
  end
@@ -262,9 +263,6 @@ module AsposePdfCloud
262
263
  self.class == o.class &&
263
264
  links == o.links &&
264
265
  contents == o.contents &&
265
- creation_date == o.creation_date &&
266
- subject == o.subject &&
267
- title == o.title &&
268
266
  modified == o.modified &&
269
267
  id == o.id &&
270
268
  flags == o.flags &&
@@ -274,6 +272,9 @@ module AsposePdfCloud
274
272
  z_index == o.z_index &&
275
273
  horizontal_alignment == o.horizontal_alignment &&
276
274
  vertical_alignment == o.vertical_alignment &&
275
+ creation_date == o.creation_date &&
276
+ subject == o.subject &&
277
+ title == o.title &&
277
278
  rich_text == o.rich_text &&
278
279
  interior_color == o.interior_color &&
279
280
  starting_style == o.starting_style &&
@@ -292,7 +293,7 @@ module AsposePdfCloud
292
293
  # Calculates hash code according to all attributes.
293
294
  # @return [Fixnum] Hash code
294
295
  def hash
295
- [links, contents, creation_date, subject, title, modified, id, flags, name, rect, page_index, z_index, horizontal_alignment, vertical_alignment, rich_text, interior_color, starting_style, ending_style, intent, vertices, color].hash
296
+ [links, contents, modified, id, flags, name, rect, page_index, z_index, horizontal_alignment, vertical_alignment, creation_date, subject, title, rich_text, interior_color, starting_style, ending_style, intent, vertices, color].hash
296
297
  end
297
298
 
298
299
  # Builds the object from hash
@@ -322,9 +323,11 @@ module AsposePdfCloud
322
323
  def _deserialize(type, value)
323
324
  case type.to_sym
324
325
  when :DateTime
325
- DateTime.parse(value)
326
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
327
+ Time.strptime(value, format).utc.to_datetime
326
328
  when :Date
327
- Date.parse(value)
329
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
330
+ Time.strptime(value, format).utc.to_datetime.to_date
328
331
  when :String
329
332
  value.to_s
330
333
  when :Integer
@@ -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
 
@@ -140,9 +141,11 @@ module AsposePdfCloud
140
141
  def _deserialize(type, value)
141
142
  case type.to_sym
142
143
  when :DateTime
143
- DateTime.parse(value)
144
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
145
+ Time.strptime(value, format).utc.to_datetime
144
146
  when :Date
145
- Date.parse(value)
147
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
148
+ Time.strptime(value, format).utc.to_datetime.to_date
146
149
  when :String
147
150
  value.to_s
148
151
  when :Integer
@@ -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
  # List of annotations.
@@ -129,9 +130,11 @@ module AsposePdfCloud
129
130
  def _deserialize(type, value)
130
131
  case type.to_sym
131
132
  when :DateTime
132
- DateTime.parse(value)
133
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
134
+ Time.strptime(value, format).utc.to_datetime
133
135
  when :Date
134
- Date.parse(value)
136
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
137
+ Time.strptime(value, format).utc.to_datetime.to_date
135
138
  when :String
136
139
  value.to_s
137
140
  when :Integer
@@ -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
 
@@ -140,9 +141,11 @@ module AsposePdfCloud
140
141
  def _deserialize(type, value)
141
142
  case type.to_sym
142
143
  when :DateTime
143
- DateTime.parse(value)
144
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
145
+ Time.strptime(value, format).utc.to_datetime
144
146
  when :Date
145
- Date.parse(value)
147
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
148
+ Time.strptime(value, format).utc.to_datetime.to_date
146
149
  when :String
147
150
  value.to_s
148
151
  when :Integer
@@ -0,0 +1,325 @@
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
+ # Provides PopupAnnotation.
27
+ class PopupAnnotation
28
+ # Link to the document.
29
+ attr_accessor :links
30
+
31
+ # Get the annotation content.
32
+ attr_accessor :contents
33
+
34
+ # The date and time when the annotation was last modified.
35
+ attr_accessor :modified
36
+
37
+ # Gets ID of the annotation.
38
+ attr_accessor :id
39
+
40
+ # Gets Flags of the annotation.
41
+ attr_accessor :flags
42
+
43
+ # Gets Name of the annotation.
44
+ attr_accessor :name
45
+
46
+ # Gets Rect of the annotation.
47
+ attr_accessor :rect
48
+
49
+ # Gets PageIndex of the annotation.
50
+ attr_accessor :page_index
51
+
52
+ # Gets ZIndex of the annotation.
53
+ attr_accessor :z_index
54
+
55
+ # Gets HorizontalAlignment of the annotation.
56
+ attr_accessor :horizontal_alignment
57
+
58
+ # Gets VerticalAlignment of the annotation.
59
+ attr_accessor :vertical_alignment
60
+
61
+ # Color of the annotation.
62
+ attr_accessor :color
63
+
64
+ # Gets or sets a flag specifying whether the pop-up annotation should initially be displayed open.
65
+ attr_accessor :open
66
+
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'links' => :'Links',
72
+ :'contents' => :'Contents',
73
+ :'modified' => :'Modified',
74
+ :'id' => :'Id',
75
+ :'flags' => :'Flags',
76
+ :'name' => :'Name',
77
+ :'rect' => :'Rect',
78
+ :'page_index' => :'PageIndex',
79
+ :'z_index' => :'ZIndex',
80
+ :'horizontal_alignment' => :'HorizontalAlignment',
81
+ :'vertical_alignment' => :'VerticalAlignment',
82
+ :'color' => :'Color',
83
+ :'open' => :'Open'
84
+ }
85
+ end
86
+
87
+ # Attribute type mapping.
88
+ def self.swagger_types
89
+ {
90
+ :'links' => :'Array<Link>',
91
+ :'contents' => :'String',
92
+ :'modified' => :'String',
93
+ :'id' => :'String',
94
+ :'flags' => :'Array<AnnotationFlags>',
95
+ :'name' => :'String',
96
+ :'rect' => :'RectanglePdf',
97
+ :'page_index' => :'Integer',
98
+ :'z_index' => :'Integer',
99
+ :'horizontal_alignment' => :'HorizontalAlignment',
100
+ :'vertical_alignment' => :'VerticalAlignment',
101
+ :'color' => :'Color',
102
+ :'open' => :'BOOLEAN'
103
+ }
104
+ end
105
+
106
+ # Initializes the object
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ def initialize(attributes = {})
109
+ return unless attributes.is_a?(Hash)
110
+
111
+ # convert string to symbol for hash key
112
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
113
+
114
+ if attributes.has_key?(:'Links')
115
+ if (value = attributes[:'Links']).is_a?(Array)
116
+ self.links = value
117
+ end
118
+ end
119
+
120
+ if attributes.has_key?(:'Contents')
121
+ self.contents = attributes[:'Contents']
122
+ end
123
+
124
+ if attributes.has_key?(:'Modified')
125
+ self.modified = attributes[:'Modified']
126
+ end
127
+
128
+ if attributes.has_key?(:'Id')
129
+ self.id = attributes[:'Id']
130
+ end
131
+
132
+ if attributes.has_key?(:'Flags')
133
+ if (value = attributes[:'Flags']).is_a?(Array)
134
+ self.flags = value
135
+ end
136
+ end
137
+
138
+ if attributes.has_key?(:'Name')
139
+ self.name = attributes[:'Name']
140
+ end
141
+
142
+ if attributes.has_key?(:'Rect')
143
+ self.rect = attributes[:'Rect']
144
+ end
145
+
146
+ if attributes.has_key?(:'PageIndex')
147
+ self.page_index = attributes[:'PageIndex']
148
+ end
149
+
150
+ if attributes.has_key?(:'ZIndex')
151
+ self.z_index = attributes[:'ZIndex']
152
+ end
153
+
154
+ if attributes.has_key?(:'HorizontalAlignment')
155
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
156
+ end
157
+
158
+ if attributes.has_key?(:'VerticalAlignment')
159
+ self.vertical_alignment = attributes[:'VerticalAlignment']
160
+ end
161
+
162
+ if attributes.has_key?(:'Color')
163
+ self.color = attributes[:'Color']
164
+ end
165
+
166
+ if attributes.has_key?(:'Open')
167
+ self.open = attributes[:'Open']
168
+ end
169
+
170
+ end
171
+
172
+ # Show invalid properties with the reasons. Usually used together with valid?
173
+ # @return Array for valid properies with the reasons
174
+ def list_invalid_properties
175
+ invalid_properties = Array.new
176
+ return invalid_properties
177
+ end
178
+
179
+ # Check to see if the all the properties in the model are valid
180
+ # @return true if the model is valid
181
+ def valid?
182
+ return true
183
+ end
184
+
185
+ # Checks equality by comparing each attribute.
186
+ # @param [Object] Object to be compared
187
+ def ==(o)
188
+ return true if self.equal?(o)
189
+ self.class == o.class &&
190
+ links == o.links &&
191
+ contents == o.contents &&
192
+ modified == o.modified &&
193
+ id == o.id &&
194
+ flags == o.flags &&
195
+ name == o.name &&
196
+ rect == o.rect &&
197
+ page_index == o.page_index &&
198
+ z_index == o.z_index &&
199
+ horizontal_alignment == o.horizontal_alignment &&
200
+ vertical_alignment == o.vertical_alignment &&
201
+ color == o.color &&
202
+ open == o.open
203
+ end
204
+
205
+ # @see the `==` method
206
+ # @param [Object] Object to be compared
207
+ def eql?(o)
208
+ self == o
209
+ end
210
+
211
+ # Calculates hash code according to all attributes.
212
+ # @return [Fixnum] Hash code
213
+ def hash
214
+ [links, contents, modified, id, flags, name, rect, page_index, z_index, horizontal_alignment, vertical_alignment, color, open].hash
215
+ end
216
+
217
+ # Builds the object from hash
218
+ # @param [Hash] attributes Model attributes in the form of hash
219
+ # @return [Object] Returns the model itself
220
+ def build_from_hash(attributes)
221
+ return nil unless attributes.is_a?(Hash)
222
+ self.class.swagger_types.each_pair do |key, type|
223
+ if type =~ /\AArray<(.*)>/i
224
+ # check to ensure the input is an array given that the the attribute
225
+ # is documented as an array but the input is not
226
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
227
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
228
+ end
229
+ elsif !attributes[self.class.attribute_map[key]].nil?
230
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
231
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
232
+ end
233
+
234
+ self
235
+ end
236
+
237
+ # Deserializes the data based on type
238
+ # @param string type Data type
239
+ # @param string value Value to be deserialized
240
+ # @return [Object] Deserialized data
241
+ def _deserialize(type, value)
242
+ case type.to_sym
243
+ when :DateTime
244
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
245
+ Time.strptime(value, format).utc.to_datetime
246
+ when :Date
247
+ format = (value.include? '+') ? '/Date(%Q%z)/' : '/Date(%Q)/'
248
+ Time.strptime(value, format).utc.to_datetime.to_date
249
+ when :String
250
+ value.to_s
251
+ when :Integer
252
+ value.to_i
253
+ when :Float
254
+ value.to_f
255
+ when :BOOLEAN
256
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
257
+ true
258
+ else
259
+ false
260
+ end
261
+ when :Object
262
+ # generic object (usually a Hash), return directly
263
+ value
264
+ when /\AArray<(?<inner_type>.+)>\z/
265
+ inner_type = Regexp.last_match[:inner_type]
266
+ value.map { |v| _deserialize(inner_type, v) }
267
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
268
+ k_type = Regexp.last_match[:k_type]
269
+ v_type = Regexp.last_match[:v_type]
270
+ {}.tap do |hash|
271
+ value.each do |k, v|
272
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
273
+ end
274
+ end
275
+ else # model
276
+ temp_model = AsposePdfCloud.const_get(type).new
277
+ temp_model.build_from_hash(value)
278
+ end
279
+ end
280
+
281
+ # Returns the string representation of the object
282
+ # @return [String] String presentation of the object
283
+ def to_s
284
+ to_hash.to_s
285
+ end
286
+
287
+ # to_body is an alias to to_hash (backward compatibility)
288
+ # @return [Hash] Returns the object in the form of hash
289
+ def to_body
290
+ to_hash
291
+ end
292
+
293
+ # Returns the object in the form of hash
294
+ # @return [Hash] Returns the object in the form of hash
295
+ def to_hash
296
+ hash = {}
297
+ self.class.attribute_map.each_pair do |attr, param|
298
+ value = self.send(attr)
299
+ next if value.nil?
300
+ hash[param] = _to_hash(value)
301
+ end
302
+ hash
303
+ end
304
+
305
+ # Outputs non-array value in the form of hash
306
+ # For object, use to_hash. Otherwise, just return the value
307
+ # @param [Object] value Any valid value
308
+ # @return [Hash] Returns the value in the form of hash
309
+ def _to_hash(value)
310
+ if value.is_a?(Array)
311
+ value.compact.map{ |v| _to_hash(v) }
312
+ elsif value.is_a?(Hash)
313
+ {}.tap do |hash|
314
+ value.each { |k, v| hash[k] = _to_hash(v) }
315
+ end
316
+ elsif value.respond_to? :to_hash
317
+ value.to_hash
318
+ else
319
+ value
320
+ end
321
+ end
322
+
323
+ end
324
+
325
+ end