factpulse 3.0.7__py3-none-any.whl → 3.0.23__py3-none-any.whl

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.

Potentially problematic release.


This version of factpulse might be problematic. Click here for more details.

Files changed (305) hide show
  1. factpulse/__init__.py +289 -12
  2. factpulse/api/__init__.py +2 -0
  3. factpulse/api/afnorpdppa_api.py +16 -14
  4. factpulse/api/afnorpdppa_directory_service_api.py +1224 -309
  5. factpulse/api/afnorpdppa_flow_service_api.py +199 -68
  6. factpulse/api/chorus_pro_api.py +61 -8
  7. factpulse/api/document_conversion_api.py +54 -338
  8. factpulse/api/downloads_api.py +1171 -0
  9. factpulse/api/e_reporting_api.py +3254 -0
  10. factpulse/api/health_api.py +8 -1
  11. factpulse/api/invoice_processing_api.py +234 -37
  12. factpulse/api/pdfxml_verification_api.py +98 -19
  13. factpulse/api/user_api.py +5 -1
  14. factpulse/api_client.py +3 -2
  15. factpulse/configuration.py +10 -5
  16. factpulse/exceptions.py +2 -1
  17. factpulse/models/__init__.py +143 -6
  18. factpulse/models/accept_language.py +38 -0
  19. factpulse/models/acknowledgment_status.py +2 -1
  20. factpulse/models/additional_document.py +2 -1
  21. factpulse/models/afnor_acknowledgement.py +100 -0
  22. factpulse/models/afnor_acknowledgement_detail.py +105 -0
  23. factpulse/models/afnor_address_edit.py +111 -0
  24. factpulse/models/afnor_address_patch.py +141 -0
  25. factpulse/models/afnor_address_put.py +129 -0
  26. factpulse/models/afnor_address_read.py +113 -0
  27. factpulse/models/afnor_algorithm.py +41 -0
  28. factpulse/models/afnor_contains_operator.py +37 -0
  29. factpulse/models/afnor_create_directory_line_body.py +98 -0
  30. factpulse/models/afnor_create_directory_line_body_addressing_information.py +122 -0
  31. factpulse/models/afnor_create_directory_line_body_period.py +91 -0
  32. factpulse/models/afnor_create_routing_code_body.py +153 -0
  33. factpulse/models/afnor_credentials.py +2 -1
  34. factpulse/models/afnor_destination.py +15 -15
  35. factpulse/models/afnor_diffusion_status.py +38 -0
  36. factpulse/models/afnor_directory_line_field.py +42 -0
  37. factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code.py +139 -0
  38. factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_platform.py +92 -0
  39. factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_routing_code.py +134 -0
  40. factpulse/models/afnor_directory_line_post201_response.py +94 -0
  41. factpulse/models/afnor_directory_line_search_post200_response.py +104 -0
  42. factpulse/models/afnor_entity_type.py +38 -0
  43. factpulse/models/afnor_error.py +97 -0
  44. factpulse/models/afnor_facility_administrative_status.py +38 -0
  45. factpulse/models/afnor_facility_nature.py +38 -0
  46. factpulse/models/afnor_facility_payload_history.py +140 -0
  47. factpulse/models/afnor_facility_payload_history_ule_b2g_additional_data.py +98 -0
  48. factpulse/models/afnor_facility_payload_included.py +134 -0
  49. factpulse/models/afnor_facility_type.py +38 -0
  50. factpulse/models/afnor_flow.py +129 -0
  51. factpulse/models/afnor_flow_ack_status.py +39 -0
  52. factpulse/models/afnor_flow_direction.py +38 -0
  53. factpulse/models/afnor_flow_info.py +112 -0
  54. factpulse/models/afnor_flow_profile.py +39 -0
  55. factpulse/models/afnor_flow_syntax.py +41 -0
  56. factpulse/models/afnor_flow_type.py +49 -0
  57. factpulse/models/afnor_full_flow_info.py +117 -0
  58. factpulse/models/afnor_health_check_response.py +2 -1
  59. factpulse/models/afnor_legal_unit_administrative_status.py +38 -0
  60. factpulse/models/afnor_legal_unit_payload_history.py +107 -0
  61. factpulse/models/afnor_legal_unit_payload_included.py +107 -0
  62. factpulse/models/afnor_legal_unit_payload_included_no_siren.py +95 -0
  63. factpulse/models/afnor_platform_status.py +38 -0
  64. factpulse/models/afnor_processing_rule.py +42 -0
  65. factpulse/models/afnor_reason_code.py +141 -0
  66. factpulse/models/afnor_reason_code_enum.py +51 -0
  67. factpulse/models/afnor_recipient_platform_type.py +38 -0
  68. factpulse/models/afnor_result.py +25 -3
  69. factpulse/models/afnor_routing_code_administrative_status.py +38 -0
  70. factpulse/models/afnor_routing_code_field.py +44 -0
  71. factpulse/models/afnor_routing_code_payload_history_legal_unit_facility.py +158 -0
  72. factpulse/models/afnor_routing_code_post201_response.py +113 -0
  73. factpulse/models/afnor_routing_code_search.py +122 -0
  74. factpulse/models/afnor_routing_code_search_filters.py +128 -0
  75. factpulse/models/afnor_routing_code_search_filters_administrative_status.py +92 -0
  76. factpulse/models/afnor_routing_code_search_filters_routing_code_name.py +102 -0
  77. factpulse/models/afnor_routing_code_search_filters_routing_identifier.py +102 -0
  78. factpulse/models/afnor_routing_code_search_post200_response.py +104 -0
  79. factpulse/models/afnor_routing_code_search_sorting_inner.py +92 -0
  80. factpulse/models/afnor_search_directory_line.py +109 -0
  81. factpulse/models/afnor_search_directory_line_filters.py +116 -0
  82. factpulse/models/afnor_search_directory_line_filters_addressing_identifier.py +92 -0
  83. factpulse/models/afnor_search_directory_line_filters_addressing_suffix.py +92 -0
  84. factpulse/models/afnor_search_directory_line_sorting_inner.py +92 -0
  85. factpulse/models/afnor_search_flow_content.py +104 -0
  86. factpulse/models/afnor_search_flow_filters.py +106 -0
  87. factpulse/models/afnor_search_flow_params.py +95 -0
  88. factpulse/models/afnor_search_siren.py +109 -0
  89. factpulse/models/afnor_search_siren_filters.py +110 -0
  90. factpulse/models/afnor_search_siren_filters_administrative_status.py +92 -0
  91. factpulse/models/afnor_search_siren_filters_business_name.py +92 -0
  92. factpulse/models/afnor_search_siren_filters_entity_type.py +92 -0
  93. factpulse/models/afnor_search_siren_filters_siren.py +102 -0
  94. factpulse/models/afnor_search_siren_sorting_inner.py +92 -0
  95. factpulse/models/afnor_search_siret.py +122 -0
  96. factpulse/models/afnor_search_siret_filters.py +140 -0
  97. factpulse/models/afnor_search_siret_filters_address_lines.py +92 -0
  98. factpulse/models/afnor_search_siret_filters_administrative_status.py +92 -0
  99. factpulse/models/afnor_search_siret_filters_country_subdivision.py +92 -0
  100. factpulse/models/afnor_search_siret_filters_facility_type.py +92 -0
  101. factpulse/models/afnor_search_siret_filters_locality.py +92 -0
  102. factpulse/models/afnor_search_siret_filters_name.py +92 -0
  103. factpulse/models/afnor_search_siret_filters_postal_code.py +102 -0
  104. factpulse/models/afnor_search_siret_filters_siret.py +102 -0
  105. factpulse/models/afnor_search_siret_sorting_inner.py +92 -0
  106. factpulse/models/afnor_siren_field.py +41 -0
  107. factpulse/models/afnor_siren_search_post200_response.py +104 -0
  108. factpulse/models/afnor_siret_field.py +50 -0
  109. factpulse/models/afnor_siret_search_post200_response.py +104 -0
  110. factpulse/models/afnor_sorting_order.py +38 -0
  111. factpulse/models/afnor_strict_operator.py +37 -0
  112. factpulse/models/afnor_update_patch_directory_line_body.py +89 -0
  113. factpulse/models/afnor_update_patch_routing_code_body.py +120 -0
  114. factpulse/models/afnor_update_put_routing_code_body.py +114 -0
  115. factpulse/models/afnor_webhook_callback_content.py +92 -0
  116. factpulse/models/aggregated_payment_input.py +106 -0
  117. factpulse/models/aggregated_transaction_input.py +136 -0
  118. factpulse/models/allowance_charge.py +9 -6
  119. factpulse/models/allowance_charge_reason_code.py +74 -0
  120. factpulse/models/allowance_reason_code.py +2 -1
  121. factpulse/models/allowance_total_amount.py +2 -1
  122. factpulse/models/amount.py +3 -2
  123. factpulse/models/amount1.py +140 -0
  124. factpulse/models/amount_due.py +2 -1
  125. factpulse/models/api_error.py +2 -1
  126. factpulse/models/api_profile.py +41 -0
  127. factpulse/models/async_task_status.py +2 -1
  128. factpulse/models/base_amount.py +2 -1
  129. factpulse/models/bounding_box_schema.py +2 -1
  130. factpulse/models/buyercountry.py +137 -0
  131. factpulse/models/celery_status.py +2 -1
  132. factpulse/models/certificate_info_response.py +2 -1
  133. factpulse/models/charge_total_amount.py +2 -1
  134. factpulse/models/{facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.py → chorus_pro_credentials.py} +5 -4
  135. factpulse/models/chorus_pro_destination.py +2 -1
  136. factpulse/models/chorus_pro_result.py +2 -1
  137. factpulse/models/contact.py +2 -1
  138. factpulse/models/convert_resume_request.py +2 -1
  139. factpulse/models/convert_success_response.py +2 -1
  140. factpulse/models/convert_validation_failed_response.py +7 -6
  141. factpulse/models/country_code.py +206 -0
  142. factpulse/models/create_aggregated_report_request.py +170 -0
  143. factpulse/models/create_e_reporting_request.py +173 -0
  144. factpulse/models/currency.py +137 -0
  145. factpulse/models/currency_code.py +89 -0
  146. factpulse/models/delivery_party.py +2 -1
  147. factpulse/models/destination.py +2 -1
  148. factpulse/models/directory_line_include.py +40 -0
  149. factpulse/models/doc_type.py +40 -0
  150. factpulse/models/document_type_info.py +2 -1
  151. factpulse/models/e_reporting_flow_type.py +40 -0
  152. factpulse/models/{convert_error_response.py → e_reporting_validation_error.py} +15 -23
  153. factpulse/models/electronic_address.py +4 -3
  154. factpulse/models/enriched_invoice_info.py +8 -7
  155. factpulse/models/error_level.py +2 -1
  156. factpulse/models/error_source.py +2 -1
  157. factpulse/models/extraction_info.py +2 -1
  158. factpulse/models/factur_x_invoice.py +2 -1
  159. factpulse/models/factur_xpdf_info.py +2 -1
  160. factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.py +41 -0
  161. factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.py +2 -1
  162. factpulse/models/field_status.py +2 -1
  163. factpulse/models/file_info.py +2 -1
  164. factpulse/models/files_info.py +2 -1
  165. factpulse/models/flow_direction.py +2 -1
  166. factpulse/models/flow_profile.py +2 -1
  167. factpulse/models/flow_summary.py +5 -4
  168. factpulse/models/flow_syntax.py +2 -1
  169. factpulse/models/flow_type.py +12 -3
  170. factpulse/models/generate_aggregated_report_response.py +100 -0
  171. factpulse/models/generate_certificate_request.py +2 -1
  172. factpulse/models/generate_certificate_response.py +2 -1
  173. factpulse/models/generate_e_reporting_response.py +96 -0
  174. factpulse/models/get_chorus_pro_id_request.py +5 -4
  175. factpulse/models/get_chorus_pro_id_response.py +2 -1
  176. factpulse/models/get_invoice_request.py +5 -4
  177. factpulse/models/get_invoice_response.py +4 -3
  178. factpulse/models/get_structure_request.py +5 -4
  179. factpulse/models/get_structure_response.py +4 -3
  180. factpulse/models/global_allowance_amount.py +2 -1
  181. factpulse/models/gross_unit_price.py +2 -1
  182. factpulse/models/http_validation_error.py +2 -1
  183. factpulse/models/incoming_invoice.py +8 -29
  184. factpulse/models/incoming_supplier.py +2 -1
  185. factpulse/models/invoice_format.py +2 -1
  186. factpulse/models/invoice_input.py +179 -0
  187. factpulse/models/invoice_line.py +18 -2
  188. factpulse/models/invoice_line_allowance_amount.py +2 -1
  189. factpulse/models/invoice_note.py +4 -3
  190. factpulse/models/invoice_payment_input.py +110 -0
  191. factpulse/models/invoice_references.py +2 -1
  192. factpulse/models/invoice_status.py +2 -1
  193. factpulse/models/invoice_totals.py +2 -1
  194. factpulse/models/invoice_totals_prepayment.py +2 -1
  195. factpulse/models/invoice_type_code.py +2 -1
  196. factpulse/models/invoice_type_code_output.py +52 -0
  197. factpulse/models/invoicing_framework.py +4 -3
  198. factpulse/models/invoicing_framework_code.py +2 -1
  199. factpulse/models/line_net_amount.py +2 -1
  200. factpulse/models/line_sub_type.py +39 -0
  201. factpulse/models/line_total_amount.py +2 -1
  202. factpulse/models/{validation_error_loc_inner.py → location_inner.py} +8 -7
  203. factpulse/models/mandatory_note_schema.py +2 -1
  204. factpulse/models/manual_rate.py +2 -1
  205. factpulse/models/manual_vat_rate.py +2 -1
  206. factpulse/models/missing_field.py +2 -1
  207. factpulse/models/operation_nature.py +2 -1
  208. factpulse/models/output_format.py +2 -1
  209. factpulse/models/page_dimensions_schema.py +2 -1
  210. factpulse/models/payee.py +2 -1
  211. factpulse/models/payment_amount_by_rate.py +98 -0
  212. factpulse/models/payment_card.py +2 -1
  213. factpulse/models/payment_means.py +2 -1
  214. factpulse/models/pdf_validation_result_api.py +2 -1
  215. factpulse/models/pdp_credentials.py +2 -1
  216. factpulse/models/percentage.py +2 -1
  217. factpulse/models/postal_address.py +2 -1
  218. factpulse/models/price_allowance_amount.py +2 -1
  219. factpulse/models/price_basis_quantity.py +2 -1
  220. factpulse/models/processing_options.py +4 -3
  221. factpulse/models/processing_rule.py +42 -0
  222. factpulse/models/product_characteristic.py +2 -1
  223. factpulse/models/product_classification.py +2 -1
  224. factpulse/models/quantity.py +2 -1
  225. factpulse/models/rate.py +140 -0
  226. factpulse/models/rate1.py +140 -0
  227. factpulse/models/recipient.py +2 -1
  228. factpulse/models/report_period.py +91 -0
  229. factpulse/models/report_sender.py +98 -0
  230. factpulse/models/rounding_amount.py +2 -1
  231. factpulse/models/routing_code_include.py +38 -0
  232. factpulse/models/schematron_validation_error.py +128 -0
  233. factpulse/models/scheme_id.py +9 -1
  234. factpulse/models/search_flow_request.py +2 -1
  235. factpulse/models/search_flow_response.py +2 -1
  236. factpulse/models/search_services_response.py +5 -4
  237. factpulse/models/search_structure_request.py +5 -4
  238. factpulse/models/search_structure_response.py +2 -1
  239. factpulse/models/sellercountry.py +137 -0
  240. factpulse/models/signature_info.py +2 -1
  241. factpulse/models/signature_info_api.py +2 -1
  242. factpulse/models/signature_parameters.py +2 -1
  243. factpulse/models/simplified_invoice_data.py +30 -3
  244. factpulse/models/siret_include.py +37 -0
  245. factpulse/models/structure_info.py +2 -1
  246. factpulse/models/structure_parameters.py +2 -1
  247. factpulse/models/structure_service.py +2 -1
  248. factpulse/models/submission_mode.py +2 -1
  249. factpulse/models/submit_aggregated_report_request.py +127 -0
  250. factpulse/models/submit_complete_invoice_request.py +2 -1
  251. factpulse/models/submit_complete_invoice_response.py +2 -1
  252. factpulse/models/submit_e_reporting_request.py +127 -0
  253. factpulse/models/submit_e_reporting_response.py +117 -0
  254. factpulse/models/submit_flow_request.py +2 -1
  255. factpulse/models/submit_flow_response.py +2 -1
  256. factpulse/models/submit_gross_amount.py +2 -1
  257. factpulse/models/submit_invoice_request.py +5 -4
  258. factpulse/models/submit_invoice_response.py +2 -1
  259. factpulse/models/submit_net_amount.py +2 -1
  260. factpulse/models/submit_vat_amount.py +2 -1
  261. factpulse/models/supplementary_attachment.py +7 -6
  262. factpulse/models/supplier.py +2 -1
  263. factpulse/models/task_response.py +2 -1
  264. factpulse/models/tax_breakdown_input.py +104 -0
  265. factpulse/models/tax_due_date_type.py +42 -0
  266. factpulse/models/tax_representative.py +2 -1
  267. factpulse/models/taxable_amount.py +2 -1
  268. factpulse/models/taxableamount.py +140 -0
  269. factpulse/models/taxamount.py +140 -0
  270. factpulse/models/taxamount1.py +140 -0
  271. factpulse/models/taxamount2.py +140 -0
  272. factpulse/models/taxexclusiveamount.py +140 -0
  273. factpulse/models/taxexclusiveamount1.py +140 -0
  274. factpulse/models/total_gross_amount.py +2 -1
  275. factpulse/models/total_net_amount.py +2 -1
  276. factpulse/models/total_vat_amount.py +2 -1
  277. factpulse/models/transaction_category.py +40 -0
  278. factpulse/models/transmission_type_code.py +38 -0
  279. factpulse/models/unit_net_price.py +2 -1
  280. factpulse/models/unit_of_measure.py +2 -1
  281. factpulse/models/validate_e_reporting_request.py +92 -0
  282. factpulse/models/validate_e_reporting_response.py +113 -0
  283. factpulse/models/validation_error.py +5 -4
  284. factpulse/models/validation_error_detail.py +2 -1
  285. factpulse/models/validation_error_response.py +2 -1
  286. factpulse/models/validation_info.py +5 -4
  287. factpulse/models/validation_success_response.py +2 -1
  288. factpulse/models/vat_accounting_code.py +2 -1
  289. factpulse/models/vat_amount.py +2 -1
  290. factpulse/models/vat_category.py +2 -1
  291. factpulse/models/vat_line.py +2 -1
  292. factpulse/models/vat_point_date_code.py +2 -1
  293. factpulse/models/vat_rate.py +2 -1
  294. factpulse/models/verification_success_response.py +2 -1
  295. factpulse/models/verified_field_schema.py +2 -1
  296. factpulse/rest.py +2 -1
  297. {factpulse-3.0.7.dist-info → factpulse-3.0.23.dist-info}/METADATA +42 -40
  298. factpulse-3.0.23.dist-info/RECORD +306 -0
  299. {factpulse-3.0.7.dist-info → factpulse-3.0.23.dist-info}/licenses/LICENSE +1 -1
  300. factpulse_helpers/client.py +2 -1
  301. factpulse/models/convert_pending_input_response.py +0 -114
  302. factpulse/models/factur_x_profile.py +0 -39
  303. factpulse-3.0.7.dist-info/RECORD +0 -168
  304. {factpulse-3.0.7.dist-info → factpulse-3.0.23.dist-info}/WHEEL +0 -0
  305. {factpulse-3.0.7.dist-info → factpulse-3.0.23.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1171 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FactPulse REST API
5
+
6
+ REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: contact@factpulse.fr
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+ import warnings
16
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
17
+ from typing import Any, Dict, List, Optional, Tuple, Union
18
+ from typing_extensions import Annotated
19
+
20
+ from pydantic import Field, StrictBool, StrictStr
21
+ from typing import Any, Optional
22
+ from typing_extensions import Annotated
23
+
24
+ from factpulse.api_client import ApiClient, RequestSerialized
25
+ from factpulse.api_response import ApiResponse
26
+ from factpulse.rest import RESTResponseType
27
+
28
+
29
+ class DownloadsApi:
30
+ """NOTE: This class is auto generated by OpenAPI Generator
31
+ Ref: https://openapi-generator.tech
32
+
33
+ Do not edit the class manually.
34
+ """
35
+
36
+ def __init__(self, api_client=None) -> None:
37
+ if api_client is None:
38
+ api_client = ApiClient.get_default()
39
+ self.api_client = api_client
40
+
41
+
42
+ @validate_call
43
+ def check_file_api_v1_download_download_id_head(
44
+ self,
45
+ download_id: StrictStr,
46
+ _request_timeout: Union[
47
+ None,
48
+ Annotated[StrictFloat, Field(gt=0)],
49
+ Tuple[
50
+ Annotated[StrictFloat, Field(gt=0)],
51
+ Annotated[StrictFloat, Field(gt=0)]
52
+ ]
53
+ ] = None,
54
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
55
+ _content_type: Optional[StrictStr] = None,
56
+ _headers: Optional[Dict[StrictStr, Any]] = None,
57
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
58
+ ) -> object:
59
+ """Check if a file exists
60
+
61
+ Check if a temporary file exists and get its metadata without downloading. Useful for: - Verifying a download URL is still valid - Getting file size before downloading - Checking expiration time **Security**: Requires authentication, only file owner can check.
62
+
63
+ :param download_id: (required)
64
+ :type download_id: str
65
+ :param _request_timeout: timeout setting for this request. If one
66
+ number provided, it will be total request
67
+ timeout. It can also be a pair (tuple) of
68
+ (connection, read) timeouts.
69
+ :type _request_timeout: int, tuple(int, int), optional
70
+ :param _request_auth: set to override the auth_settings for an a single
71
+ request; this effectively ignores the
72
+ authentication in the spec for a single request.
73
+ :type _request_auth: dict, optional
74
+ :param _content_type: force content-type for the request.
75
+ :type _content_type: str, Optional
76
+ :param _headers: set to override the headers for a single
77
+ request; this effectively ignores the headers
78
+ in the spec for a single request.
79
+ :type _headers: dict, optional
80
+ :param _host_index: set to override the host_index for a single
81
+ request; this effectively ignores the host_index
82
+ in the spec for a single request.
83
+ :type _host_index: int, optional
84
+ :return: Returns the result object.
85
+ """ # noqa: E501
86
+
87
+ _param = self._check_file_api_v1_download_download_id_head_serialize(
88
+ download_id=download_id,
89
+ _request_auth=_request_auth,
90
+ _content_type=_content_type,
91
+ _headers=_headers,
92
+ _host_index=_host_index
93
+ )
94
+
95
+ _response_types_map: Dict[str, Optional[str]] = {
96
+ '200': "object",
97
+ '401': None,
98
+ '403': None,
99
+ '404': None,
100
+ '422': "HTTPValidationError",
101
+ }
102
+ response_data = self.api_client.call_api(
103
+ *_param,
104
+ _request_timeout=_request_timeout
105
+ )
106
+ response_data.read()
107
+ return self.api_client.response_deserialize(
108
+ response_data=response_data,
109
+ response_types_map=_response_types_map,
110
+ ).data
111
+
112
+
113
+ @validate_call
114
+ def check_file_api_v1_download_download_id_head_with_http_info(
115
+ self,
116
+ download_id: StrictStr,
117
+ _request_timeout: Union[
118
+ None,
119
+ Annotated[StrictFloat, Field(gt=0)],
120
+ Tuple[
121
+ Annotated[StrictFloat, Field(gt=0)],
122
+ Annotated[StrictFloat, Field(gt=0)]
123
+ ]
124
+ ] = None,
125
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
126
+ _content_type: Optional[StrictStr] = None,
127
+ _headers: Optional[Dict[StrictStr, Any]] = None,
128
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
129
+ ) -> ApiResponse[object]:
130
+ """Check if a file exists
131
+
132
+ Check if a temporary file exists and get its metadata without downloading. Useful for: - Verifying a download URL is still valid - Getting file size before downloading - Checking expiration time **Security**: Requires authentication, only file owner can check.
133
+
134
+ :param download_id: (required)
135
+ :type download_id: str
136
+ :param _request_timeout: timeout setting for this request. If one
137
+ number provided, it will be total request
138
+ timeout. It can also be a pair (tuple) of
139
+ (connection, read) timeouts.
140
+ :type _request_timeout: int, tuple(int, int), optional
141
+ :param _request_auth: set to override the auth_settings for an a single
142
+ request; this effectively ignores the
143
+ authentication in the spec for a single request.
144
+ :type _request_auth: dict, optional
145
+ :param _content_type: force content-type for the request.
146
+ :type _content_type: str, Optional
147
+ :param _headers: set to override the headers for a single
148
+ request; this effectively ignores the headers
149
+ in the spec for a single request.
150
+ :type _headers: dict, optional
151
+ :param _host_index: set to override the host_index for a single
152
+ request; this effectively ignores the host_index
153
+ in the spec for a single request.
154
+ :type _host_index: int, optional
155
+ :return: Returns the result object.
156
+ """ # noqa: E501
157
+
158
+ _param = self._check_file_api_v1_download_download_id_head_serialize(
159
+ download_id=download_id,
160
+ _request_auth=_request_auth,
161
+ _content_type=_content_type,
162
+ _headers=_headers,
163
+ _host_index=_host_index
164
+ )
165
+
166
+ _response_types_map: Dict[str, Optional[str]] = {
167
+ '200': "object",
168
+ '401': None,
169
+ '403': None,
170
+ '404': None,
171
+ '422': "HTTPValidationError",
172
+ }
173
+ response_data = self.api_client.call_api(
174
+ *_param,
175
+ _request_timeout=_request_timeout
176
+ )
177
+ response_data.read()
178
+ return self.api_client.response_deserialize(
179
+ response_data=response_data,
180
+ response_types_map=_response_types_map,
181
+ )
182
+
183
+
184
+ @validate_call
185
+ def check_file_api_v1_download_download_id_head_without_preload_content(
186
+ self,
187
+ download_id: StrictStr,
188
+ _request_timeout: Union[
189
+ None,
190
+ Annotated[StrictFloat, Field(gt=0)],
191
+ Tuple[
192
+ Annotated[StrictFloat, Field(gt=0)],
193
+ Annotated[StrictFloat, Field(gt=0)]
194
+ ]
195
+ ] = None,
196
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
197
+ _content_type: Optional[StrictStr] = None,
198
+ _headers: Optional[Dict[StrictStr, Any]] = None,
199
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
200
+ ) -> RESTResponseType:
201
+ """Check if a file exists
202
+
203
+ Check if a temporary file exists and get its metadata without downloading. Useful for: - Verifying a download URL is still valid - Getting file size before downloading - Checking expiration time **Security**: Requires authentication, only file owner can check.
204
+
205
+ :param download_id: (required)
206
+ :type download_id: str
207
+ :param _request_timeout: timeout setting for this request. If one
208
+ number provided, it will be total request
209
+ timeout. It can also be a pair (tuple) of
210
+ (connection, read) timeouts.
211
+ :type _request_timeout: int, tuple(int, int), optional
212
+ :param _request_auth: set to override the auth_settings for an a single
213
+ request; this effectively ignores the
214
+ authentication in the spec for a single request.
215
+ :type _request_auth: dict, optional
216
+ :param _content_type: force content-type for the request.
217
+ :type _content_type: str, Optional
218
+ :param _headers: set to override the headers for a single
219
+ request; this effectively ignores the headers
220
+ in the spec for a single request.
221
+ :type _headers: dict, optional
222
+ :param _host_index: set to override the host_index for a single
223
+ request; this effectively ignores the host_index
224
+ in the spec for a single request.
225
+ :type _host_index: int, optional
226
+ :return: Returns the result object.
227
+ """ # noqa: E501
228
+
229
+ _param = self._check_file_api_v1_download_download_id_head_serialize(
230
+ download_id=download_id,
231
+ _request_auth=_request_auth,
232
+ _content_type=_content_type,
233
+ _headers=_headers,
234
+ _host_index=_host_index
235
+ )
236
+
237
+ _response_types_map: Dict[str, Optional[str]] = {
238
+ '200': "object",
239
+ '401': None,
240
+ '403': None,
241
+ '404': None,
242
+ '422': "HTTPValidationError",
243
+ }
244
+ response_data = self.api_client.call_api(
245
+ *_param,
246
+ _request_timeout=_request_timeout
247
+ )
248
+ return response_data.response
249
+
250
+
251
+ def _check_file_api_v1_download_download_id_head_serialize(
252
+ self,
253
+ download_id,
254
+ _request_auth,
255
+ _content_type,
256
+ _headers,
257
+ _host_index,
258
+ ) -> RequestSerialized:
259
+
260
+ _host = None
261
+
262
+ _collection_formats: Dict[str, str] = {
263
+ }
264
+
265
+ _path_params: Dict[str, str] = {}
266
+ _query_params: List[Tuple[str, str]] = []
267
+ _header_params: Dict[str, Optional[str]] = _headers or {}
268
+ _form_params: List[Tuple[str, str]] = []
269
+ _files: Dict[
270
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
271
+ ] = {}
272
+ _body_params: Optional[bytes] = None
273
+
274
+ # process the path parameters
275
+ if download_id is not None:
276
+ _path_params['download_id'] = download_id
277
+ # process the query parameters
278
+ # process the header parameters
279
+ # process the form parameters
280
+ # process the body parameter
281
+
282
+
283
+ # set the HTTP header `Accept`
284
+ if 'Accept' not in _header_params:
285
+ _header_params['Accept'] = self.api_client.select_header_accept(
286
+ [
287
+ 'application/json'
288
+ ]
289
+ )
290
+
291
+
292
+ # authentication setting
293
+ _auth_settings: List[str] = [
294
+ 'HTTPBearer'
295
+ ]
296
+
297
+ return self.api_client.param_serialize(
298
+ method='HEAD',
299
+ resource_path='/api/v1/download/{download_id}',
300
+ path_params=_path_params,
301
+ query_params=_query_params,
302
+ header_params=_header_params,
303
+ body=_body_params,
304
+ post_params=_form_params,
305
+ files=_files,
306
+ auth_settings=_auth_settings,
307
+ collection_formats=_collection_formats,
308
+ _host=_host,
309
+ _request_auth=_request_auth
310
+ )
311
+
312
+
313
+
314
+
315
+ @validate_call
316
+ def check_file_api_v1_download_download_id_head_0(
317
+ self,
318
+ download_id: StrictStr,
319
+ _request_timeout: Union[
320
+ None,
321
+ Annotated[StrictFloat, Field(gt=0)],
322
+ Tuple[
323
+ Annotated[StrictFloat, Field(gt=0)],
324
+ Annotated[StrictFloat, Field(gt=0)]
325
+ ]
326
+ ] = None,
327
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
328
+ _content_type: Optional[StrictStr] = None,
329
+ _headers: Optional[Dict[StrictStr, Any]] = None,
330
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
331
+ ) -> object:
332
+ """Check if a file exists
333
+
334
+ Check if a temporary file exists and get its metadata without downloading. Useful for: - Verifying a download URL is still valid - Getting file size before downloading - Checking expiration time **Security**: Requires authentication, only file owner can check.
335
+
336
+ :param download_id: (required)
337
+ :type download_id: str
338
+ :param _request_timeout: timeout setting for this request. If one
339
+ number provided, it will be total request
340
+ timeout. It can also be a pair (tuple) of
341
+ (connection, read) timeouts.
342
+ :type _request_timeout: int, tuple(int, int), optional
343
+ :param _request_auth: set to override the auth_settings for an a single
344
+ request; this effectively ignores the
345
+ authentication in the spec for a single request.
346
+ :type _request_auth: dict, optional
347
+ :param _content_type: force content-type for the request.
348
+ :type _content_type: str, Optional
349
+ :param _headers: set to override the headers for a single
350
+ request; this effectively ignores the headers
351
+ in the spec for a single request.
352
+ :type _headers: dict, optional
353
+ :param _host_index: set to override the host_index for a single
354
+ request; this effectively ignores the host_index
355
+ in the spec for a single request.
356
+ :type _host_index: int, optional
357
+ :return: Returns the result object.
358
+ """ # noqa: E501
359
+
360
+ _param = self._check_file_api_v1_download_download_id_head_0_serialize(
361
+ download_id=download_id,
362
+ _request_auth=_request_auth,
363
+ _content_type=_content_type,
364
+ _headers=_headers,
365
+ _host_index=_host_index
366
+ )
367
+
368
+ _response_types_map: Dict[str, Optional[str]] = {
369
+ '200': "object",
370
+ '401': None,
371
+ '403': None,
372
+ '404': None,
373
+ '422': "HTTPValidationError",
374
+ }
375
+ response_data = self.api_client.call_api(
376
+ *_param,
377
+ _request_timeout=_request_timeout
378
+ )
379
+ response_data.read()
380
+ return self.api_client.response_deserialize(
381
+ response_data=response_data,
382
+ response_types_map=_response_types_map,
383
+ ).data
384
+
385
+
386
+ @validate_call
387
+ def check_file_api_v1_download_download_id_head_0_with_http_info(
388
+ self,
389
+ download_id: StrictStr,
390
+ _request_timeout: Union[
391
+ None,
392
+ Annotated[StrictFloat, Field(gt=0)],
393
+ Tuple[
394
+ Annotated[StrictFloat, Field(gt=0)],
395
+ Annotated[StrictFloat, Field(gt=0)]
396
+ ]
397
+ ] = None,
398
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
399
+ _content_type: Optional[StrictStr] = None,
400
+ _headers: Optional[Dict[StrictStr, Any]] = None,
401
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
402
+ ) -> ApiResponse[object]:
403
+ """Check if a file exists
404
+
405
+ Check if a temporary file exists and get its metadata without downloading. Useful for: - Verifying a download URL is still valid - Getting file size before downloading - Checking expiration time **Security**: Requires authentication, only file owner can check.
406
+
407
+ :param download_id: (required)
408
+ :type download_id: str
409
+ :param _request_timeout: timeout setting for this request. If one
410
+ number provided, it will be total request
411
+ timeout. It can also be a pair (tuple) of
412
+ (connection, read) timeouts.
413
+ :type _request_timeout: int, tuple(int, int), optional
414
+ :param _request_auth: set to override the auth_settings for an a single
415
+ request; this effectively ignores the
416
+ authentication in the spec for a single request.
417
+ :type _request_auth: dict, optional
418
+ :param _content_type: force content-type for the request.
419
+ :type _content_type: str, Optional
420
+ :param _headers: set to override the headers for a single
421
+ request; this effectively ignores the headers
422
+ in the spec for a single request.
423
+ :type _headers: dict, optional
424
+ :param _host_index: set to override the host_index for a single
425
+ request; this effectively ignores the host_index
426
+ in the spec for a single request.
427
+ :type _host_index: int, optional
428
+ :return: Returns the result object.
429
+ """ # noqa: E501
430
+
431
+ _param = self._check_file_api_v1_download_download_id_head_0_serialize(
432
+ download_id=download_id,
433
+ _request_auth=_request_auth,
434
+ _content_type=_content_type,
435
+ _headers=_headers,
436
+ _host_index=_host_index
437
+ )
438
+
439
+ _response_types_map: Dict[str, Optional[str]] = {
440
+ '200': "object",
441
+ '401': None,
442
+ '403': None,
443
+ '404': None,
444
+ '422': "HTTPValidationError",
445
+ }
446
+ response_data = self.api_client.call_api(
447
+ *_param,
448
+ _request_timeout=_request_timeout
449
+ )
450
+ response_data.read()
451
+ return self.api_client.response_deserialize(
452
+ response_data=response_data,
453
+ response_types_map=_response_types_map,
454
+ )
455
+
456
+
457
+ @validate_call
458
+ def check_file_api_v1_download_download_id_head_0_without_preload_content(
459
+ self,
460
+ download_id: StrictStr,
461
+ _request_timeout: Union[
462
+ None,
463
+ Annotated[StrictFloat, Field(gt=0)],
464
+ Tuple[
465
+ Annotated[StrictFloat, Field(gt=0)],
466
+ Annotated[StrictFloat, Field(gt=0)]
467
+ ]
468
+ ] = None,
469
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
470
+ _content_type: Optional[StrictStr] = None,
471
+ _headers: Optional[Dict[StrictStr, Any]] = None,
472
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
473
+ ) -> RESTResponseType:
474
+ """Check if a file exists
475
+
476
+ Check if a temporary file exists and get its metadata without downloading. Useful for: - Verifying a download URL is still valid - Getting file size before downloading - Checking expiration time **Security**: Requires authentication, only file owner can check.
477
+
478
+ :param download_id: (required)
479
+ :type download_id: str
480
+ :param _request_timeout: timeout setting for this request. If one
481
+ number provided, it will be total request
482
+ timeout. It can also be a pair (tuple) of
483
+ (connection, read) timeouts.
484
+ :type _request_timeout: int, tuple(int, int), optional
485
+ :param _request_auth: set to override the auth_settings for an a single
486
+ request; this effectively ignores the
487
+ authentication in the spec for a single request.
488
+ :type _request_auth: dict, optional
489
+ :param _content_type: force content-type for the request.
490
+ :type _content_type: str, Optional
491
+ :param _headers: set to override the headers for a single
492
+ request; this effectively ignores the headers
493
+ in the spec for a single request.
494
+ :type _headers: dict, optional
495
+ :param _host_index: set to override the host_index for a single
496
+ request; this effectively ignores the host_index
497
+ in the spec for a single request.
498
+ :type _host_index: int, optional
499
+ :return: Returns the result object.
500
+ """ # noqa: E501
501
+
502
+ _param = self._check_file_api_v1_download_download_id_head_0_serialize(
503
+ download_id=download_id,
504
+ _request_auth=_request_auth,
505
+ _content_type=_content_type,
506
+ _headers=_headers,
507
+ _host_index=_host_index
508
+ )
509
+
510
+ _response_types_map: Dict[str, Optional[str]] = {
511
+ '200': "object",
512
+ '401': None,
513
+ '403': None,
514
+ '404': None,
515
+ '422': "HTTPValidationError",
516
+ }
517
+ response_data = self.api_client.call_api(
518
+ *_param,
519
+ _request_timeout=_request_timeout
520
+ )
521
+ return response_data.response
522
+
523
+
524
+ def _check_file_api_v1_download_download_id_head_0_serialize(
525
+ self,
526
+ download_id,
527
+ _request_auth,
528
+ _content_type,
529
+ _headers,
530
+ _host_index,
531
+ ) -> RequestSerialized:
532
+
533
+ _host = None
534
+
535
+ _collection_formats: Dict[str, str] = {
536
+ }
537
+
538
+ _path_params: Dict[str, str] = {}
539
+ _query_params: List[Tuple[str, str]] = []
540
+ _header_params: Dict[str, Optional[str]] = _headers or {}
541
+ _form_params: List[Tuple[str, str]] = []
542
+ _files: Dict[
543
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
544
+ ] = {}
545
+ _body_params: Optional[bytes] = None
546
+
547
+ # process the path parameters
548
+ if download_id is not None:
549
+ _path_params['download_id'] = download_id
550
+ # process the query parameters
551
+ # process the header parameters
552
+ # process the form parameters
553
+ # process the body parameter
554
+
555
+
556
+ # set the HTTP header `Accept`
557
+ if 'Accept' not in _header_params:
558
+ _header_params['Accept'] = self.api_client.select_header_accept(
559
+ [
560
+ 'application/json'
561
+ ]
562
+ )
563
+
564
+
565
+ # authentication setting
566
+ _auth_settings: List[str] = [
567
+ 'HTTPBearer'
568
+ ]
569
+
570
+ return self.api_client.param_serialize(
571
+ method='HEAD',
572
+ resource_path='/api/v1/download/{download_id}',
573
+ path_params=_path_params,
574
+ query_params=_query_params,
575
+ header_params=_header_params,
576
+ body=_body_params,
577
+ post_params=_form_params,
578
+ files=_files,
579
+ auth_settings=_auth_settings,
580
+ collection_formats=_collection_formats,
581
+ _host=_host,
582
+ _request_auth=_request_auth
583
+ )
584
+
585
+
586
+
587
+
588
+ @validate_call
589
+ def download_file_api_v1_download_download_id_get(
590
+ self,
591
+ download_id: StrictStr,
592
+ delete_after: Annotated[Optional[StrictBool], Field(description="If true, delete the file after download (one-time download)")] = None,
593
+ _request_timeout: Union[
594
+ None,
595
+ Annotated[StrictFloat, Field(gt=0)],
596
+ Tuple[
597
+ Annotated[StrictFloat, Field(gt=0)],
598
+ Annotated[StrictFloat, Field(gt=0)]
599
+ ]
600
+ ] = None,
601
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
602
+ _content_type: Optional[StrictStr] = None,
603
+ _headers: Optional[Dict[StrictStr, Any]] = None,
604
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
605
+ ) -> object:
606
+ """Download a temporary file
607
+
608
+ Download a file stored temporarily after asynchronous processing. **Usage**: - This URL is provided in webhook notifications when using `webhook_mode: \"download_url\"` - Files are automatically deleted after 1 hour - Each file can only be downloaded until it expires **Security**: - Requires a valid JWT token - Only the user who initiated the task can download the file
609
+
610
+ :param download_id: (required)
611
+ :type download_id: str
612
+ :param delete_after: If true, delete the file after download (one-time download)
613
+ :type delete_after: bool
614
+ :param _request_timeout: timeout setting for this request. If one
615
+ number provided, it will be total request
616
+ timeout. It can also be a pair (tuple) of
617
+ (connection, read) timeouts.
618
+ :type _request_timeout: int, tuple(int, int), optional
619
+ :param _request_auth: set to override the auth_settings for an a single
620
+ request; this effectively ignores the
621
+ authentication in the spec for a single request.
622
+ :type _request_auth: dict, optional
623
+ :param _content_type: force content-type for the request.
624
+ :type _content_type: str, Optional
625
+ :param _headers: set to override the headers for a single
626
+ request; this effectively ignores the headers
627
+ in the spec for a single request.
628
+ :type _headers: dict, optional
629
+ :param _host_index: set to override the host_index for a single
630
+ request; this effectively ignores the host_index
631
+ in the spec for a single request.
632
+ :type _host_index: int, optional
633
+ :return: Returns the result object.
634
+ """ # noqa: E501
635
+
636
+ _param = self._download_file_api_v1_download_download_id_get_serialize(
637
+ download_id=download_id,
638
+ delete_after=delete_after,
639
+ _request_auth=_request_auth,
640
+ _content_type=_content_type,
641
+ _headers=_headers,
642
+ _host_index=_host_index
643
+ )
644
+
645
+ _response_types_map: Dict[str, Optional[str]] = {
646
+ '200': "object",
647
+ '401': None,
648
+ '403': None,
649
+ '404': None,
650
+ '422': "HTTPValidationError",
651
+ }
652
+ response_data = self.api_client.call_api(
653
+ *_param,
654
+ _request_timeout=_request_timeout
655
+ )
656
+ response_data.read()
657
+ return self.api_client.response_deserialize(
658
+ response_data=response_data,
659
+ response_types_map=_response_types_map,
660
+ ).data
661
+
662
+
663
+ @validate_call
664
+ def download_file_api_v1_download_download_id_get_with_http_info(
665
+ self,
666
+ download_id: StrictStr,
667
+ delete_after: Annotated[Optional[StrictBool], Field(description="If true, delete the file after download (one-time download)")] = None,
668
+ _request_timeout: Union[
669
+ None,
670
+ Annotated[StrictFloat, Field(gt=0)],
671
+ Tuple[
672
+ Annotated[StrictFloat, Field(gt=0)],
673
+ Annotated[StrictFloat, Field(gt=0)]
674
+ ]
675
+ ] = None,
676
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
677
+ _content_type: Optional[StrictStr] = None,
678
+ _headers: Optional[Dict[StrictStr, Any]] = None,
679
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
680
+ ) -> ApiResponse[object]:
681
+ """Download a temporary file
682
+
683
+ Download a file stored temporarily after asynchronous processing. **Usage**: - This URL is provided in webhook notifications when using `webhook_mode: \"download_url\"` - Files are automatically deleted after 1 hour - Each file can only be downloaded until it expires **Security**: - Requires a valid JWT token - Only the user who initiated the task can download the file
684
+
685
+ :param download_id: (required)
686
+ :type download_id: str
687
+ :param delete_after: If true, delete the file after download (one-time download)
688
+ :type delete_after: bool
689
+ :param _request_timeout: timeout setting for this request. If one
690
+ number provided, it will be total request
691
+ timeout. It can also be a pair (tuple) of
692
+ (connection, read) timeouts.
693
+ :type _request_timeout: int, tuple(int, int), optional
694
+ :param _request_auth: set to override the auth_settings for an a single
695
+ request; this effectively ignores the
696
+ authentication in the spec for a single request.
697
+ :type _request_auth: dict, optional
698
+ :param _content_type: force content-type for the request.
699
+ :type _content_type: str, Optional
700
+ :param _headers: set to override the headers for a single
701
+ request; this effectively ignores the headers
702
+ in the spec for a single request.
703
+ :type _headers: dict, optional
704
+ :param _host_index: set to override the host_index for a single
705
+ request; this effectively ignores the host_index
706
+ in the spec for a single request.
707
+ :type _host_index: int, optional
708
+ :return: Returns the result object.
709
+ """ # noqa: E501
710
+
711
+ _param = self._download_file_api_v1_download_download_id_get_serialize(
712
+ download_id=download_id,
713
+ delete_after=delete_after,
714
+ _request_auth=_request_auth,
715
+ _content_type=_content_type,
716
+ _headers=_headers,
717
+ _host_index=_host_index
718
+ )
719
+
720
+ _response_types_map: Dict[str, Optional[str]] = {
721
+ '200': "object",
722
+ '401': None,
723
+ '403': None,
724
+ '404': None,
725
+ '422': "HTTPValidationError",
726
+ }
727
+ response_data = self.api_client.call_api(
728
+ *_param,
729
+ _request_timeout=_request_timeout
730
+ )
731
+ response_data.read()
732
+ return self.api_client.response_deserialize(
733
+ response_data=response_data,
734
+ response_types_map=_response_types_map,
735
+ )
736
+
737
+
738
+ @validate_call
739
+ def download_file_api_v1_download_download_id_get_without_preload_content(
740
+ self,
741
+ download_id: StrictStr,
742
+ delete_after: Annotated[Optional[StrictBool], Field(description="If true, delete the file after download (one-time download)")] = None,
743
+ _request_timeout: Union[
744
+ None,
745
+ Annotated[StrictFloat, Field(gt=0)],
746
+ Tuple[
747
+ Annotated[StrictFloat, Field(gt=0)],
748
+ Annotated[StrictFloat, Field(gt=0)]
749
+ ]
750
+ ] = None,
751
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
752
+ _content_type: Optional[StrictStr] = None,
753
+ _headers: Optional[Dict[StrictStr, Any]] = None,
754
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
755
+ ) -> RESTResponseType:
756
+ """Download a temporary file
757
+
758
+ Download a file stored temporarily after asynchronous processing. **Usage**: - This URL is provided in webhook notifications when using `webhook_mode: \"download_url\"` - Files are automatically deleted after 1 hour - Each file can only be downloaded until it expires **Security**: - Requires a valid JWT token - Only the user who initiated the task can download the file
759
+
760
+ :param download_id: (required)
761
+ :type download_id: str
762
+ :param delete_after: If true, delete the file after download (one-time download)
763
+ :type delete_after: bool
764
+ :param _request_timeout: timeout setting for this request. If one
765
+ number provided, it will be total request
766
+ timeout. It can also be a pair (tuple) of
767
+ (connection, read) timeouts.
768
+ :type _request_timeout: int, tuple(int, int), optional
769
+ :param _request_auth: set to override the auth_settings for an a single
770
+ request; this effectively ignores the
771
+ authentication in the spec for a single request.
772
+ :type _request_auth: dict, optional
773
+ :param _content_type: force content-type for the request.
774
+ :type _content_type: str, Optional
775
+ :param _headers: set to override the headers for a single
776
+ request; this effectively ignores the headers
777
+ in the spec for a single request.
778
+ :type _headers: dict, optional
779
+ :param _host_index: set to override the host_index for a single
780
+ request; this effectively ignores the host_index
781
+ in the spec for a single request.
782
+ :type _host_index: int, optional
783
+ :return: Returns the result object.
784
+ """ # noqa: E501
785
+
786
+ _param = self._download_file_api_v1_download_download_id_get_serialize(
787
+ download_id=download_id,
788
+ delete_after=delete_after,
789
+ _request_auth=_request_auth,
790
+ _content_type=_content_type,
791
+ _headers=_headers,
792
+ _host_index=_host_index
793
+ )
794
+
795
+ _response_types_map: Dict[str, Optional[str]] = {
796
+ '200': "object",
797
+ '401': None,
798
+ '403': None,
799
+ '404': None,
800
+ '422': "HTTPValidationError",
801
+ }
802
+ response_data = self.api_client.call_api(
803
+ *_param,
804
+ _request_timeout=_request_timeout
805
+ )
806
+ return response_data.response
807
+
808
+
809
+ def _download_file_api_v1_download_download_id_get_serialize(
810
+ self,
811
+ download_id,
812
+ delete_after,
813
+ _request_auth,
814
+ _content_type,
815
+ _headers,
816
+ _host_index,
817
+ ) -> RequestSerialized:
818
+
819
+ _host = None
820
+
821
+ _collection_formats: Dict[str, str] = {
822
+ }
823
+
824
+ _path_params: Dict[str, str] = {}
825
+ _query_params: List[Tuple[str, str]] = []
826
+ _header_params: Dict[str, Optional[str]] = _headers or {}
827
+ _form_params: List[Tuple[str, str]] = []
828
+ _files: Dict[
829
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
830
+ ] = {}
831
+ _body_params: Optional[bytes] = None
832
+
833
+ # process the path parameters
834
+ if download_id is not None:
835
+ _path_params['download_id'] = download_id
836
+ # process the query parameters
837
+ if delete_after is not None:
838
+
839
+ _query_params.append(('delete_after', delete_after))
840
+
841
+ # process the header parameters
842
+ # process the form parameters
843
+ # process the body parameter
844
+
845
+
846
+ # set the HTTP header `Accept`
847
+ if 'Accept' not in _header_params:
848
+ _header_params['Accept'] = self.api_client.select_header_accept(
849
+ [
850
+ 'application/json',
851
+ 'application/pdf',
852
+ 'application/xml',
853
+ 'application/octet-stream'
854
+ ]
855
+ )
856
+
857
+
858
+ # authentication setting
859
+ _auth_settings: List[str] = [
860
+ 'HTTPBearer'
861
+ ]
862
+
863
+ return self.api_client.param_serialize(
864
+ method='GET',
865
+ resource_path='/api/v1/download/{download_id}',
866
+ path_params=_path_params,
867
+ query_params=_query_params,
868
+ header_params=_header_params,
869
+ body=_body_params,
870
+ post_params=_form_params,
871
+ files=_files,
872
+ auth_settings=_auth_settings,
873
+ collection_formats=_collection_formats,
874
+ _host=_host,
875
+ _request_auth=_request_auth
876
+ )
877
+
878
+
879
+
880
+
881
+ @validate_call
882
+ def download_file_api_v1_download_download_id_get_0(
883
+ self,
884
+ download_id: StrictStr,
885
+ delete_after: Annotated[Optional[StrictBool], Field(description="If true, delete the file after download (one-time download)")] = None,
886
+ _request_timeout: Union[
887
+ None,
888
+ Annotated[StrictFloat, Field(gt=0)],
889
+ Tuple[
890
+ Annotated[StrictFloat, Field(gt=0)],
891
+ Annotated[StrictFloat, Field(gt=0)]
892
+ ]
893
+ ] = None,
894
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
895
+ _content_type: Optional[StrictStr] = None,
896
+ _headers: Optional[Dict[StrictStr, Any]] = None,
897
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
898
+ ) -> object:
899
+ """Download a temporary file
900
+
901
+ Download a file stored temporarily after asynchronous processing. **Usage**: - This URL is provided in webhook notifications when using `webhook_mode: \"download_url\"` - Files are automatically deleted after 1 hour - Each file can only be downloaded until it expires **Security**: - Requires a valid JWT token - Only the user who initiated the task can download the file
902
+
903
+ :param download_id: (required)
904
+ :type download_id: str
905
+ :param delete_after: If true, delete the file after download (one-time download)
906
+ :type delete_after: bool
907
+ :param _request_timeout: timeout setting for this request. If one
908
+ number provided, it will be total request
909
+ timeout. It can also be a pair (tuple) of
910
+ (connection, read) timeouts.
911
+ :type _request_timeout: int, tuple(int, int), optional
912
+ :param _request_auth: set to override the auth_settings for an a single
913
+ request; this effectively ignores the
914
+ authentication in the spec for a single request.
915
+ :type _request_auth: dict, optional
916
+ :param _content_type: force content-type for the request.
917
+ :type _content_type: str, Optional
918
+ :param _headers: set to override the headers for a single
919
+ request; this effectively ignores the headers
920
+ in the spec for a single request.
921
+ :type _headers: dict, optional
922
+ :param _host_index: set to override the host_index for a single
923
+ request; this effectively ignores the host_index
924
+ in the spec for a single request.
925
+ :type _host_index: int, optional
926
+ :return: Returns the result object.
927
+ """ # noqa: E501
928
+
929
+ _param = self._download_file_api_v1_download_download_id_get_0_serialize(
930
+ download_id=download_id,
931
+ delete_after=delete_after,
932
+ _request_auth=_request_auth,
933
+ _content_type=_content_type,
934
+ _headers=_headers,
935
+ _host_index=_host_index
936
+ )
937
+
938
+ _response_types_map: Dict[str, Optional[str]] = {
939
+ '200': "object",
940
+ '401': None,
941
+ '403': None,
942
+ '404': None,
943
+ '422': "HTTPValidationError",
944
+ }
945
+ response_data = self.api_client.call_api(
946
+ *_param,
947
+ _request_timeout=_request_timeout
948
+ )
949
+ response_data.read()
950
+ return self.api_client.response_deserialize(
951
+ response_data=response_data,
952
+ response_types_map=_response_types_map,
953
+ ).data
954
+
955
+
956
+ @validate_call
957
+ def download_file_api_v1_download_download_id_get_0_with_http_info(
958
+ self,
959
+ download_id: StrictStr,
960
+ delete_after: Annotated[Optional[StrictBool], Field(description="If true, delete the file after download (one-time download)")] = None,
961
+ _request_timeout: Union[
962
+ None,
963
+ Annotated[StrictFloat, Field(gt=0)],
964
+ Tuple[
965
+ Annotated[StrictFloat, Field(gt=0)],
966
+ Annotated[StrictFloat, Field(gt=0)]
967
+ ]
968
+ ] = None,
969
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
970
+ _content_type: Optional[StrictStr] = None,
971
+ _headers: Optional[Dict[StrictStr, Any]] = None,
972
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
973
+ ) -> ApiResponse[object]:
974
+ """Download a temporary file
975
+
976
+ Download a file stored temporarily after asynchronous processing. **Usage**: - This URL is provided in webhook notifications when using `webhook_mode: \"download_url\"` - Files are automatically deleted after 1 hour - Each file can only be downloaded until it expires **Security**: - Requires a valid JWT token - Only the user who initiated the task can download the file
977
+
978
+ :param download_id: (required)
979
+ :type download_id: str
980
+ :param delete_after: If true, delete the file after download (one-time download)
981
+ :type delete_after: bool
982
+ :param _request_timeout: timeout setting for this request. If one
983
+ number provided, it will be total request
984
+ timeout. It can also be a pair (tuple) of
985
+ (connection, read) timeouts.
986
+ :type _request_timeout: int, tuple(int, int), optional
987
+ :param _request_auth: set to override the auth_settings for an a single
988
+ request; this effectively ignores the
989
+ authentication in the spec for a single request.
990
+ :type _request_auth: dict, optional
991
+ :param _content_type: force content-type for the request.
992
+ :type _content_type: str, Optional
993
+ :param _headers: set to override the headers for a single
994
+ request; this effectively ignores the headers
995
+ in the spec for a single request.
996
+ :type _headers: dict, optional
997
+ :param _host_index: set to override the host_index for a single
998
+ request; this effectively ignores the host_index
999
+ in the spec for a single request.
1000
+ :type _host_index: int, optional
1001
+ :return: Returns the result object.
1002
+ """ # noqa: E501
1003
+
1004
+ _param = self._download_file_api_v1_download_download_id_get_0_serialize(
1005
+ download_id=download_id,
1006
+ delete_after=delete_after,
1007
+ _request_auth=_request_auth,
1008
+ _content_type=_content_type,
1009
+ _headers=_headers,
1010
+ _host_index=_host_index
1011
+ )
1012
+
1013
+ _response_types_map: Dict[str, Optional[str]] = {
1014
+ '200': "object",
1015
+ '401': None,
1016
+ '403': None,
1017
+ '404': None,
1018
+ '422': "HTTPValidationError",
1019
+ }
1020
+ response_data = self.api_client.call_api(
1021
+ *_param,
1022
+ _request_timeout=_request_timeout
1023
+ )
1024
+ response_data.read()
1025
+ return self.api_client.response_deserialize(
1026
+ response_data=response_data,
1027
+ response_types_map=_response_types_map,
1028
+ )
1029
+
1030
+
1031
+ @validate_call
1032
+ def download_file_api_v1_download_download_id_get_0_without_preload_content(
1033
+ self,
1034
+ download_id: StrictStr,
1035
+ delete_after: Annotated[Optional[StrictBool], Field(description="If true, delete the file after download (one-time download)")] = None,
1036
+ _request_timeout: Union[
1037
+ None,
1038
+ Annotated[StrictFloat, Field(gt=0)],
1039
+ Tuple[
1040
+ Annotated[StrictFloat, Field(gt=0)],
1041
+ Annotated[StrictFloat, Field(gt=0)]
1042
+ ]
1043
+ ] = None,
1044
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1045
+ _content_type: Optional[StrictStr] = None,
1046
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1047
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1048
+ ) -> RESTResponseType:
1049
+ """Download a temporary file
1050
+
1051
+ Download a file stored temporarily after asynchronous processing. **Usage**: - This URL is provided in webhook notifications when using `webhook_mode: \"download_url\"` - Files are automatically deleted after 1 hour - Each file can only be downloaded until it expires **Security**: - Requires a valid JWT token - Only the user who initiated the task can download the file
1052
+
1053
+ :param download_id: (required)
1054
+ :type download_id: str
1055
+ :param delete_after: If true, delete the file after download (one-time download)
1056
+ :type delete_after: bool
1057
+ :param _request_timeout: timeout setting for this request. If one
1058
+ number provided, it will be total request
1059
+ timeout. It can also be a pair (tuple) of
1060
+ (connection, read) timeouts.
1061
+ :type _request_timeout: int, tuple(int, int), optional
1062
+ :param _request_auth: set to override the auth_settings for an a single
1063
+ request; this effectively ignores the
1064
+ authentication in the spec for a single request.
1065
+ :type _request_auth: dict, optional
1066
+ :param _content_type: force content-type for the request.
1067
+ :type _content_type: str, Optional
1068
+ :param _headers: set to override the headers for a single
1069
+ request; this effectively ignores the headers
1070
+ in the spec for a single request.
1071
+ :type _headers: dict, optional
1072
+ :param _host_index: set to override the host_index for a single
1073
+ request; this effectively ignores the host_index
1074
+ in the spec for a single request.
1075
+ :type _host_index: int, optional
1076
+ :return: Returns the result object.
1077
+ """ # noqa: E501
1078
+
1079
+ _param = self._download_file_api_v1_download_download_id_get_0_serialize(
1080
+ download_id=download_id,
1081
+ delete_after=delete_after,
1082
+ _request_auth=_request_auth,
1083
+ _content_type=_content_type,
1084
+ _headers=_headers,
1085
+ _host_index=_host_index
1086
+ )
1087
+
1088
+ _response_types_map: Dict[str, Optional[str]] = {
1089
+ '200': "object",
1090
+ '401': None,
1091
+ '403': None,
1092
+ '404': None,
1093
+ '422': "HTTPValidationError",
1094
+ }
1095
+ response_data = self.api_client.call_api(
1096
+ *_param,
1097
+ _request_timeout=_request_timeout
1098
+ )
1099
+ return response_data.response
1100
+
1101
+
1102
+ def _download_file_api_v1_download_download_id_get_0_serialize(
1103
+ self,
1104
+ download_id,
1105
+ delete_after,
1106
+ _request_auth,
1107
+ _content_type,
1108
+ _headers,
1109
+ _host_index,
1110
+ ) -> RequestSerialized:
1111
+
1112
+ _host = None
1113
+
1114
+ _collection_formats: Dict[str, str] = {
1115
+ }
1116
+
1117
+ _path_params: Dict[str, str] = {}
1118
+ _query_params: List[Tuple[str, str]] = []
1119
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1120
+ _form_params: List[Tuple[str, str]] = []
1121
+ _files: Dict[
1122
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1123
+ ] = {}
1124
+ _body_params: Optional[bytes] = None
1125
+
1126
+ # process the path parameters
1127
+ if download_id is not None:
1128
+ _path_params['download_id'] = download_id
1129
+ # process the query parameters
1130
+ if delete_after is not None:
1131
+
1132
+ _query_params.append(('delete_after', delete_after))
1133
+
1134
+ # process the header parameters
1135
+ # process the form parameters
1136
+ # process the body parameter
1137
+
1138
+
1139
+ # set the HTTP header `Accept`
1140
+ if 'Accept' not in _header_params:
1141
+ _header_params['Accept'] = self.api_client.select_header_accept(
1142
+ [
1143
+ 'application/json',
1144
+ 'application/pdf',
1145
+ 'application/xml',
1146
+ 'application/octet-stream'
1147
+ ]
1148
+ )
1149
+
1150
+
1151
+ # authentication setting
1152
+ _auth_settings: List[str] = [
1153
+ 'HTTPBearer'
1154
+ ]
1155
+
1156
+ return self.api_client.param_serialize(
1157
+ method='GET',
1158
+ resource_path='/api/v1/download/{download_id}',
1159
+ path_params=_path_params,
1160
+ query_params=_query_params,
1161
+ header_params=_header_params,
1162
+ body=_body_params,
1163
+ post_params=_form_params,
1164
+ files=_files,
1165
+ auth_settings=_auth_settings,
1166
+ collection_formats=_collection_formats,
1167
+ _host=_host,
1168
+ _request_auth=_request_auth
1169
+ )
1170
+
1171
+