aspose_pdf_cloud 25.2.0 → 25.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (757) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose_pdf_cloud/api/pdf_api.rb +30536 -30536
  3. data/lib/aspose_pdf_cloud/api_client.rb +488 -487
  4. data/lib/aspose_pdf_cloud/api_error.rb +47 -47
  5. data/lib/aspose_pdf_cloud/configuration.rb +182 -182
  6. data/lib/aspose_pdf_cloud/models/annotation.rb +318 -318
  7. data/lib/aspose_pdf_cloud/models/annotation_flags.rb +53 -53
  8. data/lib/aspose_pdf_cloud/models/annotation_info.rb +333 -333
  9. data/lib/aspose_pdf_cloud/models/annotation_state.rb +50 -50
  10. data/lib/aspose_pdf_cloud/models/annotation_type.rb +70 -70
  11. data/lib/aspose_pdf_cloud/models/annotations_info.rb +213 -213
  12. data/lib/aspose_pdf_cloud/models/annotations_info_response.rb +224 -224
  13. data/lib/aspose_pdf_cloud/models/antialiasing_processing_type.rb +44 -44
  14. data/lib/aspose_pdf_cloud/models/aspose_response.rb +214 -214
  15. data/lib/aspose_pdf_cloud/models/attachment.rb +276 -276
  16. data/lib/aspose_pdf_cloud/models/attachment_info.rb +253 -253
  17. data/lib/aspose_pdf_cloud/models/attachment_response.rb +224 -224
  18. data/lib/aspose_pdf_cloud/models/attachments.rb +213 -213
  19. data/lib/aspose_pdf_cloud/models/attachments_response.rb +224 -224
  20. data/lib/aspose_pdf_cloud/models/bookmark.rb +361 -361
  21. data/lib/aspose_pdf_cloud/models/bookmark_response.rb +224 -224
  22. data/lib/aspose_pdf_cloud/models/bookmarks.rb +213 -213
  23. data/lib/aspose_pdf_cloud/models/bookmarks_response.rb +224 -224
  24. data/lib/aspose_pdf_cloud/models/border.rb +249 -249
  25. data/lib/aspose_pdf_cloud/models/border_corner_style.rb +44 -44
  26. data/lib/aspose_pdf_cloud/models/border_effect.rb +44 -44
  27. data/lib/aspose_pdf_cloud/models/border_info.rb +239 -239
  28. data/lib/aspose_pdf_cloud/models/border_style.rb +47 -47
  29. data/lib/aspose_pdf_cloud/models/box_style.rb +48 -48
  30. data/lib/aspose_pdf_cloud/models/cap_style.rb +44 -44
  31. data/lib/aspose_pdf_cloud/models/caption_position.rb +44 -44
  32. data/lib/aspose_pdf_cloud/models/caret_annotation.rb +378 -378
  33. data/lib/aspose_pdf_cloud/models/caret_annotation_response.rb +224 -224
  34. data/lib/aspose_pdf_cloud/models/caret_annotations.rb +213 -213
  35. data/lib/aspose_pdf_cloud/models/caret_annotations_response.rb +224 -224
  36. data/lib/aspose_pdf_cloud/models/caret_symbol.rb +44 -44
  37. data/lib/aspose_pdf_cloud/models/cell.rb +353 -353
  38. data/lib/aspose_pdf_cloud/models/cell_recognized.rb +209 -209
  39. data/lib/aspose_pdf_cloud/models/check_box_field.rb +455 -455
  40. data/lib/aspose_pdf_cloud/models/check_box_field_response.rb +224 -224
  41. data/lib/aspose_pdf_cloud/models/check_box_fields.rb +213 -213
  42. data/lib/aspose_pdf_cloud/models/check_box_fields_response.rb +224 -224
  43. data/lib/aspose_pdf_cloud/models/choice_field.rb +418 -418
  44. data/lib/aspose_pdf_cloud/models/circle_annotation.rb +378 -378
  45. data/lib/aspose_pdf_cloud/models/circle_annotation_response.rb +224 -224
  46. data/lib/aspose_pdf_cloud/models/circle_annotations.rb +213 -213
  47. data/lib/aspose_pdf_cloud/models/circle_annotations_response.rb +224 -224
  48. data/lib/aspose_pdf_cloud/models/color.rb +249 -249
  49. data/lib/aspose_pdf_cloud/models/color_depth.rb +46 -46
  50. data/lib/aspose_pdf_cloud/models/column_adjustment.rb +45 -45
  51. data/lib/aspose_pdf_cloud/models/combo_box_field.rb +460 -460
  52. data/lib/aspose_pdf_cloud/models/combo_box_field_response.rb +224 -224
  53. data/lib/aspose_pdf_cloud/models/combo_box_fields.rb +213 -213
  54. data/lib/aspose_pdf_cloud/models/combo_box_fields_response.rb +224 -224
  55. data/lib/aspose_pdf_cloud/models/common_figure_annotation.rb +378 -378
  56. data/lib/aspose_pdf_cloud/models/compression_type.rb +47 -47
  57. data/lib/aspose_pdf_cloud/models/crypto_algorithm.rb +46 -46
  58. data/lib/aspose_pdf_cloud/models/dash.rb +219 -219
  59. data/lib/aspose_pdf_cloud/models/default_page_config.rb +209 -209
  60. data/lib/aspose_pdf_cloud/models/direction.rb +44 -44
  61. data/lib/aspose_pdf_cloud/models/disc_usage.rb +219 -219
  62. data/lib/aspose_pdf_cloud/models/display_properties.rb +291 -291
  63. data/lib/aspose_pdf_cloud/models/display_properties_response.rb +224 -224
  64. data/lib/aspose_pdf_cloud/models/doc_format.rb +44 -44
  65. data/lib/aspose_pdf_cloud/models/doc_mdp_access_permission_type.rb +45 -45
  66. data/lib/aspose_pdf_cloud/models/doc_recognition_mode.rb +45 -45
  67. data/lib/aspose_pdf_cloud/models/document.rb +231 -231
  68. data/lib/aspose_pdf_cloud/models/document_config.rb +234 -234
  69. data/lib/aspose_pdf_cloud/models/document_layers.rb +201 -201
  70. data/lib/aspose_pdf_cloud/models/document_page_response.rb +224 -224
  71. data/lib/aspose_pdf_cloud/models/document_pages_response.rb +224 -224
  72. data/lib/aspose_pdf_cloud/models/document_privilege.rb +299 -299
  73. data/lib/aspose_pdf_cloud/models/document_properties.rb +213 -213
  74. data/lib/aspose_pdf_cloud/models/document_properties_response.rb +224 -224
  75. data/lib/aspose_pdf_cloud/models/document_property.rb +236 -236
  76. data/lib/aspose_pdf_cloud/models/document_property_response.rb +224 -224
  77. data/lib/aspose_pdf_cloud/models/document_response.rb +236 -236
  78. data/lib/aspose_pdf_cloud/models/epub_recognition_mode.rb +45 -45
  79. data/lib/aspose_pdf_cloud/models/error.rb +229 -229
  80. data/lib/aspose_pdf_cloud/models/error_details.rb +214 -214
  81. data/lib/aspose_pdf_cloud/models/field.rb +270 -270
  82. data/lib/aspose_pdf_cloud/models/field_response.rb +224 -224
  83. data/lib/aspose_pdf_cloud/models/field_type.rb +46 -46
  84. data/lib/aspose_pdf_cloud/models/fields.rb +218 -218
  85. data/lib/aspose_pdf_cloud/models/fields_response.rb +224 -224
  86. data/lib/aspose_pdf_cloud/models/file_attachment_annotation.rb +408 -408
  87. data/lib/aspose_pdf_cloud/models/file_attachment_annotation_response.rb +224 -224
  88. data/lib/aspose_pdf_cloud/models/file_attachment_annotations.rb +213 -213
  89. data/lib/aspose_pdf_cloud/models/file_attachment_annotations_response.rb +224 -224
  90. data/lib/aspose_pdf_cloud/models/file_icon.rb +46 -46
  91. data/lib/aspose_pdf_cloud/models/file_version.rb +274 -274
  92. data/lib/aspose_pdf_cloud/models/file_versions.rb +201 -201
  93. data/lib/aspose_pdf_cloud/models/files_list.rb +201 -201
  94. data/lib/aspose_pdf_cloud/models/files_upload_result.rb +213 -213
  95. data/lib/aspose_pdf_cloud/models/font_encoding_rules.rb +44 -44
  96. data/lib/aspose_pdf_cloud/models/font_saving_modes.rb +46 -46
  97. data/lib/aspose_pdf_cloud/models/font_styles.rb +46 -46
  98. data/lib/aspose_pdf_cloud/models/form_field.rb +398 -398
  99. data/lib/aspose_pdf_cloud/models/free_text_annotation.rb +403 -403
  100. data/lib/aspose_pdf_cloud/models/free_text_annotation_response.rb +224 -224
  101. data/lib/aspose_pdf_cloud/models/free_text_annotations.rb +213 -213
  102. data/lib/aspose_pdf_cloud/models/free_text_annotations_response.rb +224 -224
  103. data/lib/aspose_pdf_cloud/models/free_text_intent.rb +45 -45
  104. data/lib/aspose_pdf_cloud/models/graph_info.rb +301 -301
  105. data/lib/aspose_pdf_cloud/models/highlight_annotation.rb +370 -370
  106. data/lib/aspose_pdf_cloud/models/highlight_annotation_response.rb +224 -224
  107. data/lib/aspose_pdf_cloud/models/highlight_annotations.rb +213 -213
  108. data/lib/aspose_pdf_cloud/models/highlight_annotations_response.rb +224 -224
  109. data/lib/aspose_pdf_cloud/models/horizontal_alignment.rb +46 -46
  110. data/lib/aspose_pdf_cloud/models/html_document_type.rb +44 -44
  111. data/lib/aspose_pdf_cloud/models/html_markup_generation_modes.rb +44 -44
  112. data/lib/aspose_pdf_cloud/models/image.rb +266 -266
  113. data/lib/aspose_pdf_cloud/models/image_compression_version.rb +45 -45
  114. data/lib/aspose_pdf_cloud/models/image_encoding.rb +46 -46
  115. data/lib/aspose_pdf_cloud/models/image_footer.rb +341 -341
  116. data/lib/aspose_pdf_cloud/models/image_fragment.rb +283 -283
  117. data/lib/aspose_pdf_cloud/models/image_header.rb +341 -341
  118. data/lib/aspose_pdf_cloud/models/image_response.rb +224 -224
  119. data/lib/aspose_pdf_cloud/models/image_src_type.rb +44 -44
  120. data/lib/aspose_pdf_cloud/models/image_stamp.rb +361 -361
  121. data/lib/aspose_pdf_cloud/models/image_template.rb +301 -301
  122. data/lib/aspose_pdf_cloud/models/image_templates_request.rb +231 -231
  123. data/lib/aspose_pdf_cloud/models/images.rb +213 -213
  124. data/lib/aspose_pdf_cloud/models/images_response.rb +224 -224
  125. data/lib/aspose_pdf_cloud/models/ink_annotation.rb +380 -380
  126. data/lib/aspose_pdf_cloud/models/ink_annotation_response.rb +224 -224
  127. data/lib/aspose_pdf_cloud/models/ink_annotations.rb +213 -213
  128. data/lib/aspose_pdf_cloud/models/ink_annotations_response.rb +224 -224
  129. data/lib/aspose_pdf_cloud/models/justification.rb +45 -45
  130. data/lib/aspose_pdf_cloud/models/layer_info.rb +239 -239
  131. data/lib/aspose_pdf_cloud/models/letters_positioning_methods.rb +44 -44
  132. data/lib/aspose_pdf_cloud/models/line_annotation.rb +488 -488
  133. data/lib/aspose_pdf_cloud/models/line_annotation_response.rb +224 -224
  134. data/lib/aspose_pdf_cloud/models/line_annotations.rb +213 -213
  135. data/lib/aspose_pdf_cloud/models/line_annotations_response.rb +224 -224
  136. data/lib/aspose_pdf_cloud/models/line_ending.rb +52 -52
  137. data/lib/aspose_pdf_cloud/models/line_intent.rb +45 -45
  138. data/lib/aspose_pdf_cloud/models/line_spacing.rb +44 -44
  139. data/lib/aspose_pdf_cloud/models/link.rb +229 -229
  140. data/lib/aspose_pdf_cloud/models/link_action_type.rb +48 -48
  141. data/lib/aspose_pdf_cloud/models/link_annotation.rb +294 -294
  142. data/lib/aspose_pdf_cloud/models/link_annotation_response.rb +224 -224
  143. data/lib/aspose_pdf_cloud/models/link_annotations.rb +213 -213
  144. data/lib/aspose_pdf_cloud/models/link_annotations_response.rb +224 -224
  145. data/lib/aspose_pdf_cloud/models/link_element.rb +201 -201
  146. data/lib/aspose_pdf_cloud/models/link_highlighting_mode.rb +47 -47
  147. data/lib/aspose_pdf_cloud/models/list_box_field.rb +462 -462
  148. data/lib/aspose_pdf_cloud/models/list_box_field_response.rb +224 -224
  149. data/lib/aspose_pdf_cloud/models/list_box_fields.rb +213 -213
  150. data/lib/aspose_pdf_cloud/models/list_box_fields_response.rb +224 -224
  151. data/lib/aspose_pdf_cloud/models/margin_info.rb +229 -229
  152. data/lib/aspose_pdf_cloud/models/markup_annotation.rb +358 -358
  153. data/lib/aspose_pdf_cloud/models/merge_documents.rb +206 -206
  154. data/lib/aspose_pdf_cloud/models/movie_annotation.rb +348 -348
  155. data/lib/aspose_pdf_cloud/models/movie_annotation_response.rb +224 -224
  156. data/lib/aspose_pdf_cloud/models/movie_annotations.rb +213 -213
  157. data/lib/aspose_pdf_cloud/models/movie_annotations_response.rb +224 -224
  158. data/lib/aspose_pdf_cloud/models/object_exist.rb +219 -219
  159. data/lib/aspose_pdf_cloud/models/optimize_options.rb +329 -329
  160. data/lib/aspose_pdf_cloud/models/option.rb +229 -229
  161. data/lib/aspose_pdf_cloud/models/organize_document_data.rb +257 -257
  162. data/lib/aspose_pdf_cloud/models/organize_document_request.rb +206 -206
  163. data/lib/aspose_pdf_cloud/models/output_format.rb +44 -44
  164. data/lib/aspose_pdf_cloud/models/page.rb +226 -226
  165. data/lib/aspose_pdf_cloud/models/page_layout.rb +49 -49
  166. data/lib/aspose_pdf_cloud/models/page_mode.rb +48 -48
  167. data/lib/aspose_pdf_cloud/models/page_number_stamp.rb +351 -351
  168. data/lib/aspose_pdf_cloud/models/page_range.rb +207 -207
  169. data/lib/aspose_pdf_cloud/models/page_word_count.rb +219 -219
  170. data/lib/aspose_pdf_cloud/models/pages.rb +213 -213
  171. data/lib/aspose_pdf_cloud/models/paragraph.rb +316 -316
  172. data/lib/aspose_pdf_cloud/models/parts_embedding_modes.rb +45 -45
  173. data/lib/aspose_pdf_cloud/models/pdf_a_type.rb +46 -46
  174. data/lib/aspose_pdf_cloud/models/pdf_page_stamp.rb +351 -351
  175. data/lib/aspose_pdf_cloud/models/permissions_flags.rb +50 -50
  176. data/lib/aspose_pdf_cloud/models/point.rb +219 -219
  177. data/lib/aspose_pdf_cloud/models/poly_annotation.rb +415 -415
  178. data/lib/aspose_pdf_cloud/models/poly_intent.rb +46 -46
  179. data/lib/aspose_pdf_cloud/models/poly_line_annotation.rb +415 -415
  180. data/lib/aspose_pdf_cloud/models/poly_line_annotation_response.rb +224 -224
  181. data/lib/aspose_pdf_cloud/models/poly_line_annotations.rb +213 -213
  182. data/lib/aspose_pdf_cloud/models/poly_line_annotations_response.rb +224 -224
  183. data/lib/aspose_pdf_cloud/models/polygon_annotation.rb +415 -415
  184. data/lib/aspose_pdf_cloud/models/polygon_annotation_response.rb +224 -224
  185. data/lib/aspose_pdf_cloud/models/polygon_annotations.rb +213 -213
  186. data/lib/aspose_pdf_cloud/models/polygon_annotations_response.rb +224 -224
  187. data/lib/aspose_pdf_cloud/models/popup_annotation.rb +328 -328
  188. data/lib/aspose_pdf_cloud/models/popup_annotation_response.rb +224 -224
  189. data/lib/aspose_pdf_cloud/models/popup_annotation_with_parent.rb +338 -338
  190. data/lib/aspose_pdf_cloud/models/popup_annotations.rb +213 -213
  191. data/lib/aspose_pdf_cloud/models/popup_annotations_response.rb +224 -224
  192. data/lib/aspose_pdf_cloud/models/position.rb +219 -219
  193. data/lib/aspose_pdf_cloud/models/radio_button_field.rb +452 -452
  194. data/lib/aspose_pdf_cloud/models/radio_button_field_response.rb +224 -224
  195. data/lib/aspose_pdf_cloud/models/radio_button_fields.rb +213 -213
  196. data/lib/aspose_pdf_cloud/models/radio_button_fields_response.rb +224 -224
  197. data/lib/aspose_pdf_cloud/models/radio_button_option_field.rb +418 -418
  198. data/lib/aspose_pdf_cloud/models/raster_images_saving_modes.rb +45 -45
  199. data/lib/aspose_pdf_cloud/models/rectangle.rb +249 -249
  200. data/lib/aspose_pdf_cloud/models/redaction_annotation.rb +380 -380
  201. data/lib/aspose_pdf_cloud/models/redaction_annotation_response.rb +224 -224
  202. data/lib/aspose_pdf_cloud/models/redaction_annotations.rb +213 -213
  203. data/lib/aspose_pdf_cloud/models/redaction_annotations_response.rb +224 -224
  204. data/lib/aspose_pdf_cloud/models/rotation.rb +46 -46
  205. data/lib/aspose_pdf_cloud/models/row.rb +306 -306
  206. data/lib/aspose_pdf_cloud/models/row_recognized.rb +211 -211
  207. data/lib/aspose_pdf_cloud/models/screen_annotation.rb +338 -338
  208. data/lib/aspose_pdf_cloud/models/screen_annotation_response.rb +224 -224
  209. data/lib/aspose_pdf_cloud/models/screen_annotations.rb +213 -213
  210. data/lib/aspose_pdf_cloud/models/screen_annotations_response.rb +224 -224
  211. data/lib/aspose_pdf_cloud/models/segment.rb +233 -233
  212. data/lib/aspose_pdf_cloud/models/shape_type.rb +45 -45
  213. data/lib/aspose_pdf_cloud/models/signature.rb +388 -388
  214. data/lib/aspose_pdf_cloud/models/signature_custom_appearance.rb +329 -329
  215. data/lib/aspose_pdf_cloud/models/signature_field.rb +408 -408
  216. data/lib/aspose_pdf_cloud/models/signature_field_response.rb +224 -224
  217. data/lib/aspose_pdf_cloud/models/signature_fields.rb +213 -213
  218. data/lib/aspose_pdf_cloud/models/signature_fields_response.rb +224 -224
  219. data/lib/aspose_pdf_cloud/models/signature_type.rb +45 -45
  220. data/lib/aspose_pdf_cloud/models/signature_verify_response.rb +229 -229
  221. data/lib/aspose_pdf_cloud/models/sound_annotation.rb +442 -442
  222. data/lib/aspose_pdf_cloud/models/sound_annotation_response.rb +224 -224
  223. data/lib/aspose_pdf_cloud/models/sound_annotations.rb +213 -213
  224. data/lib/aspose_pdf_cloud/models/sound_annotations_response.rb +224 -224
  225. data/lib/aspose_pdf_cloud/models/sound_encoding.rb +46 -46
  226. data/lib/aspose_pdf_cloud/models/sound_icon.rb +44 -44
  227. data/lib/aspose_pdf_cloud/models/split_range_pdf_options.rb +200 -200
  228. data/lib/aspose_pdf_cloud/models/split_result.rb +201 -201
  229. data/lib/aspose_pdf_cloud/models/split_result_document.rb +244 -244
  230. data/lib/aspose_pdf_cloud/models/split_result_response.rb +224 -224
  231. data/lib/aspose_pdf_cloud/models/square_annotation.rb +378 -378
  232. data/lib/aspose_pdf_cloud/models/square_annotation_response.rb +224 -224
  233. data/lib/aspose_pdf_cloud/models/square_annotations.rb +213 -213
  234. data/lib/aspose_pdf_cloud/models/square_annotations_response.rb +224 -224
  235. data/lib/aspose_pdf_cloud/models/squiggly_annotation.rb +370 -370
  236. data/lib/aspose_pdf_cloud/models/squiggly_annotation_response.rb +224 -224
  237. data/lib/aspose_pdf_cloud/models/squiggly_annotations.rb +213 -213
  238. data/lib/aspose_pdf_cloud/models/squiggly_annotations_response.rb +224 -224
  239. data/lib/aspose_pdf_cloud/models/stamp.rb +414 -414
  240. data/lib/aspose_pdf_cloud/models/stamp_annotation.rb +388 -388
  241. data/lib/aspose_pdf_cloud/models/stamp_annotation_response.rb +224 -224
  242. data/lib/aspose_pdf_cloud/models/stamp_annotations.rb +213 -213
  243. data/lib/aspose_pdf_cloud/models/stamp_annotations_response.rb +224 -224
  244. data/lib/aspose_pdf_cloud/models/stamp_base.rb +281 -281
  245. data/lib/aspose_pdf_cloud/models/stamp_icon.rb +56 -56
  246. data/lib/aspose_pdf_cloud/models/stamp_info.rb +276 -276
  247. data/lib/aspose_pdf_cloud/models/stamp_type.rb +46 -46
  248. data/lib/aspose_pdf_cloud/models/stamps_info.rb +213 -213
  249. data/lib/aspose_pdf_cloud/models/stamps_info_response.rb +224 -224
  250. data/lib/aspose_pdf_cloud/models/storage_exist.rb +204 -204
  251. data/lib/aspose_pdf_cloud/models/storage_file.rb +249 -249
  252. data/lib/aspose_pdf_cloud/models/strike_out_annotation.rb +370 -370
  253. data/lib/aspose_pdf_cloud/models/strike_out_annotation_response.rb +224 -224
  254. data/lib/aspose_pdf_cloud/models/strike_out_annotations.rb +213 -213
  255. data/lib/aspose_pdf_cloud/models/strike_out_annotations_response.rb +224 -224
  256. data/lib/aspose_pdf_cloud/models/svg_images.rb +226 -226
  257. data/lib/aspose_pdf_cloud/models/table.rb +438 -438
  258. data/lib/aspose_pdf_cloud/models/table_broken.rb +45 -45
  259. data/lib/aspose_pdf_cloud/models/table_recognized.rb +243 -243
  260. data/lib/aspose_pdf_cloud/models/table_recognized_response.rb +224 -224
  261. data/lib/aspose_pdf_cloud/models/tables_recognized.rb +213 -213
  262. data/lib/aspose_pdf_cloud/models/tables_recognized_response.rb +224 -224
  263. data/lib/aspose_pdf_cloud/models/text_annotation.rb +388 -388
  264. data/lib/aspose_pdf_cloud/models/text_annotation_response.rb +224 -224
  265. data/lib/aspose_pdf_cloud/models/text_annotations.rb +213 -213
  266. data/lib/aspose_pdf_cloud/models/text_annotations_response.rb +224 -224
  267. data/lib/aspose_pdf_cloud/models/text_box_field.rb +458 -458
  268. data/lib/aspose_pdf_cloud/models/text_box_field_response.rb +224 -224
  269. data/lib/aspose_pdf_cloud/models/text_box_fields.rb +213 -213
  270. data/lib/aspose_pdf_cloud/models/text_box_fields_response.rb +224 -224
  271. data/lib/aspose_pdf_cloud/models/text_footer.rb +341 -341
  272. data/lib/aspose_pdf_cloud/models/text_header.rb +341 -341
  273. data/lib/aspose_pdf_cloud/models/text_horizontal_alignment.rb +48 -48
  274. data/lib/aspose_pdf_cloud/models/text_icon.rb +53 -53
  275. data/lib/aspose_pdf_cloud/models/text_line.rb +216 -216
  276. data/lib/aspose_pdf_cloud/models/text_rect.rb +269 -269
  277. data/lib/aspose_pdf_cloud/models/text_rects.rb +201 -201
  278. data/lib/aspose_pdf_cloud/models/text_rects_response.rb +224 -224
  279. data/lib/aspose_pdf_cloud/models/text_replace.rb +278 -278
  280. data/lib/aspose_pdf_cloud/models/text_replace_list_request.rb +236 -236
  281. data/lib/aspose_pdf_cloud/models/text_replace_response.rb +229 -229
  282. data/lib/aspose_pdf_cloud/models/text_stamp.rb +361 -361
  283. data/lib/aspose_pdf_cloud/models/text_state.rb +299 -299
  284. data/lib/aspose_pdf_cloud/models/text_style.rb +244 -244
  285. data/lib/aspose_pdf_cloud/models/timestamp_settings.rb +209 -209
  286. data/lib/aspose_pdf_cloud/models/underline_annotation.rb +370 -370
  287. data/lib/aspose_pdf_cloud/models/underline_annotation_response.rb +224 -224
  288. data/lib/aspose_pdf_cloud/models/underline_annotations.rb +213 -213
  289. data/lib/aspose_pdf_cloud/models/underline_annotations_response.rb +224 -224
  290. data/lib/aspose_pdf_cloud/models/vertical_alignment.rb +46 -46
  291. data/lib/aspose_pdf_cloud/models/word_count.rb +200 -200
  292. data/lib/aspose_pdf_cloud/models/word_count_response.rb +224 -224
  293. data/lib/aspose_pdf_cloud/models/wrap_mode.rb +45 -45
  294. data/lib/aspose_pdf_cloud/models/xmp_metadata.rb +201 -201
  295. data/lib/aspose_pdf_cloud/models/xmp_metadata_property.rb +243 -243
  296. data/lib/aspose_pdf_cloud/version.rb +24 -24
  297. data/lib/aspose_pdf_cloud.rb +335 -335
  298. metadata +13 -501
  299. data/Examples/delete_annotation.rb +0 -22
  300. data/Examples/delete_document_annotations.rb +0 -18
  301. data/Examples/delete_page_annotations.rb +0 -17
  302. data/Examples/example_data/PdfWithAnnotations.pdf +0 -0
  303. data/Examples/get_carret_annotation.rb +0 -20
  304. data/Examples/get_circle_annotation.rb +0 -21
  305. data/Examples/get_circle_annotations.rb +0 -17
  306. data/Examples/get_document_annotations.rb +0 -15
  307. data/Examples/get_document_free_text_annotations.rb +0 -17
  308. data/Examples/get_document_highlight_annotations.rb +0 -16
  309. data/Examples/get_document_ink_annotations.rb +0 -15
  310. data/Examples/get_document_line_annotations.rb +0 -16
  311. data/Examples/get_document_movie_annotations.rb +0 -16
  312. data/Examples/get_document_polygon_annotations.rb +0 -16
  313. data/Examples/get_document_polyline_annotations.rb +0 -17
  314. data/Examples/get_document_popup_annotation_by_parent.rb +0 -17
  315. data/Examples/get_document_popup_annotations.rb +0 -16
  316. data/Examples/get_document_redaction_annotations.rb +0 -16
  317. data/Examples/get_document_screen_annotations.rb +0 -17
  318. data/Examples/get_document_sound_annotations.rb +0 -18
  319. data/Examples/get_document_squiggly_annotations.rb +0 -18
  320. data/Examples/get_document_stamp_annotations.rb +0 -17
  321. data/Examples/get_document_strike_out_annotation.rb +0 -17
  322. data/Examples/get_document_text_annotations.rb +0 -17
  323. data/Examples/get_document_underline_annotations.rb +0 -17
  324. data/Examples/get_documnet_carret_annotation.rb +0 -17
  325. data/Examples/get_file_attachment_annotation.rb +0 -21
  326. data/Examples/get_file_attachment_annotation_data.rb +0 -21
  327. data/Examples/get_file_attachment_annotations.rb +0 -19
  328. data/Examples/get_free_text_annotation.rb +0 -20
  329. data/Examples/get_hightlight_annotations.rb +0 -20
  330. data/Examples/get_ink_annotation.rb +0 -21
  331. data/Examples/get_line_annotation.rb +0 -20
  332. data/Examples/get_movie_annotation.rb +0 -20
  333. data/Examples/get_page_annotations.rb +0 -19
  334. data/Examples/get_page_carret_annotations.rb +0 -17
  335. data/Examples/get_page_file_attachment_annotations.rb +0 -19
  336. data/Examples/get_page_free_text_annotations.rb +0 -18
  337. data/Examples/get_page_highlight_annotations.rb +0 -18
  338. data/Examples/get_page_ink_annotations.rb +0 -17
  339. data/Examples/get_page_line_annotations.rb +0 -17
  340. data/Examples/get_page_movie_annotations.rb +0 -18
  341. data/Examples/get_page_polygon_annotations.rb +0 -18
  342. data/Examples/get_page_polyline_annotations.rb +0 -21
  343. data/Examples/get_page_redaction_annotations.rb +0 -17
  344. data/Examples/get_page_screen_annotations.rb +0 -19
  345. data/Examples/get_page_sound_annotations.rb +0 -20
  346. data/Examples/get_page_square_annotations.rb +0 -18
  347. data/Examples/get_page_squiggly_annotations.rb +0 -17
  348. data/Examples/get_page_stamp_annotations.rb +0 -17
  349. data/Examples/get_page_strikeout_annotations.rb +0 -17
  350. data/Examples/get_page_text_annotations.rb +0 -17
  351. data/Examples/get_page_underline_annotations.rb +0 -17
  352. data/Examples/get_polygon_annotation.rb +0 -20
  353. data/Examples/get_polyline_annotation.rb +0 -22
  354. data/Examples/get_redaction_annotation.rb +0 -19
  355. data/Examples/get_screen_annotation.rb +0 -22
  356. data/Examples/get_screen_annotation_data.rb +0 -19
  357. data/Examples/get_screen_annotations.rb +0 -21
  358. data/Examples/get_sound_annotation.rb +0 -25
  359. data/Examples/get_sound_annotation_data.rb +0 -19
  360. data/Examples/get_square_annotation.rb +0 -19
  361. data/Examples/get_squiggly_annotation.rb +0 -19
  362. data/Examples/get_stamp_annotation.rb +0 -20
  363. data/Examples/get_stamp_annotation_data.rb +0 -20
  364. data/Examples/get_strike_out_annotation.rb +0 -19
  365. data/Examples/get_text_annotation.rb +0 -19
  366. data/Examples/get_underline_annotation.rb +0 -19
  367. data/Examples/post_page_carret_annotations.rb +0 -28
  368. data/Examples/post_page_circle_annotations.rb +0 -27
  369. data/Examples/post_page_file_attachnment_annotations.rb +0 -38
  370. data/Examples/post_page_free_text_annotations.rb +0 -35
  371. data/Examples/post_page_hightlight_annotations.rb +0 -32
  372. data/Examples/post_page_ink_annotations.rb +0 -39
  373. data/Examples/post_page_line_annotations.rb +0 -28
  374. data/Examples/post_page_movie_annotations.rb +0 -30
  375. data/Examples/post_page_polygon_annotations.rb +0 -33
  376. data/Examples/post_page_polyline_annotations.rb +0 -35
  377. data/Examples/post_page_redaction_annotations.rb +0 -28
  378. data/Examples/post_page_screen_annotations.rb +0 -31
  379. data/Examples/post_page_sound_annotations.rb +0 -35
  380. data/Examples/post_page_square_annotations.rb +0 -27
  381. data/Examples/post_page_squiggly_annotations.rb +0 -33
  382. data/Examples/post_page_stamp_annotations.rb +0 -34
  383. data/Examples/post_page_strike_out_annotation.rb +0 -33
  384. data/Examples/post_page_text_annotations.rb +0 -26
  385. data/Examples/post_page_underline_annotations.rb +0 -33
  386. data/Examples/post_popup_annotation.rb +0 -25
  387. data/Examples/put_annotations_flatten.rb +0 -20
  388. data/Examples/put_carret_annotation.rb +0 -30
  389. data/Examples/put_circle_annotation.rb +0 -29
  390. data/Examples/put_file_attachment_annotation.rb +0 -38
  391. data/Examples/put_file_attachment_annotion_data_extract.rb +0 -21
  392. data/Examples/put_free_text_annotation.rb +0 -38
  393. data/Examples/put_highlight_annotation.rb +0 -34
  394. data/Examples/put_ink_annotation.rb +0 -41
  395. data/Examples/put_line_annotation.rb +0 -30
  396. data/Examples/put_movie_annotation.rb +0 -31
  397. data/Examples/put_polygon_annotation.rb +0 -35
  398. data/Examples/put_polyline_annotation.rb +0 -36
  399. data/Examples/put_redaction_annotation.rb +0 -31
  400. data/Examples/put_screen_annotation.rb +0 -33
  401. data/Examples/put_screen_annotation_data_extract.rb +0 -19
  402. data/Examples/put_sound_annotation.rb +0 -42
  403. data/Examples/put_sound_annotation_data_extract.rb +0 -20
  404. data/Examples/put_square_annotation.rb +0 -28
  405. data/Examples/put_squiggly_annotation.rb +0 -35
  406. data/Examples/put_stamp_annotation.rb +0 -35
  407. data/Examples/put_strike_out_annotation.rb +0 -35
  408. data/Examples/put_text_annotation.rb +0 -29
  409. data/Examples/put_underline_annotation.rb +0 -35
  410. data/LICENSE +0 -21
  411. data/README.md +0 -87
  412. data/aspose_pdf_cloud.gemspec +0 -54
  413. data/docs/Annotation.md +0 -20
  414. data/docs/AnnotationFlags.md +0 -20
  415. data/docs/AnnotationInfo.md +0 -21
  416. data/docs/AnnotationState.md +0 -17
  417. data/docs/AnnotationType.md +0 -37
  418. data/docs/AnnotationsInfo.md +0 -10
  419. data/docs/AnnotationsInfoResponse.md +0 -11
  420. data/docs/AntialiasingProcessingType.md +0 -11
  421. data/docs/AsposeResponse.md +0 -10
  422. data/docs/Attachment.md +0 -16
  423. data/docs/AttachmentInfo.md +0 -12
  424. data/docs/AttachmentResponse.md +0 -11
  425. data/docs/Attachments.md +0 -10
  426. data/docs/AttachmentsResponse.md +0 -11
  427. data/docs/Bookmark.md +0 -25
  428. data/docs/BookmarkResponse.md +0 -11
  429. data/docs/Bookmarks.md +0 -10
  430. data/docs/BookmarksResponse.md +0 -11
  431. data/docs/Border.md +0 -14
  432. data/docs/BorderCornerStyle.md +0 -11
  433. data/docs/BorderEffect.md +0 -11
  434. data/docs/BorderInfo.md +0 -13
  435. data/docs/BorderStyle.md +0 -14
  436. data/docs/BoxStyle.md +0 -15
  437. data/docs/CapStyle.md +0 -11
  438. data/docs/CaptionPosition.md +0 -11
  439. data/docs/CaretAnnotation.md +0 -26
  440. data/docs/CaretAnnotationResponse.md +0 -11
  441. data/docs/CaretAnnotations.md +0 -10
  442. data/docs/CaretAnnotationsResponse.md +0 -11
  443. data/docs/CaretSymbol.md +0 -11
  444. data/docs/Cell.md +0 -24
  445. data/docs/CellRecognized.md +0 -10
  446. data/docs/CheckBoxField.md +0 -33
  447. data/docs/CheckBoxFieldResponse.md +0 -11
  448. data/docs/CheckBoxFields.md +0 -10
  449. data/docs/CheckBoxFieldsResponse.md +0 -11
  450. data/docs/ChoiceField.md +0 -30
  451. data/docs/CircleAnnotation.md +0 -26
  452. data/docs/CircleAnnotationResponse.md +0 -11
  453. data/docs/CircleAnnotations.md +0 -10
  454. data/docs/CircleAnnotationsResponse.md +0 -11
  455. data/docs/Color.md +0 -12
  456. data/docs/ColorDepth.md +0 -13
  457. data/docs/ColumnAdjustment.md +0 -12
  458. data/docs/ComboBoxField.md +0 -34
  459. data/docs/ComboBoxFieldResponse.md +0 -11
  460. data/docs/ComboBoxFields.md +0 -10
  461. data/docs/ComboBoxFieldsResponse.md +0 -11
  462. data/docs/CommonFigureAnnotation.md +0 -26
  463. data/docs/CompressionType.md +0 -14
  464. data/docs/CryptoAlgorithm.md +0 -14
  465. data/docs/Dash.md +0 -10
  466. data/docs/DefaultPageConfig.md +0 -10
  467. data/docs/Direction.md +0 -11
  468. data/docs/DiscUsage.md +0 -10
  469. data/docs/DisplayProperties.md +0 -18
  470. data/docs/DisplayPropertiesResponse.md +0 -11
  471. data/docs/DocFormat.md +0 -11
  472. data/docs/DocMDPAccessPermissionType.md +0 -16
  473. data/docs/DocRecognitionMode.md +0 -12
  474. data/docs/Document.md +0 -12
  475. data/docs/DocumentConfig.md +0 -12
  476. data/docs/DocumentLayers.md +0 -9
  477. data/docs/DocumentPageResponse.md +0 -11
  478. data/docs/DocumentPagesResponse.md +0 -11
  479. data/docs/DocumentPrivilege.md +0 -19
  480. data/docs/DocumentProperties.md +0 -10
  481. data/docs/DocumentPropertiesResponse.md +0 -11
  482. data/docs/DocumentProperty.md +0 -12
  483. data/docs/DocumentPropertyResponse.md +0 -11
  484. data/docs/DocumentResponse.md +0 -12
  485. data/docs/EpubRecognitionMode.md +0 -17
  486. data/docs/Error.md +0 -12
  487. data/docs/ErrorDetails.md +0 -10
  488. data/docs/Field.md +0 -15
  489. data/docs/FieldResponse.md +0 -11
  490. data/docs/FieldType.md +0 -13
  491. data/docs/Fields.md +0 -10
  492. data/docs/FieldsResponse.md +0 -11
  493. data/docs/FileAttachmentAnnotation.md +0 -29
  494. data/docs/FileAttachmentAnnotationResponse.md +0 -11
  495. data/docs/FileAttachmentAnnotations.md +0 -10
  496. data/docs/FileAttachmentAnnotationsResponse.md +0 -11
  497. data/docs/FileIcon.md +0 -13
  498. data/docs/FileVersion.md +0 -15
  499. data/docs/FileVersions.md +0 -9
  500. data/docs/FilesList.md +0 -9
  501. data/docs/FilesUploadResult.md +0 -10
  502. data/docs/FontEncodingRules.md +0 -11
  503. data/docs/FontSavingModes.md +0 -15
  504. data/docs/FontStyles.md +0 -13
  505. data/docs/FormField.md +0 -28
  506. data/docs/FreeTextAnnotation.md +0 -28
  507. data/docs/FreeTextAnnotationResponse.md +0 -11
  508. data/docs/FreeTextAnnotations.md +0 -10
  509. data/docs/FreeTextAnnotationsResponse.md +0 -11
  510. data/docs/FreeTextIntent.md +0 -12
  511. data/docs/GraphInfo.md +0 -19
  512. data/docs/HighlightAnnotation.md +0 -25
  513. data/docs/HighlightAnnotationResponse.md +0 -11
  514. data/docs/HighlightAnnotations.md +0 -10
  515. data/docs/HighlightAnnotationsResponse.md +0 -11
  516. data/docs/HorizontalAlignment.md +0 -13
  517. data/docs/HtmlDocumentType.md +0 -11
  518. data/docs/HtmlMarkupGenerationModes.md +0 -14
  519. data/docs/Image.md +0 -14
  520. data/docs/ImageCompressionVersion.md +0 -12
  521. data/docs/ImageEncoding.md +0 -13
  522. data/docs/ImageFooter.md +0 -23
  523. data/docs/ImageFragment.md +0 -15
  524. data/docs/ImageHeader.md +0 -23
  525. data/docs/ImageResponse.md +0 -11
  526. data/docs/ImageSrcType.md +0 -11
  527. data/docs/ImageStamp.md +0 -25
  528. data/docs/ImageTemplate.md +0 -17
  529. data/docs/ImageTemplatesRequest.md +0 -11
  530. data/docs/Images.md +0 -10
  531. data/docs/ImagesResponse.md +0 -11
  532. data/docs/InkAnnotation.md +0 -26
  533. data/docs/InkAnnotationResponse.md +0 -11
  534. data/docs/InkAnnotations.md +0 -10
  535. data/docs/InkAnnotationsResponse.md +0 -11
  536. data/docs/Justification.md +0 -12
  537. data/docs/LayerInfo.md +0 -12
  538. data/docs/LettersPositioningMethods.md +0 -12
  539. data/docs/LineAnnotation.md +0 -36
  540. data/docs/LineAnnotationResponse.md +0 -11
  541. data/docs/LineAnnotations.md +0 -10
  542. data/docs/LineAnnotationsResponse.md +0 -11
  543. data/docs/LineEnding.md +0 -19
  544. data/docs/LineIntent.md +0 -12
  545. data/docs/LineSpacing.md +0 -11
  546. data/docs/Link.md +0 -13
  547. data/docs/LinkActionType.md +0 -15
  548. data/docs/LinkAnnotation.md +0 -15
  549. data/docs/LinkAnnotationResponse.md +0 -11
  550. data/docs/LinkAnnotations.md +0 -10
  551. data/docs/LinkAnnotationsResponse.md +0 -11
  552. data/docs/LinkElement.md +0 -9
  553. data/docs/LinkHighlightingMode.md +0 -14
  554. data/docs/ListBoxField.md +0 -34
  555. data/docs/ListBoxFieldResponse.md +0 -11
  556. data/docs/ListBoxFields.md +0 -10
  557. data/docs/ListBoxFieldsResponse.md +0 -11
  558. data/docs/MarginInfo.md +0 -12
  559. data/docs/MarkupAnnotation.md +0 -24
  560. data/docs/MergeDocuments.md +0 -9
  561. data/docs/MovieAnnotation.md +0 -23
  562. data/docs/MovieAnnotationResponse.md +0 -11
  563. data/docs/MovieAnnotations.md +0 -10
  564. data/docs/MovieAnnotationsResponse.md +0 -11
  565. data/docs/ObjectExist.md +0 -10
  566. data/docs/OptimizeOptions.md +0 -22
  567. data/docs/Option.md +0 -12
  568. data/docs/OrganizeDocumentData.md +0 -10
  569. data/docs/OrganizeDocumentRequest.md +0 -9
  570. data/docs/OutputFormat.md +0 -11
  571. data/docs/Page.md +0 -11
  572. data/docs/PageLayout.md +0 -16
  573. data/docs/PageMode.md +0 -15
  574. data/docs/PageNumberStamp.md +0 -24
  575. data/docs/PageRange.md +0 -10
  576. data/docs/PageWordCount.md +0 -10
  577. data/docs/Pages.md +0 -10
  578. data/docs/Paragraph.md +0 -20
  579. data/docs/PartsEmbeddingModes.md +0 -15
  580. data/docs/PdfAType.md +0 -13
  581. data/docs/PdfApi.md +0 -10112
  582. data/docs/PdfPageStamp.md +0 -24
  583. data/docs/PermissionsFlags.md +0 -17
  584. data/docs/Point.md +0 -10
  585. data/docs/PolyAnnotation.md +0 -29
  586. data/docs/PolyIntent.md +0 -13
  587. data/docs/PolyLineAnnotation.md +0 -29
  588. data/docs/PolyLineAnnotationResponse.md +0 -11
  589. data/docs/PolyLineAnnotations.md +0 -10
  590. data/docs/PolyLineAnnotationsResponse.md +0 -11
  591. data/docs/PolygonAnnotation.md +0 -29
  592. data/docs/PolygonAnnotationResponse.md +0 -11
  593. data/docs/PolygonAnnotations.md +0 -10
  594. data/docs/PolygonAnnotationsResponse.md +0 -11
  595. data/docs/PopupAnnotation.md +0 -21
  596. data/docs/PopupAnnotationResponse.md +0 -11
  597. data/docs/PopupAnnotationWithParent.md +0 -22
  598. data/docs/PopupAnnotations.md +0 -10
  599. data/docs/PopupAnnotationsResponse.md +0 -11
  600. data/docs/Position.md +0 -10
  601. data/docs/RadioButtonField.md +0 -33
  602. data/docs/RadioButtonFieldResponse.md +0 -11
  603. data/docs/RadioButtonFields.md +0 -10
  604. data/docs/RadioButtonFieldsResponse.md +0 -11
  605. data/docs/RadioButtonOptionField.md +0 -30
  606. data/docs/RasterImagesSavingModes.md +0 -15
  607. data/docs/Rectangle.md +0 -12
  608. data/docs/RedactionAnnotation.md +0 -26
  609. data/docs/RedactionAnnotationResponse.md +0 -11
  610. data/docs/RedactionAnnotations.md +0 -10
  611. data/docs/RedactionAnnotationsResponse.md +0 -11
  612. data/docs/Rotation.md +0 -13
  613. data/docs/Row.md +0 -19
  614. data/docs/RowRecognized.md +0 -10
  615. data/docs/ScreenAnnotation.md +0 -22
  616. data/docs/ScreenAnnotationResponse.md +0 -11
  617. data/docs/ScreenAnnotations.md +0 -10
  618. data/docs/ScreenAnnotationsResponse.md +0 -11
  619. data/docs/Segment.md +0 -10
  620. data/docs/ShapeType.md +0 -12
  621. data/docs/Signature.md +0 -24
  622. data/docs/SignatureCustomAppearance.md +0 -20
  623. data/docs/SignatureField.md +0 -29
  624. data/docs/SignatureFieldResponse.md +0 -11
  625. data/docs/SignatureFields.md +0 -10
  626. data/docs/SignatureFieldsResponse.md +0 -11
  627. data/docs/SignatureType.md +0 -12
  628. data/docs/SignatureVerifyResponse.md +0 -11
  629. data/docs/SoundAnnotation.md +0 -30
  630. data/docs/SoundAnnotationResponse.md +0 -11
  631. data/docs/SoundAnnotations.md +0 -10
  632. data/docs/SoundAnnotationsResponse.md +0 -11
  633. data/docs/SoundEncoding.md +0 -13
  634. data/docs/SoundIcon.md +0 -11
  635. data/docs/SplitRangePdfOptions.md +0 -9
  636. data/docs/SplitResult.md +0 -9
  637. data/docs/SplitResultDocument.md +0 -13
  638. data/docs/SplitResultResponse.md +0 -11
  639. data/docs/SquareAnnotation.md +0 -26
  640. data/docs/SquareAnnotationResponse.md +0 -11
  641. data/docs/SquareAnnotations.md +0 -10
  642. data/docs/SquareAnnotationsResponse.md +0 -11
  643. data/docs/SquigglyAnnotation.md +0 -25
  644. data/docs/SquigglyAnnotationResponse.md +0 -11
  645. data/docs/SquigglyAnnotations.md +0 -10
  646. data/docs/SquigglyAnnotationsResponse.md +0 -11
  647. data/docs/Stamp.md +0 -30
  648. data/docs/StampAnnotation.md +0 -27
  649. data/docs/StampAnnotationResponse.md +0 -11
  650. data/docs/StampAnnotations.md +0 -10
  651. data/docs/StampAnnotationsResponse.md +0 -11
  652. data/docs/StampBase.md +0 -17
  653. data/docs/StampIcon.md +0 -23
  654. data/docs/StampInfo.md +0 -16
  655. data/docs/StampType.md +0 -13
  656. data/docs/StampsInfo.md +0 -10
  657. data/docs/StampsInfoResponse.md +0 -11
  658. data/docs/StorageExist.md +0 -9
  659. data/docs/StorageFile.md +0 -13
  660. data/docs/StrikeOutAnnotation.md +0 -25
  661. data/docs/StrikeOutAnnotationResponse.md +0 -11
  662. data/docs/StrikeOutAnnotations.md +0 -10
  663. data/docs/StrikeOutAnnotationsResponse.md +0 -11
  664. data/docs/SvgImages.md +0 -11
  665. data/docs/Table.md +0 -32
  666. data/docs/TableBroken.md +0 -12
  667. data/docs/TableRecognized.md +0 -13
  668. data/docs/TableRecognizedResponse.md +0 -11
  669. data/docs/TablesRecognized.md +0 -10
  670. data/docs/TablesRecognizedResponse.md +0 -11
  671. data/docs/TextAnnotation.md +0 -27
  672. data/docs/TextAnnotationResponse.md +0 -11
  673. data/docs/TextAnnotations.md +0 -10
  674. data/docs/TextAnnotationsResponse.md +0 -11
  675. data/docs/TextBoxField.md +0 -34
  676. data/docs/TextBoxFieldResponse.md +0 -11
  677. data/docs/TextBoxFields.md +0 -10
  678. data/docs/TextBoxFieldsResponse.md +0 -11
  679. data/docs/TextFooter.md +0 -23
  680. data/docs/TextHeader.md +0 -23
  681. data/docs/TextHorizontalAlignment.md +0 -15
  682. data/docs/TextIcon.md +0 -20
  683. data/docs/TextLine.md +0 -10
  684. data/docs/TextRect.md +0 -16
  685. data/docs/TextRects.md +0 -9
  686. data/docs/TextRectsResponse.md +0 -11
  687. data/docs/TextReplace.md +0 -14
  688. data/docs/TextReplaceListRequest.md +0 -12
  689. data/docs/TextReplaceResponse.md +0 -11
  690. data/docs/TextStamp.md +0 -25
  691. data/docs/TextState.md +0 -18
  692. data/docs/TextStyle.md +0 -13
  693. data/docs/TimestampSettings.md +0 -10
  694. data/docs/UnderlineAnnotation.md +0 -25
  695. data/docs/UnderlineAnnotationResponse.md +0 -11
  696. data/docs/UnderlineAnnotations.md +0 -10
  697. data/docs/UnderlineAnnotationsResponse.md +0 -11
  698. data/docs/VerticalAlignment.md +0 -13
  699. data/docs/WordCount.md +0 -9
  700. data/docs/WordCountResponse.md +0 -11
  701. data/docs/WrapMode.md +0 -12
  702. data/docs/XmpMetadata.md +0 -9
  703. data/docs/XmpMetadataProperty.md +0 -11
  704. data/test/pdf_tests.rb +0 -6695
  705. data/test_data/.gitattributes +0 -1
  706. data/test_data/33226.p12 +0 -0
  707. data/test_data/33539.jpg +0 -0
  708. data/test_data/44781.jpg +0 -0
  709. data/test_data/4pages.epub +0 -0
  710. data/test_data/4pages.pdf +0 -0
  711. data/test_data/4pagesEncrypted.pdf +0 -0
  712. data/test_data/4pagesPdfA.pdf +0 -0
  713. data/test_data/BlankWithSignature.pdf +0 -0
  714. data/test_data/FormData.fdf +0 -0
  715. data/test_data/FormData.pdf +0 -0
  716. data/test_data/FormDataTextBox.pdf +0 -0
  717. data/test_data/FormDataXfa_in.pdf +0 -0
  718. data/test_data/FormDataXfa_in.xml +0 -8
  719. data/test_data/FormDataXfdf_in.pdf +0 -0
  720. data/test_data/FormDataXfdf_in.xfdf +0 -21
  721. data/test_data/Hello_world.pdf +0 -0
  722. data/test_data/HtmlExample1.html +0 -27
  723. data/test_data/HtmlWithImage.zip +0 -0
  724. data/test_data/Koala.jpg +0 -0
  725. data/test_data/MhtExample.mht +0 -12752
  726. data/test_data/PageNumberStamp.pdf +0 -0
  727. data/test_data/PdfWithAcroForm.pdf +0 -321
  728. data/test_data/PdfWithAnnotations.pdf +0 -0
  729. data/test_data/PdfWithAnnotations1.pdf +0 -0
  730. data/test_data/PdfWithBookmarks.pdf +0 -0
  731. data/test_data/PdfWithEmbeddedFiles.pdf +0 -0
  732. data/test_data/PdfWithImages.pdf +0 -0
  733. data/test_data/PdfWithImages2.pdf +0 -0
  734. data/test_data/PdfWithLayers.pdf +0 -0
  735. data/test_data/PdfWithLinks.pdf +0 -0
  736. data/test_data/PdfWithScreenAnnotations.pdf +0 -0
  737. data/test_data/PdfWithTable.pdf +0 -0
  738. data/test_data/PdfWithXfaForm.pdf +0 -0
  739. data/test_data/Penguins.emf +0 -0
  740. data/test_data/Penguins.jpg +0 -0
  741. data/test_data/Righteous-Regular.ttf +0 -0
  742. data/test_data/ScreenMovie.swf +0 -0
  743. data/test_data/Simple.svg +0 -12
  744. data/test_data/Simple.xps +0 -0
  745. data/test_data/TexExample.tex +0 -305
  746. data/test_data/Typography.PS +0 -29
  747. data/test_data/XslfoExample.xslfo +0 -246
  748. data/test_data/adbe.x509.rsa_sha1.valid.pdf +0 -0
  749. data/test_data/alfa.pdf +0 -0
  750. data/test_data/butterfly.jpg +0 -0
  751. data/test_data/marketing.pdf +0 -0
  752. data/test_data/mixed.md +0 -14
  753. data/test_data/rusdoc.pdf +0 -0
  754. data/test_data/sample.tex +0 -105
  755. data/test_data/template.pcl +0 -0
  756. data/test_data/template.xml +0 -1
  757. data/test_data/test1234.pfx +0 -0
@@ -1,487 +1,488 @@
1
- =begin
2
- --------------------------------------------------------------------------------------------------------------------
3
- Copyright (c) 2025 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 'json'
24
- require 'logger'
25
- require 'tempfile'
26
- require 'uri'
27
- require 'faraday'
28
- require_relative 'version'
29
- require_relative 'api_error'
30
-
31
- module AsposePdfCloud
32
- #
33
- # api client is mainly responsible for making the HTTP call to the API backend.
34
- #
35
- class ApiClient
36
-
37
- # The Configuration object holding settings to be used in the API client.
38
- attr_accessor :config
39
-
40
- # Defines the headers to be used in HTTP requests of all API calls by default.
41
- #
42
- # @return [Hash]
43
- attr_accessor :default_headers
44
-
45
- # Initializes the ApiClient
46
- # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
47
- def initialize(config = Configuration.default)
48
- @config = config
49
- @default_headers = {
50
- 'Content-Type' => "application/json",
51
- 'x-aspose-client' => "ruby sdk",
52
- 'x-aspose-client-version' => "#{ AsposePdfCloud::VERSION }"
53
- }
54
- end
55
-
56
- def self.default
57
- @@default ||= ApiClient.new
58
- end
59
-
60
- # Call an API with given options.
61
- #
62
- # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
63
- # the data deserialized from response body (could be nil), response status code and response headers.
64
- def call_api(http_method, path, opts = {})
65
- response = build_request(http_method, path, opts)
66
- download_file response if opts[:return_type] == 'File'
67
- if @config.debugging
68
- @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
69
- end
70
-
71
- unless response.success?
72
- if response.status == 0
73
- # Errors from libcurl will be made visible here
74
- fail ApiError.new(:code => 0,
75
- :message => response.reason_phrase)
76
- else
77
- fail ApiError.new(:code => response.status,
78
- :response_headers => response.headers,
79
- :response_body => response.body),
80
- response.reason_phrase
81
- end
82
- end
83
-
84
- if opts[:return_type]
85
- data = deserialize(response, opts[:return_type])
86
- else
87
- data = nil
88
- end
89
- [data, response.status, response.headers]
90
- end
91
-
92
- # Builds the HTTP request
93
- #
94
- # @param [String] http_method HTTP method/verb (e.g. POST)
95
- # @param [String] path URL path (e.g. /account/new)
96
- # @option opts [Hash] :header_params Header parameters
97
- # @option opts [Hash] :query_params Query parameters
98
- # @option opts [Hash] :form_params Query parameters
99
- # @option opts [Object] :body HTTP body (JSON/XML)
100
- # @return [Faraday::Response] A Faraday Response
101
- def build_request(http_method, path, opts = {})
102
- url = build_request_url(path)
103
- http_method = http_method.to_sym.downcase
104
-
105
- header_params = @default_headers.merge(opts[:header_params] || {})
106
- query_params = opts[:query_params] || {}
107
- form_params = opts[:form_params] || {}
108
- body = opts[:body] || {}
109
-
110
- if !@config.self_host
111
- update_params_for_auth! header_params, query_params, opts[:auth_names]
112
- end
113
-
114
- req_opts = {
115
- :method => http_method,
116
- :headers => header_params,
117
- :params => query_params,
118
- :body => body
119
- }
120
-
121
- if [:post, :patch, :put, :delete].include?(http_method)
122
- req_body = build_request_body(header_params, form_params, opts[:body])
123
- req_opts.update :body => req_body
124
- if @config.debugging
125
- @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
126
- end
127
- end
128
-
129
- req_opts[:params] = opts[:query_params]
130
-
131
- if !@config.self_host
132
- # OAuth 2.0
133
- add_o_auth_token(req_opts)
134
- end
135
-
136
- conn = Faraday.new url, {:params => query_params, :headers => header_params} do |f|
137
- f.options.params_encoder = Faraday::FlatParamsEncoder
138
- f.request :multipart
139
- f.request :url_encoded
140
- f.adapter Faraday.default_adapter
141
- end
142
-
143
- if req_opts[:body] == {}
144
- req_opts[:body] = nil
145
- end
146
-
147
- case http_method
148
- when :post
149
- return conn.post url, req_opts[:body]
150
- when :put
151
- return conn.put url, req_opts[:body]
152
- when :get
153
- return conn.get url, req_opts[:body]
154
- else
155
- return conn.delete url do |c|
156
- c.body = req_opts[:body]
157
- end
158
- end
159
- end
160
-
161
- # Check if the given MIME is a JSON MIME.
162
- # JSON MIME examples:
163
- # application/json
164
- # application/json; charset=UTF8
165
- # APPLICATION/JSON
166
- # */*
167
- # @param [String] mime MIME
168
- # @return [Boolean] True if the MIME is application/json
169
- def json_mime?(mime)
170
- (mime == "*/*") || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
171
- end
172
-
173
- # Deserialize the response to the given return type.
174
- #
175
- # @param [Response] response HTTP response
176
- # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
177
- def deserialize(response, return_type)
178
- body = response.body
179
-
180
- # handle file downloading - return the File instance processed in request callbacks
181
- # note that response body is empty when the file is written in chunks in request on_body callback
182
- return @tempfile if return_type == 'File'
183
-
184
- return nil if body.nil? || body.empty?
185
-
186
- # return response body directly for String return type
187
- return body if return_type == 'String'
188
-
189
- # ensuring a default content type
190
- content_type = response.headers['Content-Type'] || 'application/json'
191
-
192
- raise "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
193
-
194
- begin
195
- data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
196
- rescue JSON::ParserError => e
197
- if %w(String Date DateTime).include?(return_type)
198
- data = body
199
- else
200
- raise e
201
- end
202
- end
203
-
204
- convert_to_type data, return_type
205
- end
206
-
207
- # Convert data to the given return type.
208
- # @param [Object] data Data to be converted
209
- # @param [String] return_type Return type
210
- # @return [Mixed] Data in a particular type
211
- def convert_to_type(data, return_type)
212
- return nil if data.nil?
213
- case return_type
214
- when 'String'
215
- data.to_s
216
- when 'Integer'
217
- data.to_i
218
- when 'Float'
219
- data.to_f
220
- when 'BOOLEAN'
221
- data == true
222
- when 'DateTime'
223
- # parse date time (expecting ISO 8601 format)
224
- DateTime.parse data
225
- when 'Date'
226
- # parse date time (expecting ISO 8601 format)
227
- Date.parse data
228
- when 'Object'
229
- # generic object (usually a Hash), return directly
230
- data
231
- when /\AArray<(.+)>\z/
232
- # e.g. Array<Pet>
233
- sub_type = $1
234
- data.map {|item| convert_to_type(item, sub_type) }
235
- when /\AHash\<String, (.+)\>\z/
236
- # e.g. Hash<String, Integer>
237
- sub_type = $1
238
- {}.tap do |hash|
239
- data.each {|k, v| hash[k] = convert_to_type(v, sub_type) }
240
- end
241
- else
242
- # models, e.g. Pet
243
- AsposePdfCloud.const_get(return_type).new.tap do |model|
244
- model.build_from_hash data
245
- end
246
- end
247
- end
248
-
249
- # Save response body into a file in (the defined) temporary folder, using the filename
250
- # from the "Content-Disposition" header if provided, otherwise a random filename.
251
- # The response body is written to the file in chunks in order to handle files which
252
- # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
253
- # process can use.
254
- #
255
- # @see Configuration#temp_folder_path
256
- def download_file(response)
257
- tempfile = nil
258
- encoding = nil
259
- content_disposition = response.headers['Content-Disposition']
260
- if content_disposition and content_disposition =~ /filename=/i
261
- filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
262
- prefix = sanitize_filename(filename)
263
- else
264
- prefix = 'download-'
265
- end
266
- prefix = prefix + '-' unless prefix.end_with?('-')
267
- encoding = response.body.encoding
268
- tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
269
- @tempfile = tempfile
270
- tempfile.write(response.body)
271
- response.on_complete do |resp|
272
- tempfile.close
273
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
274
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
275
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
276
- "explicitly with `tempfile.delete`"
277
- end
278
- end
279
-
280
- # Sanitize filename by removing path.
281
- # e.g. ../../sun.gif becomes sun.gif
282
- #
283
- # @param [String] filename the filename to be sanitized
284
- # @return [String] the sanitized filename
285
- def sanitize_filename(filename)
286
- filename.gsub(/.*[\/\\]/, '')
287
- end
288
-
289
- def build_request_url(path)
290
- # Add leading and trailing slashes to path
291
- path = "/#{path}".gsub(/\/+/, '/')
292
- URI.encode(@config.base_url + path)
293
- end
294
-
295
- # Builds the HTTP request body
296
- #
297
- # @param [Hash] header_params Header parameters
298
- # @param [Hash] form_params Query parameters
299
- # @param [Object] body HTTP body (JSON/XML)
300
- # @return [String] HTTP body data in the form of string
301
- def build_request_body(header_params, form_params, body)
302
- # http form
303
- if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
304
- header_params['Content-Type'] == 'multipart/form-data'
305
- data = {}
306
- form_params.each do |key, value|
307
- case value
308
- when ::File
309
- data[key] = Faraday::UploadIO.new(value.path, MimeMagic.by_magic(value).to_s, key)
310
- when ::Array, nil
311
- data[key] = value
312
- else
313
- data[key] = value.to_s
314
- end
315
- end
316
- elsif body
317
- data = body.is_a?(String) ? body : body.to_json
318
- else
319
- data = nil
320
- end
321
- data
322
- end
323
-
324
- # Update hearder and query params based on authentication settings.
325
- #
326
- # @param [Hash] header_params Header parameters
327
- # @param [Hash] query_params Query parameters
328
- # @param [String] auth_names Authentication scheme name
329
- def update_params_for_auth!(header_params, query_params, auth_names)
330
- Array(auth_names).each do |auth_name|
331
- auth_setting = @config.auth_settings[auth_name]
332
- next unless auth_setting
333
- case auth_setting[:in]
334
- when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
335
- when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
336
- else raise ArgumentError, 'Authentication token must be in `query` of `header`'
337
- end
338
- end
339
- end
340
-
341
- # Sets user agent in HTTP header
342
- #
343
- # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
344
- def user_agent=(user_agent)
345
- @user_agent = user_agent
346
- @default_headers['User-Agent'] = @user_agent
347
- end
348
-
349
- # Return Accept header based on an array of accepts provided.
350
- # @param [Array] accepts array for Accept
351
- # @return [String] the Accept header (e.g. application/json)
352
- def select_header_accept(accepts)
353
- return nil if accepts.nil? || accepts.empty?
354
- # use JSON when present, otherwise use all of the provided
355
- json_accept = accepts.find { |s| json_mime?(s) }
356
- return json_accept || accepts.join(',')
357
- end
358
-
359
- # Return Content-Type header based on an array of content types provided.
360
- # @param [Array] content_types array for Content-Type
361
- # @return [String] the Content-Type header (e.g. application/json)
362
- def select_header_content_type(content_types)
363
- # use application/json by default
364
- return 'application/json' if content_types.nil? || content_types.empty?
365
- # use JSON when present, otherwise use the first one
366
- json_content_type = content_types.find { |s| json_mime?(s) }
367
- return json_content_type || content_types.first
368
- end
369
-
370
- # Convert object (array, hash, object, etc) to JSON string.
371
- # @param [Object] model object to be converted into JSON string
372
- # @return [String] JSON string representation of the object
373
- def object_to_http_body(model)
374
- return '"' + model + '"' if model.is_a?(String)
375
- return model if model.nil?
376
- local_body = nil
377
- if model.is_a?(Array)
378
- local_body = model.map{|m| object_to_hash(m) }
379
- else
380
- local_body = object_to_hash(model)
381
- end
382
- local_body.to_json
383
- end
384
-
385
- # Convert object(non-array) to hash.
386
- # @param [Object] obj object to be converted into JSON string
387
- # @return [String] JSON string representation of the object
388
- def object_to_hash(obj)
389
- if obj.respond_to?(:to_hash)
390
- obj.to_hash
391
- else
392
- obj
393
- end
394
- end
395
-
396
- # Build parameter value according to the given collection format.
397
- # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
398
- def build_collection_param(param, collection_format)
399
- case collection_format
400
- when :csv
401
- param.join(',')
402
- when :ssv
403
- param.join(' ')
404
- when :tsv
405
- param.join("\t")
406
- when :pipes
407
- param.join('|')
408
- when :multi
409
- # return the array directly as faraday will handle it as expected
410
- param
411
- else
412
- fail "unknown collection format: #{collection_format.inspect}"
413
- end
414
- end
415
-
416
- # Request access and refresh tokens if needed
417
- def request_token_if_needed
418
- if @config.self_host
419
- return
420
- end
421
- # check token exists
422
- if @config.access_token
423
- return
424
- end
425
-
426
- # resource path
427
- local_var_path = "/connect/token"
428
- tokenUrl = build_request_url(local_var_path).gsub('/v3.0', '')
429
- print("\nbase_url: " + config.base_url + "\n")
430
- print("\ntokenUrl: " + tokenUrl + "\n")
431
-
432
- # header parameters
433
- header_params = {}
434
- # HTTP header 'Content-Type'
435
- header_params['Content-Type'] = select_header_content_type(['application/x-www-form-urlencoded'])
436
-
437
- query_params = {}
438
- # form parameters
439
- form_params = {}
440
- form_params["grant_type"] = 'client_credentials'
441
- form_params["client_id"] = @config.app_sid
442
- form_params["client_secret"] = @config.app_key
443
-
444
- body = {}
445
-
446
- req_opts = {
447
- :headers => header_params,
448
- :params => query_params,
449
- :body => body
450
- }
451
-
452
- req_body = build_request_body(header_params, form_params, body)
453
- req_opts.update :body => req_body
454
-
455
- req_opts[:params] = query_params
456
-
457
- conn = Faraday.new tokenUrl, {:params => query_params, :headers => header_params} do |f|
458
- f.request :multipart
459
- f.request :url_encoded
460
- f.adapter Faraday.default_adapter
461
- end
462
-
463
- if req_opts[:body] == {}
464
- req_opts[:body] = nil
465
- end
466
-
467
- response = conn.post tokenUrl, form_params, req_opts[:body]
468
-
469
- begin
470
- data = JSON.parse("[#{response.body}]", :symbolize_names => true)[0]
471
- rescue Exception => exception
472
- raise ApiError.new(response.body)
473
- end
474
-
475
- if data.nil? || data[:access_token].nil? || data[:access_token] == ""
476
- raise("empty token (#{response.body})")
477
- end
478
- @config.access_token = data[:access_token]
479
- end
480
-
481
- # Adds OAuth2.0 token
482
- def add_o_auth_token(req_opts)
483
- req_opts[:headers][:Authorization] = "Bearer " + @config.access_token
484
- end
485
-
486
- end
487
- end
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2025 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 'json'
24
+ require 'logger'
25
+ require 'tempfile'
26
+ require 'uri'
27
+ require 'faraday'
28
+ require 'faraday/multipart'
29
+ require_relative 'version'
30
+ require_relative 'api_error'
31
+
32
+ module AsposePdfCloud
33
+ #
34
+ # api client is mainly responsible for making the HTTP call to the API backend.
35
+ #
36
+ class ApiClient
37
+
38
+ # The Configuration object holding settings to be used in the API client.
39
+ attr_accessor :config
40
+
41
+ # Defines the headers to be used in HTTP requests of all API calls by default.
42
+ #
43
+ # @return [Hash]
44
+ attr_accessor :default_headers
45
+
46
+ # Initializes the ApiClient
47
+ # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
48
+ def initialize(config = Configuration.default)
49
+ @config = config
50
+ @default_headers = {
51
+ 'Content-Type' => "application/json",
52
+ 'x-aspose-client' => "ruby sdk",
53
+ 'x-aspose-client-version' => "#{ AsposePdfCloud::VERSION }"
54
+ }
55
+ end
56
+
57
+ def self.default
58
+ @@default ||= ApiClient.new
59
+ end
60
+
61
+ # Call an API with given options.
62
+ #
63
+ # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
64
+ # the data deserialized from response body (could be nil), response status code and response headers.
65
+ def call_api(http_method, path, opts = {})
66
+ response = build_request(http_method, path, opts)
67
+ download_file response if opts[:return_type] == 'File'
68
+ if @config.debugging
69
+ @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
70
+ end
71
+
72
+ unless response.success?
73
+ if response.status == 0
74
+ # Errors from libcurl will be made visible here
75
+ fail ApiError.new(:code => 0,
76
+ :message => response.reason_phrase)
77
+ else
78
+ fail ApiError.new(:code => response.status,
79
+ :response_headers => response.headers,
80
+ :response_body => response.body),
81
+ response.reason_phrase
82
+ end
83
+ end
84
+
85
+ if opts[:return_type]
86
+ data = deserialize(response, opts[:return_type])
87
+ else
88
+ data = nil
89
+ end
90
+ [data, response.status, response.headers]
91
+ end
92
+
93
+ # Builds the HTTP request
94
+ #
95
+ # @param [String] http_method HTTP method/verb (e.g. POST)
96
+ # @param [String] path URL path (e.g. /account/new)
97
+ # @option opts [Hash] :header_params Header parameters
98
+ # @option opts [Hash] :query_params Query parameters
99
+ # @option opts [Hash] :form_params Query parameters
100
+ # @option opts [Object] :body HTTP body (JSON/XML)
101
+ # @return [Faraday::Response] A Faraday Response
102
+ def build_request(http_method, path, opts = {})
103
+ url = build_request_url(path)
104
+ http_method = http_method.to_sym.downcase
105
+
106
+ header_params = @default_headers.merge(opts[:header_params] || {})
107
+ query_params = opts[:query_params] || {}
108
+ form_params = opts[:form_params] || {}
109
+ body = opts[:body] || {}
110
+
111
+ if !@config.self_host
112
+ update_params_for_auth! header_params, query_params, opts[:auth_names]
113
+ end
114
+
115
+ req_opts = {
116
+ :method => http_method,
117
+ :headers => header_params,
118
+ :params => query_params,
119
+ :body => body
120
+ }
121
+
122
+ if [:post, :patch, :put, :delete].include?(http_method)
123
+ req_body = build_request_body(header_params, form_params, opts[:body])
124
+ req_opts.update :body => req_body
125
+ if @config.debugging
126
+ @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
127
+ end
128
+ end
129
+
130
+ req_opts[:params] = opts[:query_params]
131
+
132
+ if !@config.self_host
133
+ # OAuth 2.0
134
+ add_o_auth_token(req_opts)
135
+ end
136
+
137
+ conn = Faraday.new url, {:params => query_params, :headers => header_params} do |f|
138
+ f.options.params_encoder = Faraday::FlatParamsEncoder
139
+ f.request :multipart
140
+ f.request :url_encoded
141
+ f.adapter Faraday.default_adapter
142
+ end
143
+
144
+ if req_opts[:body] == {}
145
+ req_opts[:body] = nil
146
+ end
147
+
148
+ case http_method
149
+ when :post
150
+ return conn.post url, req_opts[:body]
151
+ when :put
152
+ return conn.put url, req_opts[:body]
153
+ when :get
154
+ return conn.get url, req_opts[:body]
155
+ else
156
+ return conn.delete url do |c|
157
+ c.body = req_opts[:body]
158
+ end
159
+ end
160
+ end
161
+
162
+ # Check if the given MIME is a JSON MIME.
163
+ # JSON MIME examples:
164
+ # application/json
165
+ # application/json; charset=UTF8
166
+ # APPLICATION/JSON
167
+ # */*
168
+ # @param [String] mime MIME
169
+ # @return [Boolean] True if the MIME is application/json
170
+ def json_mime?(mime)
171
+ (mime == "*/*") || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
172
+ end
173
+
174
+ # Deserialize the response to the given return type.
175
+ #
176
+ # @param [Response] response HTTP response
177
+ # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
178
+ def deserialize(response, return_type)
179
+ body = response.body
180
+
181
+ # handle file downloading - return the File instance processed in request callbacks
182
+ # note that response body is empty when the file is written in chunks in request on_body callback
183
+ return @tempfile if return_type == 'File'
184
+
185
+ return nil if body.nil? || body.empty?
186
+
187
+ # return response body directly for String return type
188
+ return body if return_type == 'String'
189
+
190
+ # ensuring a default content type
191
+ content_type = response.headers['Content-Type'] || 'application/json'
192
+
193
+ raise "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
194
+
195
+ begin
196
+ data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
197
+ rescue JSON::ParserError => e
198
+ if %w(String Date DateTime).include?(return_type)
199
+ data = body
200
+ else
201
+ raise e
202
+ end
203
+ end
204
+
205
+ convert_to_type data, return_type
206
+ end
207
+
208
+ # Convert data to the given return type.
209
+ # @param [Object] data Data to be converted
210
+ # @param [String] return_type Return type
211
+ # @return [Mixed] Data in a particular type
212
+ def convert_to_type(data, return_type)
213
+ return nil if data.nil?
214
+ case return_type
215
+ when 'String'
216
+ data.to_s
217
+ when 'Integer'
218
+ data.to_i
219
+ when 'Float'
220
+ data.to_f
221
+ when 'BOOLEAN'
222
+ data == true
223
+ when 'DateTime'
224
+ # parse date time (expecting ISO 8601 format)
225
+ DateTime.parse data
226
+ when 'Date'
227
+ # parse date time (expecting ISO 8601 format)
228
+ Date.parse data
229
+ when 'Object'
230
+ # generic object (usually a Hash), return directly
231
+ data
232
+ when /\AArray<(.+)>\z/
233
+ # e.g. Array<Pet>
234
+ sub_type = $1
235
+ data.map {|item| convert_to_type(item, sub_type) }
236
+ when /\AHash\<String, (.+)\>\z/
237
+ # e.g. Hash<String, Integer>
238
+ sub_type = $1
239
+ {}.tap do |hash|
240
+ data.each {|k, v| hash[k] = convert_to_type(v, sub_type) }
241
+ end
242
+ else
243
+ # models, e.g. Pet
244
+ AsposePdfCloud.const_get(return_type).new.tap do |model|
245
+ model.build_from_hash data
246
+ end
247
+ end
248
+ end
249
+
250
+ # Save response body into a file in (the defined) temporary folder, using the filename
251
+ # from the "Content-Disposition" header if provided, otherwise a random filename.
252
+ # The response body is written to the file in chunks in order to handle files which
253
+ # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
254
+ # process can use.
255
+ #
256
+ # @see Configuration#temp_folder_path
257
+ def download_file(response)
258
+ tempfile = nil
259
+ encoding = nil
260
+ content_disposition = response.headers['Content-Disposition']
261
+ if content_disposition and content_disposition =~ /filename=/i
262
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
263
+ prefix = sanitize_filename(filename)
264
+ else
265
+ prefix = 'download-'
266
+ end
267
+ prefix = prefix + '-' unless prefix.end_with?('-')
268
+ encoding = response.body.encoding
269
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
270
+ @tempfile = tempfile
271
+ tempfile.write(response.body)
272
+ response.on_complete do |resp|
273
+ tempfile.close
274
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
275
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
276
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
277
+ "explicitly with `tempfile.delete`"
278
+ end
279
+ end
280
+
281
+ # Sanitize filename by removing path.
282
+ # e.g. ../../sun.gif becomes sun.gif
283
+ #
284
+ # @param [String] filename the filename to be sanitized
285
+ # @return [String] the sanitized filename
286
+ def sanitize_filename(filename)
287
+ filename.gsub(/.*[\/\\]/, '')
288
+ end
289
+
290
+ def build_request_url(path)
291
+ # Add leading and trailing slashes to path
292
+ path = "/#{path}".gsub(/\/+/, '/')
293
+ URI::Parser.new.escape(@config.base_url + path).to_s
294
+ end
295
+
296
+ # Builds the HTTP request body
297
+ #
298
+ # @param [Hash] header_params Header parameters
299
+ # @param [Hash] form_params Query parameters
300
+ # @param [Object] body HTTP body (JSON/XML)
301
+ # @return [String] HTTP body data in the form of string
302
+ def build_request_body(header_params, form_params, body)
303
+ # http form
304
+ if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
305
+ header_params['Content-Type'] == 'multipart/form-data'
306
+ data = {}
307
+ form_params.each do |key, value|
308
+ case value
309
+ when ::File
310
+ data[key] = Faraday::UploadIO.new(value.path, MimeMagic.by_magic(value).to_s, key)
311
+ when ::Array, nil
312
+ data[key] = value
313
+ else
314
+ data[key] = value.to_s
315
+ end
316
+ end
317
+ elsif body
318
+ data = body.is_a?(String) ? body : body.to_json
319
+ else
320
+ data = nil
321
+ end
322
+ data
323
+ end
324
+
325
+ # Update hearder and query params based on authentication settings.
326
+ #
327
+ # @param [Hash] header_params Header parameters
328
+ # @param [Hash] query_params Query parameters
329
+ # @param [String] auth_names Authentication scheme name
330
+ def update_params_for_auth!(header_params, query_params, auth_names)
331
+ Array(auth_names).each do |auth_name|
332
+ auth_setting = @config.auth_settings[auth_name]
333
+ next unless auth_setting
334
+ case auth_setting[:in]
335
+ when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
336
+ when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
337
+ else raise ArgumentError, 'Authentication token must be in `query` of `header`'
338
+ end
339
+ end
340
+ end
341
+
342
+ # Sets user agent in HTTP header
343
+ #
344
+ # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
345
+ def user_agent=(user_agent)
346
+ @user_agent = user_agent
347
+ @default_headers['User-Agent'] = @user_agent
348
+ end
349
+
350
+ # Return Accept header based on an array of accepts provided.
351
+ # @param [Array] accepts array for Accept
352
+ # @return [String] the Accept header (e.g. application/json)
353
+ def select_header_accept(accepts)
354
+ return nil if accepts.nil? || accepts.empty?
355
+ # use JSON when present, otherwise use all of the provided
356
+ json_accept = accepts.find { |s| json_mime?(s) }
357
+ return json_accept || accepts.join(',')
358
+ end
359
+
360
+ # Return Content-Type header based on an array of content types provided.
361
+ # @param [Array] content_types array for Content-Type
362
+ # @return [String] the Content-Type header (e.g. application/json)
363
+ def select_header_content_type(content_types)
364
+ # use application/json by default
365
+ return 'application/json' if content_types.nil? || content_types.empty?
366
+ # use JSON when present, otherwise use the first one
367
+ json_content_type = content_types.find { |s| json_mime?(s) }
368
+ return json_content_type || content_types.first
369
+ end
370
+
371
+ # Convert object (array, hash, object, etc) to JSON string.
372
+ # @param [Object] model object to be converted into JSON string
373
+ # @return [String] JSON string representation of the object
374
+ def object_to_http_body(model)
375
+ return '"' + model + '"' if model.is_a?(String)
376
+ return model if model.nil?
377
+ local_body = nil
378
+ if model.is_a?(Array)
379
+ local_body = model.map{|m| object_to_hash(m) }
380
+ else
381
+ local_body = object_to_hash(model)
382
+ end
383
+ local_body.to_json
384
+ end
385
+
386
+ # Convert object(non-array) to hash.
387
+ # @param [Object] obj object to be converted into JSON string
388
+ # @return [String] JSON string representation of the object
389
+ def object_to_hash(obj)
390
+ if obj.respond_to?(:to_hash)
391
+ obj.to_hash
392
+ else
393
+ obj
394
+ end
395
+ end
396
+
397
+ # Build parameter value according to the given collection format.
398
+ # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
399
+ def build_collection_param(param, collection_format)
400
+ case collection_format
401
+ when :csv
402
+ param.join(',')
403
+ when :ssv
404
+ param.join(' ')
405
+ when :tsv
406
+ param.join("\t")
407
+ when :pipes
408
+ param.join('|')
409
+ when :multi
410
+ # return the array directly as faraday will handle it as expected
411
+ param
412
+ else
413
+ fail "unknown collection format: #{collection_format.inspect}"
414
+ end
415
+ end
416
+
417
+ # Request access and refresh tokens if needed
418
+ def request_token_if_needed
419
+ if @config.self_host
420
+ return
421
+ end
422
+ # check token exists
423
+ if @config.access_token
424
+ return
425
+ end
426
+
427
+ # resource path
428
+ local_var_path = "/connect/token"
429
+ tokenUrl = build_request_url(local_var_path).gsub('/v3.0', '')
430
+ print("\nbase_url: " + config.base_url + "\n")
431
+ print("\ntokenUrl: " + tokenUrl + "\n")
432
+
433
+ # header parameters
434
+ header_params = {}
435
+ # HTTP header 'Content-Type'
436
+ header_params['Content-Type'] = select_header_content_type(['application/x-www-form-urlencoded'])
437
+
438
+ query_params = {}
439
+ # form parameters
440
+ form_params = {}
441
+ form_params["grant_type"] = 'client_credentials'
442
+ form_params["client_id"] = @config.app_sid
443
+ form_params["client_secret"] = @config.app_key
444
+
445
+ body = {}
446
+
447
+ req_opts = {
448
+ :headers => header_params,
449
+ :params => query_params,
450
+ :body => body
451
+ }
452
+
453
+ req_body = build_request_body(header_params, form_params, body)
454
+ req_opts.update :body => req_body
455
+
456
+ req_opts[:params] = query_params
457
+
458
+ conn = Faraday.new tokenUrl, {:params => query_params, :headers => header_params} do |f|
459
+ f.request :multipart
460
+ f.request :url_encoded
461
+ f.adapter Faraday.default_adapter
462
+ end
463
+
464
+ if req_opts[:body] == {}
465
+ req_opts[:body] = nil
466
+ end
467
+
468
+ response = conn.post tokenUrl, form_params, req_opts[:body]
469
+
470
+ begin
471
+ data = JSON.parse("[#{response.body}]", :symbolize_names => true)[0]
472
+ rescue Exception => exception
473
+ raise ApiError.new(response.body)
474
+ end
475
+
476
+ if data.nil? || data[:access_token].nil? || data[:access_token] == ""
477
+ raise("empty token (#{response.body})")
478
+ end
479
+ @config.access_token = data[:access_token]
480
+ end
481
+
482
+ # Adds OAuth2.0 token
483
+ def add_o_auth_token(req_opts)
484
+ req_opts[:headers][:Authorization] = "Bearer " + @config.access_token
485
+ end
486
+
487
+ end
488
+ end