factpulse 2.0.37__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.
- factpulse/__init__.py +542 -197
- factpulse/api/__init__.py +7 -4
- factpulse/api/afnorpdppa_api.py +49 -47
- factpulse/api/afnorpdppa_directory_service_api.py +1225 -310
- factpulse/api/afnorpdppa_flow_service_api.py +212 -81
- factpulse/api/chorus_pro_api.py +271 -218
- factpulse/api/document_conversion_api.py +1222 -0
- factpulse/api/downloads_api.py +1171 -0
- factpulse/api/e_reporting_api.py +3254 -0
- factpulse/api/{sant_api.py → health_api.py} +29 -22
- factpulse/api/invoice_processing_api.py +3634 -0
- factpulse/api/{vrification_pdfxml_api.py → pdfxml_verification_api.py} +331 -252
- factpulse/api/{utilisateur_api.py → user_api.py} +21 -17
- factpulse/api_client.py +4 -3
- factpulse/configuration.py +11 -6
- factpulse/exceptions.py +3 -2
- factpulse/models/__init__.py +265 -95
- factpulse/models/accept_language.py +38 -0
- factpulse/models/acknowledgment_status.py +39 -0
- factpulse/models/additional_document.py +116 -0
- factpulse/models/afnor_acknowledgement.py +100 -0
- factpulse/models/afnor_acknowledgement_detail.py +105 -0
- factpulse/models/afnor_address_edit.py +111 -0
- factpulse/models/afnor_address_patch.py +141 -0
- factpulse/models/afnor_address_put.py +129 -0
- factpulse/models/afnor_address_read.py +113 -0
- factpulse/models/afnor_algorithm.py +41 -0
- factpulse/models/afnor_contains_operator.py +37 -0
- factpulse/models/afnor_create_directory_line_body.py +98 -0
- factpulse/models/afnor_create_directory_line_body_addressing_information.py +122 -0
- factpulse/models/afnor_create_directory_line_body_period.py +91 -0
- factpulse/models/afnor_create_routing_code_body.py +153 -0
- factpulse/models/afnor_credentials.py +107 -0
- factpulse/models/afnor_destination.py +127 -0
- factpulse/models/afnor_diffusion_status.py +38 -0
- factpulse/models/afnor_directory_line_field.py +42 -0
- factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code.py +139 -0
- factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_platform.py +92 -0
- factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_routing_code.py +134 -0
- factpulse/models/afnor_directory_line_post201_response.py +94 -0
- factpulse/models/afnor_directory_line_search_post200_response.py +104 -0
- factpulse/models/afnor_entity_type.py +38 -0
- factpulse/models/afnor_error.py +97 -0
- factpulse/models/afnor_facility_administrative_status.py +38 -0
- factpulse/models/afnor_facility_nature.py +38 -0
- factpulse/models/afnor_facility_payload_history.py +140 -0
- factpulse/models/afnor_facility_payload_history_ule_b2g_additional_data.py +98 -0
- factpulse/models/afnor_facility_payload_included.py +134 -0
- factpulse/models/afnor_facility_type.py +38 -0
- factpulse/models/afnor_flow.py +129 -0
- factpulse/models/afnor_flow_ack_status.py +39 -0
- factpulse/models/afnor_flow_direction.py +38 -0
- factpulse/models/afnor_flow_info.py +112 -0
- factpulse/models/afnor_flow_profile.py +39 -0
- factpulse/models/afnor_flow_syntax.py +41 -0
- factpulse/models/afnor_flow_type.py +49 -0
- factpulse/models/afnor_full_flow_info.py +117 -0
- factpulse/models/afnor_health_check_response.py +92 -0
- factpulse/models/afnor_legal_unit_administrative_status.py +38 -0
- factpulse/models/afnor_legal_unit_payload_history.py +107 -0
- factpulse/models/afnor_legal_unit_payload_included.py +107 -0
- factpulse/models/afnor_legal_unit_payload_included_no_siren.py +95 -0
- factpulse/models/afnor_platform_status.py +38 -0
- factpulse/models/afnor_processing_rule.py +42 -0
- factpulse/models/afnor_reason_code.py +141 -0
- factpulse/models/afnor_reason_code_enum.py +51 -0
- factpulse/models/afnor_recipient_platform_type.py +38 -0
- factpulse/models/afnor_result.py +127 -0
- factpulse/models/afnor_routing_code_administrative_status.py +38 -0
- factpulse/models/afnor_routing_code_field.py +44 -0
- factpulse/models/afnor_routing_code_payload_history_legal_unit_facility.py +158 -0
- factpulse/models/afnor_routing_code_post201_response.py +113 -0
- factpulse/models/afnor_routing_code_search.py +122 -0
- factpulse/models/afnor_routing_code_search_filters.py +128 -0
- factpulse/models/afnor_routing_code_search_filters_administrative_status.py +92 -0
- factpulse/models/afnor_routing_code_search_filters_routing_code_name.py +102 -0
- factpulse/models/afnor_routing_code_search_filters_routing_identifier.py +102 -0
- factpulse/models/afnor_routing_code_search_post200_response.py +104 -0
- factpulse/models/afnor_routing_code_search_sorting_inner.py +92 -0
- factpulse/models/afnor_search_directory_line.py +109 -0
- factpulse/models/afnor_search_directory_line_filters.py +116 -0
- factpulse/models/afnor_search_directory_line_filters_addressing_identifier.py +92 -0
- factpulse/models/afnor_search_directory_line_filters_addressing_suffix.py +92 -0
- factpulse/models/afnor_search_directory_line_sorting_inner.py +92 -0
- factpulse/models/afnor_search_flow_content.py +104 -0
- factpulse/models/afnor_search_flow_filters.py +106 -0
- factpulse/models/afnor_search_flow_params.py +95 -0
- factpulse/models/afnor_search_siren.py +109 -0
- factpulse/models/afnor_search_siren_filters.py +110 -0
- factpulse/models/afnor_search_siren_filters_administrative_status.py +92 -0
- factpulse/models/afnor_search_siren_filters_business_name.py +92 -0
- factpulse/models/afnor_search_siren_filters_entity_type.py +92 -0
- factpulse/models/afnor_search_siren_filters_siren.py +102 -0
- factpulse/models/afnor_search_siren_sorting_inner.py +92 -0
- factpulse/models/afnor_search_siret.py +122 -0
- factpulse/models/afnor_search_siret_filters.py +140 -0
- factpulse/models/afnor_search_siret_filters_address_lines.py +92 -0
- factpulse/models/afnor_search_siret_filters_administrative_status.py +92 -0
- factpulse/models/afnor_search_siret_filters_country_subdivision.py +92 -0
- factpulse/models/afnor_search_siret_filters_facility_type.py +92 -0
- factpulse/models/afnor_search_siret_filters_locality.py +92 -0
- factpulse/models/afnor_search_siret_filters_name.py +92 -0
- factpulse/models/afnor_search_siret_filters_postal_code.py +102 -0
- factpulse/models/afnor_search_siret_filters_siret.py +102 -0
- factpulse/models/afnor_search_siret_sorting_inner.py +92 -0
- factpulse/models/afnor_siren_field.py +41 -0
- factpulse/models/afnor_siren_search_post200_response.py +104 -0
- factpulse/models/afnor_siret_field.py +50 -0
- factpulse/models/afnor_siret_search_post200_response.py +104 -0
- factpulse/models/afnor_sorting_order.py +38 -0
- factpulse/models/afnor_strict_operator.py +37 -0
- factpulse/models/afnor_update_patch_directory_line_body.py +89 -0
- factpulse/models/afnor_update_patch_routing_code_body.py +120 -0
- factpulse/models/afnor_update_put_routing_code_body.py +114 -0
- factpulse/models/afnor_webhook_callback_content.py +92 -0
- factpulse/models/aggregated_payment_input.py +106 -0
- factpulse/models/aggregated_transaction_input.py +136 -0
- factpulse/models/allowance_charge.py +150 -0
- factpulse/models/allowance_charge_reason_code.py +74 -0
- factpulse/models/allowance_reason_code.py +43 -0
- factpulse/models/allowance_total_amount.py +146 -0
- factpulse/models/amount.py +140 -0
- factpulse/models/amount1.py +140 -0
- factpulse/models/amount_due.py +140 -0
- factpulse/models/api_error.py +6 -5
- factpulse/models/api_profile.py +41 -0
- factpulse/models/async_task_status.py +98 -0
- factpulse/models/base_amount.py +146 -0
- factpulse/models/bounding_box_schema.py +11 -10
- factpulse/models/buyercountry.py +137 -0
- factpulse/models/celery_status.py +41 -0
- factpulse/models/certificate_info_response.py +25 -24
- factpulse/models/charge_total_amount.py +146 -0
- factpulse/models/chorus_pro_credentials.py +14 -13
- factpulse/models/chorus_pro_destination.py +109 -0
- factpulse/models/chorus_pro_result.py +102 -0
- factpulse/models/contact.py +114 -0
- factpulse/models/convert_resume_request.py +88 -0
- factpulse/models/convert_success_response.py +127 -0
- factpulse/models/convert_validation_failed_response.py +121 -0
- factpulse/models/country_code.py +206 -0
- factpulse/models/create_aggregated_report_request.py +170 -0
- factpulse/models/create_e_reporting_request.py +173 -0
- factpulse/models/currency.py +137 -0
- factpulse/models/currency_code.py +89 -0
- factpulse/models/delivery_party.py +122 -0
- factpulse/models/destination.py +28 -27
- factpulse/models/directory_line_include.py +40 -0
- factpulse/models/doc_type.py +40 -0
- factpulse/models/document_type_info.py +92 -0
- factpulse/models/e_reporting_flow_type.py +40 -0
- factpulse/models/e_reporting_validation_error.py +97 -0
- factpulse/models/electronic_address.py +91 -0
- factpulse/models/enriched_invoice_info.py +134 -0
- factpulse/models/error_level.py +3 -2
- factpulse/models/error_source.py +3 -2
- factpulse/models/extraction_info.py +94 -0
- factpulse/models/factur_x_invoice.py +321 -0
- factpulse/models/factur_xpdf_info.py +92 -0
- factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.py +41 -0
- factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.py +116 -0
- factpulse/models/field_status.py +41 -0
- factpulse/models/file_info.py +95 -0
- factpulse/models/files_info.py +107 -0
- factpulse/models/flow_direction.py +38 -0
- factpulse/models/flow_profile.py +39 -0
- factpulse/models/flow_summary.py +132 -0
- factpulse/models/flow_syntax.py +41 -0
- factpulse/models/flow_type.py +49 -0
- factpulse/models/generate_aggregated_report_response.py +100 -0
- factpulse/models/generate_certificate_request.py +27 -26
- factpulse/models/generate_certificate_response.py +16 -15
- factpulse/models/generate_e_reporting_response.py +96 -0
- factpulse/models/get_chorus_pro_id_request.py +101 -0
- factpulse/models/get_chorus_pro_id_response.py +99 -0
- factpulse/models/get_invoice_request.py +99 -0
- factpulse/models/get_invoice_response.py +143 -0
- factpulse/models/get_structure_request.py +101 -0
- factpulse/models/get_structure_response.py +143 -0
- factpulse/models/global_allowance_amount.py +140 -0
- factpulse/models/gross_unit_price.py +146 -0
- factpulse/models/http_validation_error.py +3 -2
- factpulse/models/incoming_invoice.py +175 -0
- factpulse/models/incoming_supplier.py +145 -0
- factpulse/models/invoice_format.py +39 -0
- factpulse/models/invoice_input.py +179 -0
- factpulse/models/invoice_line.py +370 -0
- factpulse/models/invoice_line_allowance_amount.py +146 -0
- factpulse/models/invoice_note.py +95 -0
- factpulse/models/invoice_payment_input.py +110 -0
- factpulse/models/invoice_references.py +195 -0
- factpulse/models/invoice_status.py +97 -0
- factpulse/models/invoice_totals.py +178 -0
- factpulse/models/invoice_totals_prepayment.py +146 -0
- factpulse/models/invoice_type_code.py +52 -0
- factpulse/models/invoice_type_code_output.py +52 -0
- factpulse/models/invoicing_framework.py +111 -0
- factpulse/models/invoicing_framework_code.py +40 -0
- factpulse/models/line_net_amount.py +146 -0
- factpulse/models/line_sub_type.py +39 -0
- factpulse/models/line_total_amount.py +146 -0
- factpulse/models/location_inner.py +139 -0
- factpulse/models/mandatory_note_schema.py +125 -0
- factpulse/models/manual_rate.py +140 -0
- factpulse/models/manual_vat_rate.py +140 -0
- factpulse/models/missing_field.py +108 -0
- factpulse/models/operation_nature.py +50 -0
- factpulse/models/output_format.py +38 -0
- factpulse/models/page_dimensions_schema.py +90 -0
- factpulse/models/payee.py +169 -0
- factpulse/models/payment_amount_by_rate.py +98 -0
- factpulse/models/payment_card.py +100 -0
- factpulse/models/payment_means.py +42 -0
- factpulse/models/pdf_validation_result_api.py +170 -0
- factpulse/models/pdp_credentials.py +16 -15
- factpulse/models/percentage.py +146 -0
- factpulse/models/postal_address.py +135 -0
- factpulse/models/price_allowance_amount.py +146 -0
- factpulse/models/price_basis_quantity.py +146 -0
- factpulse/models/processing_options.py +95 -0
- factpulse/models/processing_rule.py +42 -0
- factpulse/models/product_characteristic.py +90 -0
- factpulse/models/product_classification.py +102 -0
- factpulse/models/quantity.py +140 -0
- factpulse/models/rate.py +140 -0
- factpulse/models/rate1.py +140 -0
- factpulse/models/recipient.py +168 -0
- factpulse/models/report_period.py +91 -0
- factpulse/models/report_sender.py +98 -0
- factpulse/models/rounding_amount.py +146 -0
- factpulse/models/routing_code_include.py +38 -0
- factpulse/models/schematron_validation_error.py +128 -0
- factpulse/models/scheme_id.py +18 -4
- factpulse/models/search_flow_request.py +144 -0
- factpulse/models/search_flow_response.py +102 -0
- factpulse/models/search_services_response.py +102 -0
- factpulse/models/search_structure_request.py +120 -0
- factpulse/models/search_structure_response.py +102 -0
- factpulse/models/sellercountry.py +137 -0
- factpulse/models/signature_info.py +7 -6
- factpulse/models/signature_info_api.py +123 -0
- factpulse/models/signature_parameters.py +134 -0
- factpulse/models/simplified_invoice_data.py +151 -0
- factpulse/models/siret_include.py +37 -0
- factpulse/models/structure_info.py +15 -14
- factpulse/models/structure_parameters.py +92 -0
- factpulse/models/structure_service.py +94 -0
- factpulse/models/submission_mode.py +39 -0
- factpulse/models/submit_aggregated_report_request.py +127 -0
- factpulse/models/submit_complete_invoice_request.py +117 -0
- factpulse/models/submit_complete_invoice_response.py +146 -0
- factpulse/models/submit_e_reporting_request.py +127 -0
- factpulse/models/submit_e_reporting_response.py +117 -0
- factpulse/models/submit_flow_request.py +124 -0
- factpulse/models/submit_flow_response.py +110 -0
- factpulse/models/submit_gross_amount.py +140 -0
- factpulse/models/submit_invoice_request.py +177 -0
- factpulse/models/submit_invoice_response.py +104 -0
- factpulse/models/submit_net_amount.py +140 -0
- factpulse/models/submit_vat_amount.py +140 -0
- factpulse/models/supplementary_attachment.py +96 -0
- factpulse/models/supplier.py +226 -0
- factpulse/models/task_response.py +88 -0
- factpulse/models/tax_breakdown_input.py +104 -0
- factpulse/models/tax_due_date_type.py +42 -0
- factpulse/models/tax_representative.py +96 -0
- factpulse/models/taxable_amount.py +140 -0
- factpulse/models/taxableamount.py +140 -0
- factpulse/models/taxamount.py +140 -0
- factpulse/models/taxamount1.py +140 -0
- factpulse/models/taxamount2.py +140 -0
- factpulse/models/taxexclusiveamount.py +140 -0
- factpulse/models/taxexclusiveamount1.py +140 -0
- factpulse/models/total_gross_amount.py +140 -0
- factpulse/models/total_net_amount.py +140 -0
- factpulse/models/total_vat_amount.py +140 -0
- factpulse/models/transaction_category.py +40 -0
- factpulse/models/transmission_type_code.py +38 -0
- factpulse/models/unit_net_price.py +140 -0
- factpulse/models/unit_of_measure.py +42 -0
- factpulse/models/validate_e_reporting_request.py +92 -0
- factpulse/models/validate_e_reporting_response.py +113 -0
- factpulse/models/validation_error.py +6 -5
- factpulse/models/validation_error_detail.py +7 -6
- factpulse/models/validation_error_response.py +88 -0
- factpulse/models/validation_info.py +106 -0
- factpulse/models/validation_success_response.py +88 -0
- factpulse/models/vat_accounting_code.py +40 -0
- factpulse/models/vat_amount.py +140 -0
- factpulse/models/vat_category.py +45 -0
- factpulse/models/vat_line.py +141 -0
- factpulse/models/vat_point_date_code.py +39 -0
- factpulse/models/vat_rate.py +146 -0
- factpulse/models/verification_success_response.py +136 -0
- factpulse/models/verified_field_schema.py +130 -0
- factpulse/rest.py +3 -2
- factpulse-3.0.23.dist-info/METADATA +294 -0
- factpulse-3.0.23.dist-info/RECORD +306 -0
- {factpulse-2.0.37.dist-info → factpulse-3.0.23.dist-info}/licenses/LICENSE +1 -1
- factpulse_helpers/__init__.py +34 -34
- factpulse_helpers/client.py +1020 -795
- factpulse_helpers/exceptions.py +68 -68
- factpulse/api/traitement_facture_api.py +0 -3437
- factpulse/models/adresse_electronique.py +0 -90
- factpulse/models/adresse_postale.py +0 -120
- factpulse/models/cadre_de_facturation.py +0 -110
- factpulse/models/categorie_tva.py +0 -44
- factpulse/models/champ_verifie_schema.py +0 -129
- factpulse/models/code_cadre_facturation.py +0 -39
- factpulse/models/code_raison_reduction.py +0 -42
- factpulse/models/consulter_facture_request.py +0 -98
- factpulse/models/consulter_facture_response.py +0 -142
- factpulse/models/consulter_structure_request.py +0 -100
- factpulse/models/consulter_structure_response.py +0 -142
- factpulse/models/credentials_afnor.py +0 -106
- factpulse/models/credentials_chorus_pro.py +0 -115
- factpulse/models/destinataire.py +0 -130
- factpulse/models/destination_afnor.py +0 -127
- factpulse/models/destination_chorus_pro.py +0 -108
- factpulse/models/dimension_page_schema.py +0 -89
- factpulse/models/direction_flux.py +0 -37
- factpulse/models/donnees_facture_simplifiees.py +0 -124
- factpulse/models/facture_enrichie_info.py +0 -133
- factpulse/models/facture_entrante.py +0 -196
- factpulse/models/facture_factur_x.py +0 -183
- factpulse/models/flux_resume.py +0 -131
- factpulse/models/format_facture.py +0 -38
- factpulse/models/format_sortie.py +0 -37
- factpulse/models/fournisseur.py +0 -153
- factpulse/models/fournisseur_entrant.py +0 -144
- factpulse/models/information_signature_api.py +0 -122
- factpulse/models/ligne_de_poste.py +0 -183
- factpulse/models/ligne_de_poste_montant_remise_ht.py +0 -145
- factpulse/models/ligne_de_poste_taux_tva_manuel.py +0 -145
- factpulse/models/ligne_de_tva.py +0 -132
- factpulse/models/mode_depot.py +0 -38
- factpulse/models/mode_paiement.py +0 -41
- factpulse/models/montant_a_payer.py +0 -139
- factpulse/models/montant_base_ht.py +0 -139
- factpulse/models/montant_ht_total.py +0 -139
- factpulse/models/montant_remise_globale_ttc.py +0 -139
- factpulse/models/montant_total.py +0 -133
- factpulse/models/montant_total_acompte.py +0 -145
- factpulse/models/montant_total_ligne_ht.py +0 -139
- factpulse/models/montant_ttc_total.py +0 -139
- factpulse/models/montant_tva.py +0 -139
- factpulse/models/montant_tva_ligne.py +0 -139
- factpulse/models/montant_tva_total.py +0 -139
- factpulse/models/montant_unitaire_ht.py +0 -139
- factpulse/models/nature_operation.py +0 -49
- factpulse/models/note.py +0 -94
- factpulse/models/note_obligatoire_schema.py +0 -124
- factpulse/models/obtenir_id_chorus_pro_request.py +0 -100
- factpulse/models/obtenir_id_chorus_pro_response.py +0 -98
- factpulse/models/options_processing.py +0 -94
- factpulse/models/parametres_signature.py +0 -133
- factpulse/models/parametres_structure.py +0 -91
- factpulse/models/pdf_factur_x_info.py +0 -91
- factpulse/models/piece_jointe_complementaire.py +0 -95
- factpulse/models/profil_api.py +0 -39
- factpulse/models/profil_flux.py +0 -38
- factpulse/models/quantite.py +0 -139
- factpulse/models/rechercher_services_response.py +0 -101
- factpulse/models/rechercher_structure_request.py +0 -119
- factpulse/models/rechercher_structure_response.py +0 -101
- factpulse/models/references.py +0 -124
- factpulse/models/reponse_healthcheck_afnor.py +0 -91
- factpulse/models/reponse_recherche_flux.py +0 -101
- factpulse/models/reponse_soumission_flux.py +0 -109
- factpulse/models/reponse_tache.py +0 -87
- factpulse/models/reponse_validation_erreur.py +0 -87
- factpulse/models/reponse_validation_succes.py +0 -87
- factpulse/models/reponse_verification_succes.py +0 -135
- factpulse/models/requete_recherche_flux.py +0 -143
- factpulse/models/requete_soumission_flux.py +0 -123
- factpulse/models/resultat_afnor.py +0 -105
- factpulse/models/resultat_chorus_pro.py +0 -101
- factpulse/models/resultat_validation_pdfapi.py +0 -169
- factpulse/models/service_structure.py +0 -93
- factpulse/models/soumettre_facture_complete_request.py +0 -116
- factpulse/models/soumettre_facture_complete_response.py +0 -145
- factpulse/models/soumettre_facture_request.py +0 -176
- factpulse/models/soumettre_facture_response.py +0 -103
- factpulse/models/statut_acquittement.py +0 -38
- factpulse/models/statut_celery.py +0 -40
- factpulse/models/statut_champ_api.py +0 -40
- factpulse/models/statut_facture.py +0 -96
- factpulse/models/statut_tache.py +0 -97
- factpulse/models/syntaxe_flux.py +0 -40
- factpulse/models/tauxmanuel.py +0 -139
- factpulse/models/type_document.py +0 -40
- factpulse/models/type_facture.py +0 -37
- factpulse/models/type_flux.py +0 -40
- factpulse/models/type_tva.py +0 -39
- factpulse/models/unite.py +0 -41
- factpulse/models/validation_error_loc_inner.py +0 -138
- factpulse-2.0.37.dist-info/METADATA +0 -292
- factpulse-2.0.37.dist-info/RECORD +0 -134
- {factpulse-2.0.37.dist-info → factpulse-3.0.23.dist-info}/WHEEL +0 -0
- {factpulse-2.0.37.dist-info → factpulse-3.0.23.dist-info}/top_level.txt +0 -0
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from factpulse.models.adresse_electronique import AdresseElectronique
|
|
23
|
-
from factpulse.models.adresse_postale import AdressePostale
|
|
24
|
-
from typing import Optional, Set
|
|
25
|
-
from typing_extensions import Self
|
|
26
|
-
|
|
27
|
-
class FournisseurEntrant(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
Fournisseur extrait d'une facture entrante. Contrairement au modèle Fournisseur de models.py, ce modèle n'a pas de champ id_fournisseur car cette information n'est pas disponible dans les XML Factur-X/CII/UBL.
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
nom: StrictStr = Field(description="Raison sociale du fournisseur (BT-27)")
|
|
32
|
-
siren: Optional[StrictStr] = None
|
|
33
|
-
siret: Optional[StrictStr] = None
|
|
34
|
-
numero_tva_intra: Optional[StrictStr] = None
|
|
35
|
-
adresse_postale: Optional[AdressePostale] = None
|
|
36
|
-
adresse_electronique: Optional[AdresseElectronique] = None
|
|
37
|
-
email: Optional[StrictStr] = None
|
|
38
|
-
telephone: Optional[StrictStr] = None
|
|
39
|
-
__properties: ClassVar[List[str]] = ["nom", "siren", "siret", "numero_tva_intra", "adresse_postale", "adresse_electronique", "email", "telephone"]
|
|
40
|
-
|
|
41
|
-
model_config = ConfigDict(
|
|
42
|
-
populate_by_name=True,
|
|
43
|
-
validate_assignment=True,
|
|
44
|
-
protected_namespaces=(),
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def to_str(self) -> str:
|
|
49
|
-
"""Returns the string representation of the model using alias"""
|
|
50
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
-
|
|
52
|
-
def to_json(self) -> str:
|
|
53
|
-
"""Returns the JSON representation of the model using alias"""
|
|
54
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
-
return json.dumps(self.to_dict())
|
|
56
|
-
|
|
57
|
-
@classmethod
|
|
58
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
-
"""Create an instance of FournisseurEntrant from a JSON string"""
|
|
60
|
-
return cls.from_dict(json.loads(json_str))
|
|
61
|
-
|
|
62
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
-
"""Return the dictionary representation of the model using alias.
|
|
64
|
-
|
|
65
|
-
This has the following differences from calling pydantic's
|
|
66
|
-
`self.model_dump(by_alias=True)`:
|
|
67
|
-
|
|
68
|
-
* `None` is only added to the output dict for nullable fields that
|
|
69
|
-
were set at model initialization. Other fields with value `None`
|
|
70
|
-
are ignored.
|
|
71
|
-
"""
|
|
72
|
-
excluded_fields: Set[str] = set([
|
|
73
|
-
])
|
|
74
|
-
|
|
75
|
-
_dict = self.model_dump(
|
|
76
|
-
by_alias=True,
|
|
77
|
-
exclude=excluded_fields,
|
|
78
|
-
exclude_none=True,
|
|
79
|
-
)
|
|
80
|
-
# override the default output from pydantic by calling `to_dict()` of adresse_postale
|
|
81
|
-
if self.adresse_postale:
|
|
82
|
-
_dict['adresse_postale'] = self.adresse_postale.to_dict()
|
|
83
|
-
# override the default output from pydantic by calling `to_dict()` of adresse_electronique
|
|
84
|
-
if self.adresse_electronique:
|
|
85
|
-
_dict['adresse_electronique'] = self.adresse_electronique.to_dict()
|
|
86
|
-
# set to None if siren (nullable) is None
|
|
87
|
-
# and model_fields_set contains the field
|
|
88
|
-
if self.siren is None and "siren" in self.model_fields_set:
|
|
89
|
-
_dict['siren'] = None
|
|
90
|
-
|
|
91
|
-
# set to None if siret (nullable) is None
|
|
92
|
-
# and model_fields_set contains the field
|
|
93
|
-
if self.siret is None and "siret" in self.model_fields_set:
|
|
94
|
-
_dict['siret'] = None
|
|
95
|
-
|
|
96
|
-
# set to None if numero_tva_intra (nullable) is None
|
|
97
|
-
# and model_fields_set contains the field
|
|
98
|
-
if self.numero_tva_intra is None and "numero_tva_intra" in self.model_fields_set:
|
|
99
|
-
_dict['numero_tva_intra'] = None
|
|
100
|
-
|
|
101
|
-
# set to None if adresse_postale (nullable) is None
|
|
102
|
-
# and model_fields_set contains the field
|
|
103
|
-
if self.adresse_postale is None and "adresse_postale" in self.model_fields_set:
|
|
104
|
-
_dict['adresse_postale'] = None
|
|
105
|
-
|
|
106
|
-
# set to None if adresse_electronique (nullable) is None
|
|
107
|
-
# and model_fields_set contains the field
|
|
108
|
-
if self.adresse_electronique is None and "adresse_electronique" in self.model_fields_set:
|
|
109
|
-
_dict['adresse_electronique'] = None
|
|
110
|
-
|
|
111
|
-
# set to None if email (nullable) is None
|
|
112
|
-
# and model_fields_set contains the field
|
|
113
|
-
if self.email is None and "email" in self.model_fields_set:
|
|
114
|
-
_dict['email'] = None
|
|
115
|
-
|
|
116
|
-
# set to None if telephone (nullable) is None
|
|
117
|
-
# and model_fields_set contains the field
|
|
118
|
-
if self.telephone is None and "telephone" in self.model_fields_set:
|
|
119
|
-
_dict['telephone'] = None
|
|
120
|
-
|
|
121
|
-
return _dict
|
|
122
|
-
|
|
123
|
-
@classmethod
|
|
124
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
125
|
-
"""Create an instance of FournisseurEntrant from a dict"""
|
|
126
|
-
if obj is None:
|
|
127
|
-
return None
|
|
128
|
-
|
|
129
|
-
if not isinstance(obj, dict):
|
|
130
|
-
return cls.model_validate(obj)
|
|
131
|
-
|
|
132
|
-
_obj = cls.model_validate({
|
|
133
|
-
"nom": obj.get("nom"),
|
|
134
|
-
"siren": obj.get("siren"),
|
|
135
|
-
"siret": obj.get("siret"),
|
|
136
|
-
"numero_tva_intra": obj.get("numero_tva_intra"),
|
|
137
|
-
"adresse_postale": AdressePostale.from_dict(obj["adresse_postale"]) if obj.get("adresse_postale") is not None else None,
|
|
138
|
-
"adresse_electronique": AdresseElectronique.from_dict(obj["adresse_electronique"]) if obj.get("adresse_electronique") is not None else None,
|
|
139
|
-
"email": obj.get("email"),
|
|
140
|
-
"telephone": obj.get("telephone")
|
|
141
|
-
})
|
|
142
|
-
return _obj
|
|
143
|
-
|
|
144
|
-
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from typing import Optional, Set
|
|
23
|
-
from typing_extensions import Self
|
|
24
|
-
|
|
25
|
-
class InformationSignatureAPI(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
Informations sur une signature électronique dans un PDF.
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
nom_champ: StrictStr = Field(description="Nom du champ de signature dans le PDF")
|
|
30
|
-
signataire: Optional[StrictStr] = None
|
|
31
|
-
date_signature: Optional[StrictStr] = None
|
|
32
|
-
raison: Optional[StrictStr] = None
|
|
33
|
-
localisation: Optional[StrictStr] = None
|
|
34
|
-
est_valide: Optional[StrictBool] = None
|
|
35
|
-
__properties: ClassVar[List[str]] = ["nom_champ", "signataire", "date_signature", "raison", "localisation", "est_valide"]
|
|
36
|
-
|
|
37
|
-
model_config = ConfigDict(
|
|
38
|
-
populate_by_name=True,
|
|
39
|
-
validate_assignment=True,
|
|
40
|
-
protected_namespaces=(),
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def to_str(self) -> str:
|
|
45
|
-
"""Returns the string representation of the model using alias"""
|
|
46
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
-
|
|
48
|
-
def to_json(self) -> str:
|
|
49
|
-
"""Returns the JSON representation of the model using alias"""
|
|
50
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
-
return json.dumps(self.to_dict())
|
|
52
|
-
|
|
53
|
-
@classmethod
|
|
54
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
-
"""Create an instance of InformationSignatureAPI from a JSON string"""
|
|
56
|
-
return cls.from_dict(json.loads(json_str))
|
|
57
|
-
|
|
58
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
-
"""Return the dictionary representation of the model using alias.
|
|
60
|
-
|
|
61
|
-
This has the following differences from calling pydantic's
|
|
62
|
-
`self.model_dump(by_alias=True)`:
|
|
63
|
-
|
|
64
|
-
* `None` is only added to the output dict for nullable fields that
|
|
65
|
-
were set at model initialization. Other fields with value `None`
|
|
66
|
-
are ignored.
|
|
67
|
-
"""
|
|
68
|
-
excluded_fields: Set[str] = set([
|
|
69
|
-
])
|
|
70
|
-
|
|
71
|
-
_dict = self.model_dump(
|
|
72
|
-
by_alias=True,
|
|
73
|
-
exclude=excluded_fields,
|
|
74
|
-
exclude_none=True,
|
|
75
|
-
)
|
|
76
|
-
# set to None if signataire (nullable) is None
|
|
77
|
-
# and model_fields_set contains the field
|
|
78
|
-
if self.signataire is None and "signataire" in self.model_fields_set:
|
|
79
|
-
_dict['signataire'] = None
|
|
80
|
-
|
|
81
|
-
# set to None if date_signature (nullable) is None
|
|
82
|
-
# and model_fields_set contains the field
|
|
83
|
-
if self.date_signature is None and "date_signature" in self.model_fields_set:
|
|
84
|
-
_dict['date_signature'] = None
|
|
85
|
-
|
|
86
|
-
# set to None if raison (nullable) is None
|
|
87
|
-
# and model_fields_set contains the field
|
|
88
|
-
if self.raison is None and "raison" in self.model_fields_set:
|
|
89
|
-
_dict['raison'] = None
|
|
90
|
-
|
|
91
|
-
# set to None if localisation (nullable) is None
|
|
92
|
-
# and model_fields_set contains the field
|
|
93
|
-
if self.localisation is None and "localisation" in self.model_fields_set:
|
|
94
|
-
_dict['localisation'] = None
|
|
95
|
-
|
|
96
|
-
# set to None if est_valide (nullable) is None
|
|
97
|
-
# and model_fields_set contains the field
|
|
98
|
-
if self.est_valide is None and "est_valide" in self.model_fields_set:
|
|
99
|
-
_dict['est_valide'] = None
|
|
100
|
-
|
|
101
|
-
return _dict
|
|
102
|
-
|
|
103
|
-
@classmethod
|
|
104
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
105
|
-
"""Create an instance of InformationSignatureAPI from a dict"""
|
|
106
|
-
if obj is None:
|
|
107
|
-
return None
|
|
108
|
-
|
|
109
|
-
if not isinstance(obj, dict):
|
|
110
|
-
return cls.model_validate(obj)
|
|
111
|
-
|
|
112
|
-
_obj = cls.model_validate({
|
|
113
|
-
"nom_champ": obj.get("nom_champ"),
|
|
114
|
-
"signataire": obj.get("signataire"),
|
|
115
|
-
"date_signature": obj.get("date_signature"),
|
|
116
|
-
"raison": obj.get("raison"),
|
|
117
|
-
"localisation": obj.get("localisation"),
|
|
118
|
-
"est_valide": obj.get("est_valide")
|
|
119
|
-
})
|
|
120
|
-
return _obj
|
|
121
|
-
|
|
122
|
-
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from factpulse.models.categorie_tva import CategorieTVA
|
|
23
|
-
from factpulse.models.code_raison_reduction import CodeRaisonReduction
|
|
24
|
-
from factpulse.models.ligne_de_poste_montant_remise_ht import LigneDePosteMontantRemiseHt
|
|
25
|
-
from factpulse.models.ligne_de_poste_taux_tva_manuel import LigneDePosteTauxTvaManuel
|
|
26
|
-
from factpulse.models.montant_total_ligne_ht import MontantTotalLigneHt
|
|
27
|
-
from factpulse.models.montant_unitaire_ht import MontantUnitaireHt
|
|
28
|
-
from factpulse.models.quantite import Quantite
|
|
29
|
-
from factpulse.models.unite import Unite
|
|
30
|
-
from typing import Optional, Set
|
|
31
|
-
from typing_extensions import Self
|
|
32
|
-
|
|
33
|
-
class LigneDePoste(BaseModel):
|
|
34
|
-
"""
|
|
35
|
-
Représente une ligne de détail dans une facture.
|
|
36
|
-
""" # noqa: E501
|
|
37
|
-
numero: StrictInt
|
|
38
|
-
reference: Optional[StrictStr] = None
|
|
39
|
-
denomination: StrictStr
|
|
40
|
-
quantite: Quantite
|
|
41
|
-
unite: Unite
|
|
42
|
-
montant_unitaire_ht: MontantUnitaireHt = Field(alias="montantUnitaireHt")
|
|
43
|
-
montant_remise_ht: Optional[LigneDePosteMontantRemiseHt] = Field(default=None, alias="montantRemiseHt")
|
|
44
|
-
montant_total_ligne_ht: Optional[MontantTotalLigneHt] = Field(default=None, alias="montantTotalLigneHt")
|
|
45
|
-
taux_tva: Optional[StrictStr] = Field(default=None, alias="tauxTva")
|
|
46
|
-
taux_tva_manuel: Optional[LigneDePosteTauxTvaManuel] = Field(default=None, alias="tauxTvaManuel")
|
|
47
|
-
categorie_tva: Optional[CategorieTVA] = Field(default=None, alias="categorieTva")
|
|
48
|
-
date_debut_periode: Optional[StrictStr] = Field(default=None, alias="dateDebutPeriode")
|
|
49
|
-
date_fin_periode: Optional[StrictStr] = Field(default=None, alias="dateFinPeriode")
|
|
50
|
-
code_raison_reduction: Optional[CodeRaisonReduction] = Field(default=None, alias="codeRaisonReduction")
|
|
51
|
-
raison_reduction: Optional[StrictStr] = Field(default=None, alias="raisonReduction")
|
|
52
|
-
__properties: ClassVar[List[str]] = ["numero", "reference", "denomination", "quantite", "unite", "montantUnitaireHt", "montantRemiseHt", "montantTotalLigneHt", "tauxTva", "tauxTvaManuel", "categorieTva", "dateDebutPeriode", "dateFinPeriode", "codeRaisonReduction", "raisonReduction"]
|
|
53
|
-
|
|
54
|
-
model_config = ConfigDict(
|
|
55
|
-
populate_by_name=True,
|
|
56
|
-
validate_assignment=True,
|
|
57
|
-
protected_namespaces=(),
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
def to_str(self) -> str:
|
|
62
|
-
"""Returns the string representation of the model using alias"""
|
|
63
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
64
|
-
|
|
65
|
-
def to_json(self) -> str:
|
|
66
|
-
"""Returns the JSON representation of the model using alias"""
|
|
67
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
68
|
-
return json.dumps(self.to_dict())
|
|
69
|
-
|
|
70
|
-
@classmethod
|
|
71
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
72
|
-
"""Create an instance of LigneDePoste from a JSON string"""
|
|
73
|
-
return cls.from_dict(json.loads(json_str))
|
|
74
|
-
|
|
75
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
76
|
-
"""Return the dictionary representation of the model using alias.
|
|
77
|
-
|
|
78
|
-
This has the following differences from calling pydantic's
|
|
79
|
-
`self.model_dump(by_alias=True)`:
|
|
80
|
-
|
|
81
|
-
* `None` is only added to the output dict for nullable fields that
|
|
82
|
-
were set at model initialization. Other fields with value `None`
|
|
83
|
-
are ignored.
|
|
84
|
-
"""
|
|
85
|
-
excluded_fields: Set[str] = set([
|
|
86
|
-
])
|
|
87
|
-
|
|
88
|
-
_dict = self.model_dump(
|
|
89
|
-
by_alias=True,
|
|
90
|
-
exclude=excluded_fields,
|
|
91
|
-
exclude_none=True,
|
|
92
|
-
)
|
|
93
|
-
# override the default output from pydantic by calling `to_dict()` of quantite
|
|
94
|
-
if self.quantite:
|
|
95
|
-
_dict['quantite'] = self.quantite.to_dict()
|
|
96
|
-
# override the default output from pydantic by calling `to_dict()` of montant_unitaire_ht
|
|
97
|
-
if self.montant_unitaire_ht:
|
|
98
|
-
_dict['montantUnitaireHt'] = self.montant_unitaire_ht.to_dict()
|
|
99
|
-
# override the default output from pydantic by calling `to_dict()` of montant_remise_ht
|
|
100
|
-
if self.montant_remise_ht:
|
|
101
|
-
_dict['montantRemiseHt'] = self.montant_remise_ht.to_dict()
|
|
102
|
-
# override the default output from pydantic by calling `to_dict()` of montant_total_ligne_ht
|
|
103
|
-
if self.montant_total_ligne_ht:
|
|
104
|
-
_dict['montantTotalLigneHt'] = self.montant_total_ligne_ht.to_dict()
|
|
105
|
-
# override the default output from pydantic by calling `to_dict()` of taux_tva_manuel
|
|
106
|
-
if self.taux_tva_manuel:
|
|
107
|
-
_dict['tauxTvaManuel'] = self.taux_tva_manuel.to_dict()
|
|
108
|
-
# set to None if reference (nullable) is None
|
|
109
|
-
# and model_fields_set contains the field
|
|
110
|
-
if self.reference is None and "reference" in self.model_fields_set:
|
|
111
|
-
_dict['reference'] = None
|
|
112
|
-
|
|
113
|
-
# set to None if montant_remise_ht (nullable) is None
|
|
114
|
-
# and model_fields_set contains the field
|
|
115
|
-
if self.montant_remise_ht is None and "montant_remise_ht" in self.model_fields_set:
|
|
116
|
-
_dict['montantRemiseHt'] = None
|
|
117
|
-
|
|
118
|
-
# set to None if taux_tva (nullable) is None
|
|
119
|
-
# and model_fields_set contains the field
|
|
120
|
-
if self.taux_tva is None and "taux_tva" in self.model_fields_set:
|
|
121
|
-
_dict['tauxTva'] = None
|
|
122
|
-
|
|
123
|
-
# set to None if taux_tva_manuel (nullable) is None
|
|
124
|
-
# and model_fields_set contains the field
|
|
125
|
-
if self.taux_tva_manuel is None and "taux_tva_manuel" in self.model_fields_set:
|
|
126
|
-
_dict['tauxTvaManuel'] = None
|
|
127
|
-
|
|
128
|
-
# set to None if categorie_tva (nullable) is None
|
|
129
|
-
# and model_fields_set contains the field
|
|
130
|
-
if self.categorie_tva is None and "categorie_tva" in self.model_fields_set:
|
|
131
|
-
_dict['categorieTva'] = None
|
|
132
|
-
|
|
133
|
-
# set to None if date_debut_periode (nullable) is None
|
|
134
|
-
# and model_fields_set contains the field
|
|
135
|
-
if self.date_debut_periode is None and "date_debut_periode" in self.model_fields_set:
|
|
136
|
-
_dict['dateDebutPeriode'] = None
|
|
137
|
-
|
|
138
|
-
# set to None if date_fin_periode (nullable) is None
|
|
139
|
-
# and model_fields_set contains the field
|
|
140
|
-
if self.date_fin_periode is None and "date_fin_periode" in self.model_fields_set:
|
|
141
|
-
_dict['dateFinPeriode'] = None
|
|
142
|
-
|
|
143
|
-
# set to None if code_raison_reduction (nullable) is None
|
|
144
|
-
# and model_fields_set contains the field
|
|
145
|
-
if self.code_raison_reduction is None and "code_raison_reduction" in self.model_fields_set:
|
|
146
|
-
_dict['codeRaisonReduction'] = None
|
|
147
|
-
|
|
148
|
-
# set to None if raison_reduction (nullable) is None
|
|
149
|
-
# and model_fields_set contains the field
|
|
150
|
-
if self.raison_reduction is None and "raison_reduction" in self.model_fields_set:
|
|
151
|
-
_dict['raisonReduction'] = None
|
|
152
|
-
|
|
153
|
-
return _dict
|
|
154
|
-
|
|
155
|
-
@classmethod
|
|
156
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
157
|
-
"""Create an instance of LigneDePoste from a dict"""
|
|
158
|
-
if obj is None:
|
|
159
|
-
return None
|
|
160
|
-
|
|
161
|
-
if not isinstance(obj, dict):
|
|
162
|
-
return cls.model_validate(obj)
|
|
163
|
-
|
|
164
|
-
_obj = cls.model_validate({
|
|
165
|
-
"numero": obj.get("numero"),
|
|
166
|
-
"reference": obj.get("reference"),
|
|
167
|
-
"denomination": obj.get("denomination"),
|
|
168
|
-
"quantite": Quantite.from_dict(obj["quantite"]) if obj.get("quantite") is not None else None,
|
|
169
|
-
"unite": obj.get("unite"),
|
|
170
|
-
"montantUnitaireHt": MontantUnitaireHt.from_dict(obj["montantUnitaireHt"]) if obj.get("montantUnitaireHt") is not None else None,
|
|
171
|
-
"montantRemiseHt": LigneDePosteMontantRemiseHt.from_dict(obj["montantRemiseHt"]) if obj.get("montantRemiseHt") is not None else None,
|
|
172
|
-
"montantTotalLigneHt": MontantTotalLigneHt.from_dict(obj["montantTotalLigneHt"]) if obj.get("montantTotalLigneHt") is not None else None,
|
|
173
|
-
"tauxTva": obj.get("tauxTva"),
|
|
174
|
-
"tauxTvaManuel": LigneDePosteTauxTvaManuel.from_dict(obj["tauxTvaManuel"]) if obj.get("tauxTvaManuel") is not None else None,
|
|
175
|
-
"categorieTva": obj.get("categorieTva"),
|
|
176
|
-
"dateDebutPeriode": obj.get("dateDebutPeriode"),
|
|
177
|
-
"dateFinPeriode": obj.get("dateFinPeriode"),
|
|
178
|
-
"codeRaisonReduction": obj.get("codeRaisonReduction"),
|
|
179
|
-
"raisonReduction": obj.get("raisonReduction")
|
|
180
|
-
})
|
|
181
|
-
return _obj
|
|
182
|
-
|
|
183
|
-
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
from inspect import getfullargspec
|
|
17
|
-
import json
|
|
18
|
-
import pprint
|
|
19
|
-
import re # noqa: F401
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
21
|
-
from typing import Optional, Union
|
|
22
|
-
from typing_extensions import Annotated
|
|
23
|
-
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
24
|
-
from typing_extensions import Literal, Self
|
|
25
|
-
from pydantic import Field
|
|
26
|
-
|
|
27
|
-
LIGNEDEPOSTEMONTANTREMISEHT_ANY_OF_SCHEMAS = ["float", "str"]
|
|
28
|
-
|
|
29
|
-
class LigneDePosteMontantRemiseHt(BaseModel):
|
|
30
|
-
"""
|
|
31
|
-
Montant de la remise HT. (Accepte number, string ou integer)
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
# data type: float
|
|
35
|
-
anyof_schema_1_validator: Optional[Union[Annotated[float, Field(strict=True, ge=0.0)], Annotated[int, Field(strict=True, ge=0)]]] = None
|
|
36
|
-
# data type: str
|
|
37
|
-
anyof_schema_2_validator: Optional[Annotated[str, Field(strict=True)]] = None
|
|
38
|
-
if TYPE_CHECKING:
|
|
39
|
-
actual_instance: Optional[Union[float, str]] = None
|
|
40
|
-
else:
|
|
41
|
-
actual_instance: Any = None
|
|
42
|
-
any_of_schemas: Set[str] = { "float", "str" }
|
|
43
|
-
|
|
44
|
-
model_config = {
|
|
45
|
-
"validate_assignment": True,
|
|
46
|
-
"protected_namespaces": (),
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
def __init__(self, *args, **kwargs) -> None:
|
|
50
|
-
if args:
|
|
51
|
-
if len(args) > 1:
|
|
52
|
-
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
53
|
-
if kwargs:
|
|
54
|
-
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
55
|
-
super().__init__(actual_instance=args[0])
|
|
56
|
-
else:
|
|
57
|
-
super().__init__(**kwargs)
|
|
58
|
-
|
|
59
|
-
@field_validator('actual_instance')
|
|
60
|
-
def actual_instance_must_validate_anyof(cls, v):
|
|
61
|
-
if v is None:
|
|
62
|
-
return v
|
|
63
|
-
|
|
64
|
-
instance = LigneDePosteMontantRemiseHt.model_construct()
|
|
65
|
-
error_messages = []
|
|
66
|
-
# validate data type: float
|
|
67
|
-
try:
|
|
68
|
-
instance.anyof_schema_1_validator = v
|
|
69
|
-
return v
|
|
70
|
-
except (ValidationError, ValueError) as e:
|
|
71
|
-
error_messages.append(str(e))
|
|
72
|
-
# validate data type: str
|
|
73
|
-
try:
|
|
74
|
-
instance.anyof_schema_2_validator = v
|
|
75
|
-
return v
|
|
76
|
-
except (ValidationError, ValueError) as e:
|
|
77
|
-
error_messages.append(str(e))
|
|
78
|
-
if error_messages:
|
|
79
|
-
# no match
|
|
80
|
-
raise ValueError("No match found when setting the actual_instance in LigneDePosteMontantRemiseHt with anyOf schemas: float, str. Details: " + ", ".join(error_messages))
|
|
81
|
-
else:
|
|
82
|
-
return v
|
|
83
|
-
|
|
84
|
-
@classmethod
|
|
85
|
-
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
|
86
|
-
return cls.from_json(json.dumps(obj))
|
|
87
|
-
|
|
88
|
-
@classmethod
|
|
89
|
-
def from_json(cls, json_str: str) -> Self:
|
|
90
|
-
"""Returns the object represented by the json string"""
|
|
91
|
-
instance = cls.model_construct()
|
|
92
|
-
if json_str is None:
|
|
93
|
-
return instance
|
|
94
|
-
|
|
95
|
-
error_messages = []
|
|
96
|
-
# deserialize data into float
|
|
97
|
-
try:
|
|
98
|
-
# validation
|
|
99
|
-
instance.anyof_schema_1_validator = json.loads(json_str)
|
|
100
|
-
# assign value to actual_instance
|
|
101
|
-
instance.actual_instance = instance.anyof_schema_1_validator
|
|
102
|
-
return instance
|
|
103
|
-
except (ValidationError, ValueError) as e:
|
|
104
|
-
error_messages.append(str(e))
|
|
105
|
-
# deserialize data into str
|
|
106
|
-
try:
|
|
107
|
-
# validation
|
|
108
|
-
instance.anyof_schema_2_validator = json.loads(json_str)
|
|
109
|
-
# assign value to actual_instance
|
|
110
|
-
instance.actual_instance = instance.anyof_schema_2_validator
|
|
111
|
-
return instance
|
|
112
|
-
except (ValidationError, ValueError) as e:
|
|
113
|
-
error_messages.append(str(e))
|
|
114
|
-
|
|
115
|
-
if error_messages:
|
|
116
|
-
# no match
|
|
117
|
-
raise ValueError("No match found when deserializing the JSON string into LigneDePosteMontantRemiseHt with anyOf schemas: float, str. Details: " + ", ".join(error_messages))
|
|
118
|
-
else:
|
|
119
|
-
return instance
|
|
120
|
-
|
|
121
|
-
def to_json(self) -> str:
|
|
122
|
-
"""Returns the JSON representation of the actual instance"""
|
|
123
|
-
if self.actual_instance is None:
|
|
124
|
-
return "null"
|
|
125
|
-
|
|
126
|
-
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
127
|
-
return self.actual_instance.to_json()
|
|
128
|
-
else:
|
|
129
|
-
return json.dumps(self.actual_instance)
|
|
130
|
-
|
|
131
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], float, str]]:
|
|
132
|
-
"""Returns the dict representation of the actual instance"""
|
|
133
|
-
if self.actual_instance is None:
|
|
134
|
-
return None
|
|
135
|
-
|
|
136
|
-
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
137
|
-
return self.actual_instance.to_dict()
|
|
138
|
-
else:
|
|
139
|
-
return self.actual_instance
|
|
140
|
-
|
|
141
|
-
def to_str(self) -> str:
|
|
142
|
-
"""Returns the string representation of the actual instance"""
|
|
143
|
-
return pprint.pformat(self.model_dump())
|
|
144
|
-
|
|
145
|
-
|