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