factpulse 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +28 -0
  3. data/Gemfile +9 -0
  4. data/Gemfile.lock +74 -0
  5. data/LICENSE +21 -0
  6. data/README.md +161 -0
  7. data/Rakefile +10 -0
  8. data/docs/AFNORPDPPAApi.md +69 -0
  9. data/docs/AFNORPDPPADirectoryServiceApi.md +196 -0
  10. data/docs/AFNORPDPPAFlowServiceApi.md +258 -0
  11. data/docs/AdresseElectronique.md +20 -0
  12. data/docs/AdressePostale.md +26 -0
  13. data/docs/BodyAjouterFichierApiV1ChorusProTransversesAjouterFichierPost.md +22 -0
  14. data/docs/BodyCompleterFactureApiV1ChorusProFacturesCompleterPost.md +22 -0
  15. data/docs/BodyListerServicesStructureApiV1ChorusProStructuresIdStructureCppServicesGet.md +20 -0
  16. data/docs/BodyRechercherFacturesDestinataireApiV1ChorusProFacturesRechercherDestinatairePost.md +22 -0
  17. data/docs/BodyRechercherFacturesFournisseurApiV1ChorusProFacturesRechercherFournisseurPost.md +22 -0
  18. data/docs/BodyRecyclerFactureApiV1ChorusProFacturesRecyclerPost.md +22 -0
  19. data/docs/BodyTelechargerGroupeFacturesApiV1ChorusProFacturesTelechargerGroupePost.md +22 -0
  20. data/docs/BodyTraiterFactureRecueApiV1ChorusProFacturesTraiterFactureRecuePost.md +22 -0
  21. data/docs/BodyValideurConsulterFactureApiV1ChorusProFacturesValideurConsulterPost.md +22 -0
  22. data/docs/BodyValideurRechercherFacturesApiV1ChorusProFacturesValideurRechercherPost.md +22 -0
  23. data/docs/BodyValideurTraiterFactureApiV1ChorusProFacturesValideurTraiterPost.md +22 -0
  24. data/docs/CadreDeFacturation.md +22 -0
  25. data/docs/CategorieTVA.md +15 -0
  26. data/docs/CertificateInfoResponse.md +40 -0
  27. data/docs/ChorusProApi.md +1129 -0
  28. data/docs/ChorusProCredentials.md +26 -0
  29. data/docs/CodeCadreFacturation.md +15 -0
  30. data/docs/CodeRaisonReduction.md +15 -0
  31. data/docs/ConsulterFactureRequest.md +20 -0
  32. data/docs/ConsulterFactureResponse.md +34 -0
  33. data/docs/ConsulterStructureRequest.md +22 -0
  34. data/docs/ConsulterStructureResponse.md +34 -0
  35. data/docs/CredentialsAFNOR.md +22 -0
  36. data/docs/CredentialsChorusPro.md +26 -0
  37. data/docs/Destinataire.md +24 -0
  38. data/docs/Destination.md +79 -0
  39. data/docs/DestinationAFNOR.md +24 -0
  40. data/docs/DestinationChorusPro.md +20 -0
  41. data/docs/DirectionFlux.md +15 -0
  42. data/docs/DonneesFactureSimplifiees.md +34 -0
  43. data/docs/FactureEnrichieInfoInput.md +32 -0
  44. data/docs/FactureEnrichieInfoOutput.md +32 -0
  45. data/docs/FactureFacturX.md +44 -0
  46. data/docs/FluxResume.md +32 -0
  47. data/docs/FormatSortie.md +15 -0
  48. data/docs/Fournisseur.md +34 -0
  49. data/docs/GenerateCertificateRequest.md +38 -0
  50. data/docs/GenerateCertificateResponse.md +32 -0
  51. data/docs/HTTPValidationError.md +18 -0
  52. data/docs/InformationSignatureAPI.md +28 -0
  53. data/docs/LigneDePoste.md +46 -0
  54. data/docs/LigneDePosteMontantRemiseHt.md +15 -0
  55. data/docs/LigneDePosteMontantTotalLigneHt.md +15 -0
  56. data/docs/LigneDePosteTauxTvaManuel.md +15 -0
  57. data/docs/LigneDeTVA.md +26 -0
  58. data/docs/ModeDepot.md +15 -0
  59. data/docs/ModePaiement.md +15 -0
  60. data/docs/MontantHtTotal.md +15 -0
  61. data/docs/MontantTotal.md +30 -0
  62. data/docs/MontantTotalAcompte.md +15 -0
  63. data/docs/MontantTotalMontantRemiseGlobaleTtc.md +15 -0
  64. data/docs/MontantTtcTotal.md +15 -0
  65. data/docs/MontantTva.md +15 -0
  66. data/docs/Montantapayer.md +15 -0
  67. data/docs/Montantbaseht.md +15 -0
  68. data/docs/Montanthttotal.md +15 -0
  69. data/docs/Montantttctotal.md +15 -0
  70. data/docs/Montanttva.md +15 -0
  71. data/docs/Montanttva1.md +15 -0
  72. data/docs/Montantunitaireht.md +15 -0
  73. data/docs/ObtenirIdChorusProRequest.md +22 -0
  74. data/docs/ObtenirIdChorusProResponse.md +24 -0
  75. data/docs/OptionsProcessing.md +24 -0
  76. data/docs/PDFFacturXInfo.md +22 -0
  77. data/docs/PDPCredentials.md +24 -0
  78. data/docs/ParametresSignature.md +34 -0
  79. data/docs/ParametresStructure.md +22 -0
  80. data/docs/PieceJointeComplementaire.md +26 -0
  81. data/docs/ProcessingEndpointsUnifisApi.md +147 -0
  82. data/docs/ProfilAPI.md +15 -0
  83. data/docs/ProfilFlux.md +15 -0
  84. data/docs/Quantite.md +15 -0
  85. data/docs/QuotaInfo.md +26 -0
  86. data/docs/RechercherServicesResponse.md +24 -0
  87. data/docs/RechercherStructureRequest.md +26 -0
  88. data/docs/RechercherStructureResponse.md +24 -0
  89. data/docs/References.md +32 -0
  90. data/docs/ReponseHealthcheckAFNOR.md +22 -0
  91. data/docs/ReponseRechercheFlux.md +24 -0
  92. data/docs/ReponseSoumissionFlux.md +30 -0
  93. data/docs/ReponseTache.md +18 -0
  94. data/docs/ReponseValidationErreur.md +18 -0
  95. data/docs/ReponseValidationSucces.md +18 -0
  96. data/docs/RequeteRechercheFlux.md +34 -0
  97. data/docs/RequeteSoumissionFlux.md +28 -0
  98. data/docs/ResultatAFNOR.md +26 -0
  99. data/docs/ResultatChorusPro.md +22 -0
  100. data/docs/ResultatValidationPDFAPI.md +62 -0
  101. data/docs/SantApi.md +69 -0
  102. data/docs/SchemeID.md +15 -0
  103. data/docs/ServiceStructure.md +24 -0
  104. data/docs/SignatureInfo.md +22 -0
  105. data/docs/SignatureLectroniqueApi.md +315 -0
  106. data/docs/SoumettreFactureCompleteRequest.md +26 -0
  107. data/docs/SoumettreFactureCompleteResponse.md +34 -0
  108. data/docs/SoumettreFactureRequest.md +46 -0
  109. data/docs/SoumettreFactureResponse.md +24 -0
  110. data/docs/StatutAcquittement.md +15 -0
  111. data/docs/StatutFacture.md +22 -0
  112. data/docs/StatutTache.md +22 -0
  113. data/docs/StructureInfo.md +26 -0
  114. data/docs/SyntaxeFlux.md +15 -0
  115. data/docs/Tauxmanuel.md +15 -0
  116. data/docs/TraitementFactureApi.md +831 -0
  117. data/docs/TypeFacture.md +15 -0
  118. data/docs/TypeFlux.md +15 -0
  119. data/docs/TypeTVA.md +15 -0
  120. data/docs/Unite.md +15 -0
  121. data/docs/Utilisateur.md +40 -0
  122. data/docs/UtilisateurApi.md +74 -0
  123. data/docs/ValidationError.md +22 -0
  124. data/docs/ValidationErrorLocInner.md +15 -0
  125. data/factpulse.gemspec +39 -0
  126. data/git_push.sh +57 -0
  127. data/lib/factpulse/api/afnorpdppa_api.rb +79 -0
  128. data/lib/factpulse/api/afnorpdppa_directory_service_api.rb +199 -0
  129. data/lib/factpulse/api/afnorpdppa_flow_service_api.rb +256 -0
  130. data/lib/factpulse/api/chorus_pro_api.rb +1116 -0
  131. data/lib/factpulse/api/processing_endpoints_unifis_api.rb +158 -0
  132. data/lib/factpulse/api/sant_api.rb +79 -0
  133. data/lib/factpulse/api/signature_lectronique_api.rb +333 -0
  134. data/lib/factpulse/api/traitement_facture_api.rb +835 -0
  135. data/lib/factpulse/api/utilisateur_api.rb +79 -0
  136. data/lib/factpulse/api_client.rb +393 -0
  137. data/lib/factpulse/api_error.rb +58 -0
  138. data/lib/factpulse/api_model_base.rb +88 -0
  139. data/lib/factpulse/configuration.rb +308 -0
  140. data/lib/factpulse/models/adresse_electronique.rb +196 -0
  141. data/lib/factpulse/models/adresse_postale.rb +189 -0
  142. data/lib/factpulse/models/body_ajouter_fichier_api_v1_chorus_pro_transverses_ajouter_fichier_post.rb +202 -0
  143. data/lib/factpulse/models/body_completer_facture_api_v1_chorus_pro_factures_completer_post.rb +202 -0
  144. data/lib/factpulse/models/body_lister_services_structure_api_v1_chorus_pro_structures_id_structure_cpp_services_get.rb +174 -0
  145. data/lib/factpulse/models/body_rechercher_factures_destinataire_api_v1_chorus_pro_factures_rechercher_destinataire_post.rb +202 -0
  146. data/lib/factpulse/models/body_rechercher_factures_fournisseur_api_v1_chorus_pro_factures_rechercher_fournisseur_post.rb +202 -0
  147. data/lib/factpulse/models/body_recycler_facture_api_v1_chorus_pro_factures_recycler_post.rb +202 -0
  148. data/lib/factpulse/models/body_telecharger_groupe_factures_api_v1_chorus_pro_factures_telecharger_groupe_post.rb +202 -0
  149. data/lib/factpulse/models/body_traiter_facture_recue_api_v1_chorus_pro_factures_traiter_facture_recue_post.rb +202 -0
  150. data/lib/factpulse/models/body_valideur_consulter_facture_api_v1_chorus_pro_factures_valideur_consulter_post.rb +202 -0
  151. data/lib/factpulse/models/body_valideur_rechercher_factures_api_v1_chorus_pro_factures_valideur_rechercher_post.rb +202 -0
  152. data/lib/factpulse/models/body_valideur_traiter_facture_api_v1_chorus_pro_factures_valideur_traiter_post.rb +202 -0
  153. data/lib/factpulse/models/cadre_de_facturation.rb +207 -0
  154. data/lib/factpulse/models/categorie_tva.rb +47 -0
  155. data/lib/factpulse/models/certificate_info_response.rb +446 -0
  156. data/lib/factpulse/models/chorus_pro_credentials.rb +259 -0
  157. data/lib/factpulse/models/code_cadre_facturation.rb +42 -0
  158. data/lib/factpulse/models/code_raison_reduction.rb +45 -0
  159. data/lib/factpulse/models/consulter_facture_request.rb +176 -0
  160. data/lib/factpulse/models/consulter_facture_response.rb +261 -0
  161. data/lib/factpulse/models/consulter_structure_request.rb +188 -0
  162. data/lib/factpulse/models/consulter_structure_response.rb +261 -0
  163. data/lib/factpulse/models/credentials_afnor.rb +169 -0
  164. data/lib/factpulse/models/credentials_chorus_pro.rb +191 -0
  165. data/lib/factpulse/models/destinataire.rb +195 -0
  166. data/lib/factpulse/models/destination.rb +56 -0
  167. data/lib/factpulse/models/destination_afnor.rb +228 -0
  168. data/lib/factpulse/models/destination_chorus_pro.rb +194 -0
  169. data/lib/factpulse/models/direction_flux.rb +40 -0
  170. data/lib/factpulse/models/donnees_facture_simplifiees.rb +342 -0
  171. data/lib/factpulse/models/facture_enrichie_info_input.rb +315 -0
  172. data/lib/factpulse/models/facture_enrichie_info_output.rb +348 -0
  173. data/lib/factpulse/models/facture_factur_x.rb +432 -0
  174. data/lib/factpulse/models/flux_resume.rb +251 -0
  175. data/lib/factpulse/models/format_sortie.rb +40 -0
  176. data/lib/factpulse/models/fournisseur.rb +261 -0
  177. data/lib/factpulse/models/generate_certificate_request.rb +323 -0
  178. data/lib/factpulse/models/generate_certificate_response.rb +254 -0
  179. data/lib/factpulse/models/http_validation_error.rb +149 -0
  180. data/lib/factpulse/models/information_signature_api.rb +216 -0
  181. data/lib/factpulse/models/ligne_de_poste.rb +391 -0
  182. data/lib/factpulse/models/ligne_de_poste_montant_remise_ht.rb +104 -0
  183. data/lib/factpulse/models/ligne_de_poste_montant_total_ligne_ht.rb +104 -0
  184. data/lib/factpulse/models/ligne_de_poste_taux_tva_manuel.rb +104 -0
  185. data/lib/factpulse/models/ligne_de_tva.rb +242 -0
  186. data/lib/factpulse/models/mode_depot.rb +41 -0
  187. data/lib/factpulse/models/mode_paiement.rb +44 -0
  188. data/lib/factpulse/models/montant_ht_total.rb +103 -0
  189. data/lib/factpulse/models/montant_total.rb +273 -0
  190. data/lib/factpulse/models/montant_total_acompte.rb +104 -0
  191. data/lib/factpulse/models/montant_total_montant_remise_globale_ttc.rb +104 -0
  192. data/lib/factpulse/models/montant_ttc_total.rb +103 -0
  193. data/lib/factpulse/models/montant_tva.rb +103 -0
  194. data/lib/factpulse/models/montantapayer.rb +104 -0
  195. data/lib/factpulse/models/montantbaseht.rb +104 -0
  196. data/lib/factpulse/models/montanthttotal.rb +104 -0
  197. data/lib/factpulse/models/montantttctotal.rb +104 -0
  198. data/lib/factpulse/models/montanttva.rb +104 -0
  199. data/lib/factpulse/models/montanttva1.rb +104 -0
  200. data/lib/factpulse/models/montantunitaireht.rb +104 -0
  201. data/lib/factpulse/models/obtenir_id_chorus_pro_request.rb +188 -0
  202. data/lib/factpulse/models/obtenir_id_chorus_pro_response.rb +230 -0
  203. data/lib/factpulse/models/options_processing.rb +221 -0
  204. data/lib/factpulse/models/parametres_signature.rb +235 -0
  205. data/lib/factpulse/models/parametres_structure.rb +175 -0
  206. data/lib/factpulse/models/pdf_factur_x_info.rb +205 -0
  207. data/lib/factpulse/models/pdp_credentials.rb +247 -0
  208. data/lib/factpulse/models/piece_jointe_complementaire.rb +269 -0
  209. data/lib/factpulse/models/profil_api.rb +42 -0
  210. data/lib/factpulse/models/profil_flux.rb +41 -0
  211. data/lib/factpulse/models/quantite.rb +104 -0
  212. data/lib/factpulse/models/quota_info.rb +269 -0
  213. data/lib/factpulse/models/rechercher_services_response.rb +214 -0
  214. data/lib/factpulse/models/rechercher_structure_request.rb +191 -0
  215. data/lib/factpulse/models/rechercher_structure_response.rb +216 -0
  216. data/lib/factpulse/models/references.rb +290 -0
  217. data/lib/factpulse/models/reponse_healthcheck_afnor.rb +220 -0
  218. data/lib/factpulse/models/reponse_recherche_flux.rb +249 -0
  219. data/lib/factpulse/models/reponse_soumission_flux.rb +294 -0
  220. data/lib/factpulse/models/reponse_tache.rb +165 -0
  221. data/lib/factpulse/models/reponse_validation_erreur.rb +167 -0
  222. data/lib/factpulse/models/reponse_validation_succes.rb +165 -0
  223. data/lib/factpulse/models/requete_recherche_flux.rb +306 -0
  224. data/lib/factpulse/models/requete_soumission_flux.rb +238 -0
  225. data/lib/factpulse/models/resultat_afnor.rb +240 -0
  226. data/lib/factpulse/models/resultat_chorus_pro.rb +186 -0
  227. data/lib/factpulse/models/resultat_validation_pdfapi.rb +523 -0
  228. data/lib/factpulse/models/scheme_id.rb +43 -0
  229. data/lib/factpulse/models/service_structure.rb +247 -0
  230. data/lib/factpulse/models/signature_info.rb +186 -0
  231. data/lib/factpulse/models/soumettre_facture_complete_request.rb +239 -0
  232. data/lib/factpulse/models/soumettre_facture_complete_response.rb +355 -0
  233. data/lib/factpulse/models/soumettre_facture_request.rb +391 -0
  234. data/lib/factpulse/models/soumettre_facture_response.rb +213 -0
  235. data/lib/factpulse/models/statut_acquittement.rb +41 -0
  236. data/lib/factpulse/models/statut_facture.rb +203 -0
  237. data/lib/factpulse/models/statut_tache.rb +201 -0
  238. data/lib/factpulse/models/structure_info.rb +274 -0
  239. data/lib/factpulse/models/syntaxe_flux.rb +43 -0
  240. data/lib/factpulse/models/tauxmanuel.rb +104 -0
  241. data/lib/factpulse/models/type_facture.rb +40 -0
  242. data/lib/factpulse/models/type_flux.rb +43 -0
  243. data/lib/factpulse/models/type_tva.rb +42 -0
  244. data/lib/factpulse/models/unite.rb +44 -0
  245. data/lib/factpulse/models/utilisateur.rb +328 -0
  246. data/lib/factpulse/models/validation_error.rb +218 -0
  247. data/lib/factpulse/models/validation_error_loc_inner.rb +103 -0
  248. data/lib/factpulse/version.rb +15 -0
  249. data/lib/factpulse.rb +157 -0
  250. metadata +382 -0
@@ -0,0 +1,432 @@
1
+ =begin
2
+ #API REST FactPulse
3
+
4
+ # 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\" }' ``` **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/
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.18.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Modèle de données pour une facture destinée à être convertie en Factur-X.
18
+ class FactureFacturX < ApiModelBase
19
+ attr_accessor :numero_facture
20
+
21
+ attr_accessor :date_echeance_paiement
22
+
23
+ attr_accessor :date_facture
24
+
25
+ attr_accessor :mode_depot
26
+
27
+ attr_accessor :destinataire
28
+
29
+ attr_accessor :fournisseur
30
+
31
+ attr_accessor :cadre_de_facturation
32
+
33
+ attr_accessor :references
34
+
35
+ attr_accessor :montant_total
36
+
37
+ attr_accessor :lignes_de_poste
38
+
39
+ attr_accessor :lignes_de_tva
40
+
41
+ attr_accessor :commentaire
42
+
43
+ attr_accessor :id_utilisateur_courant
44
+
45
+ attr_accessor :pieces_jointes_complementaires
46
+
47
+ class EnumAttributeValidator
48
+ attr_reader :datatype
49
+ attr_reader :allowable_values
50
+
51
+ def initialize(datatype, allowable_values)
52
+ @allowable_values = allowable_values.map do |value|
53
+ case datatype.to_s
54
+ when /Integer/i
55
+ value.to_i
56
+ when /Float/i
57
+ value.to_f
58
+ else
59
+ value
60
+ end
61
+ end
62
+ end
63
+
64
+ def valid?(value)
65
+ !value || allowable_values.include?(value)
66
+ end
67
+ end
68
+
69
+ # Attribute mapping from ruby-style variable name to JSON key.
70
+ def self.attribute_map
71
+ {
72
+ :'numero_facture' => :'numeroFacture',
73
+ :'date_echeance_paiement' => :'dateEcheancePaiement',
74
+ :'date_facture' => :'dateFacture',
75
+ :'mode_depot' => :'modeDepot',
76
+ :'destinataire' => :'destinataire',
77
+ :'fournisseur' => :'fournisseur',
78
+ :'cadre_de_facturation' => :'cadreDeFacturation',
79
+ :'references' => :'references',
80
+ :'montant_total' => :'montantTotal',
81
+ :'lignes_de_poste' => :'lignesDePoste',
82
+ :'lignes_de_tva' => :'lignesDeTva',
83
+ :'commentaire' => :'commentaire',
84
+ :'id_utilisateur_courant' => :'idUtilisateurCourant',
85
+ :'pieces_jointes_complementaires' => :'piecesJointesComplementaires'
86
+ }
87
+ end
88
+
89
+ # Returns attribute mapping this model knows about
90
+ def self.acceptable_attribute_map
91
+ attribute_map
92
+ end
93
+
94
+ # Returns all the JSON keys this model knows about
95
+ def self.acceptable_attributes
96
+ acceptable_attribute_map.values
97
+ end
98
+
99
+ # Attribute type mapping.
100
+ def self.openapi_types
101
+ {
102
+ :'numero_facture' => :'String',
103
+ :'date_echeance_paiement' => :'String',
104
+ :'date_facture' => :'String',
105
+ :'mode_depot' => :'ModeDepot',
106
+ :'destinataire' => :'Destinataire',
107
+ :'fournisseur' => :'Fournisseur',
108
+ :'cadre_de_facturation' => :'CadreDeFacturation',
109
+ :'references' => :'References',
110
+ :'montant_total' => :'MontantTotal',
111
+ :'lignes_de_poste' => :'Array<LigneDePoste>',
112
+ :'lignes_de_tva' => :'Array<LigneDeTVA>',
113
+ :'commentaire' => :'String',
114
+ :'id_utilisateur_courant' => :'Integer',
115
+ :'pieces_jointes_complementaires' => :'Array<PieceJointeComplementaire>'
116
+ }
117
+ end
118
+
119
+ # List of attributes with nullable: true
120
+ def self.openapi_nullable
121
+ Set.new([
122
+ :'commentaire',
123
+ :'id_utilisateur_courant',
124
+ :'pieces_jointes_complementaires'
125
+ ])
126
+ end
127
+
128
+ # Initializes the object
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ def initialize(attributes = {})
131
+ if (!attributes.is_a?(Hash))
132
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::FactureFacturX` initialize method"
133
+ end
134
+
135
+ # check to see if the attribute exists and convert string to symbol for hash key
136
+ acceptable_attribute_map = self.class.acceptable_attribute_map
137
+ attributes = attributes.each_with_object({}) { |(k, v), h|
138
+ if (!acceptable_attribute_map.key?(k.to_sym))
139
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::FactureFacturX`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
140
+ end
141
+ h[k.to_sym] = v
142
+ }
143
+
144
+ if attributes.key?(:'numero_facture')
145
+ self.numero_facture = attributes[:'numero_facture']
146
+ else
147
+ self.numero_facture = nil
148
+ end
149
+
150
+ if attributes.key?(:'date_echeance_paiement')
151
+ self.date_echeance_paiement = attributes[:'date_echeance_paiement']
152
+ else
153
+ self.date_echeance_paiement = nil
154
+ end
155
+
156
+ if attributes.key?(:'date_facture')
157
+ self.date_facture = attributes[:'date_facture']
158
+ end
159
+
160
+ if attributes.key?(:'mode_depot')
161
+ self.mode_depot = attributes[:'mode_depot']
162
+ else
163
+ self.mode_depot = nil
164
+ end
165
+
166
+ if attributes.key?(:'destinataire')
167
+ self.destinataire = attributes[:'destinataire']
168
+ else
169
+ self.destinataire = nil
170
+ end
171
+
172
+ if attributes.key?(:'fournisseur')
173
+ self.fournisseur = attributes[:'fournisseur']
174
+ else
175
+ self.fournisseur = nil
176
+ end
177
+
178
+ if attributes.key?(:'cadre_de_facturation')
179
+ self.cadre_de_facturation = attributes[:'cadre_de_facturation']
180
+ else
181
+ self.cadre_de_facturation = nil
182
+ end
183
+
184
+ if attributes.key?(:'references')
185
+ self.references = attributes[:'references']
186
+ else
187
+ self.references = nil
188
+ end
189
+
190
+ if attributes.key?(:'montant_total')
191
+ self.montant_total = attributes[:'montant_total']
192
+ else
193
+ self.montant_total = nil
194
+ end
195
+
196
+ if attributes.key?(:'lignes_de_poste')
197
+ if (value = attributes[:'lignes_de_poste']).is_a?(Array)
198
+ self.lignes_de_poste = value
199
+ end
200
+ end
201
+
202
+ if attributes.key?(:'lignes_de_tva')
203
+ if (value = attributes[:'lignes_de_tva']).is_a?(Array)
204
+ self.lignes_de_tva = value
205
+ end
206
+ end
207
+
208
+ if attributes.key?(:'commentaire')
209
+ self.commentaire = attributes[:'commentaire']
210
+ end
211
+
212
+ if attributes.key?(:'id_utilisateur_courant')
213
+ self.id_utilisateur_courant = attributes[:'id_utilisateur_courant']
214
+ end
215
+
216
+ if attributes.key?(:'pieces_jointes_complementaires')
217
+ if (value = attributes[:'pieces_jointes_complementaires']).is_a?(Array)
218
+ self.pieces_jointes_complementaires = value
219
+ end
220
+ end
221
+ end
222
+
223
+ # Show invalid properties with the reasons. Usually used together with valid?
224
+ # @return Array for valid properties with the reasons
225
+ def list_invalid_properties
226
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
227
+ invalid_properties = Array.new
228
+ if @numero_facture.nil?
229
+ invalid_properties.push('invalid value for "numero_facture", numero_facture cannot be nil.')
230
+ end
231
+
232
+ if @date_echeance_paiement.nil?
233
+ invalid_properties.push('invalid value for "date_echeance_paiement", date_echeance_paiement cannot be nil.')
234
+ end
235
+
236
+ if @mode_depot.nil?
237
+ invalid_properties.push('invalid value for "mode_depot", mode_depot cannot be nil.')
238
+ end
239
+
240
+ if @destinataire.nil?
241
+ invalid_properties.push('invalid value for "destinataire", destinataire cannot be nil.')
242
+ end
243
+
244
+ if @fournisseur.nil?
245
+ invalid_properties.push('invalid value for "fournisseur", fournisseur cannot be nil.')
246
+ end
247
+
248
+ if @cadre_de_facturation.nil?
249
+ invalid_properties.push('invalid value for "cadre_de_facturation", cadre_de_facturation cannot be nil.')
250
+ end
251
+
252
+ if @references.nil?
253
+ invalid_properties.push('invalid value for "references", references cannot be nil.')
254
+ end
255
+
256
+ if @montant_total.nil?
257
+ invalid_properties.push('invalid value for "montant_total", montant_total cannot be nil.')
258
+ end
259
+
260
+ invalid_properties
261
+ end
262
+
263
+ # Check to see if the all the properties in the model are valid
264
+ # @return true if the model is valid
265
+ def valid?
266
+ warn '[DEPRECATED] the `valid?` method is obsolete'
267
+ return false if @numero_facture.nil?
268
+ return false if @date_echeance_paiement.nil?
269
+ return false if @mode_depot.nil?
270
+ return false if @destinataire.nil?
271
+ return false if @fournisseur.nil?
272
+ return false if @cadre_de_facturation.nil?
273
+ return false if @references.nil?
274
+ return false if @montant_total.nil?
275
+ true
276
+ end
277
+
278
+ # Custom attribute writer method with validation
279
+ # @param [Object] numero_facture Value to be assigned
280
+ def numero_facture=(numero_facture)
281
+ if numero_facture.nil?
282
+ fail ArgumentError, 'numero_facture cannot be nil'
283
+ end
284
+
285
+ @numero_facture = numero_facture
286
+ end
287
+
288
+ # Custom attribute writer method with validation
289
+ # @param [Object] date_echeance_paiement Value to be assigned
290
+ def date_echeance_paiement=(date_echeance_paiement)
291
+ if date_echeance_paiement.nil?
292
+ fail ArgumentError, 'date_echeance_paiement cannot be nil'
293
+ end
294
+
295
+ @date_echeance_paiement = date_echeance_paiement
296
+ end
297
+
298
+ # Custom attribute writer method with validation
299
+ # @param [Object] mode_depot Value to be assigned
300
+ def mode_depot=(mode_depot)
301
+ if mode_depot.nil?
302
+ fail ArgumentError, 'mode_depot cannot be nil'
303
+ end
304
+
305
+ @mode_depot = mode_depot
306
+ end
307
+
308
+ # Custom attribute writer method with validation
309
+ # @param [Object] destinataire Value to be assigned
310
+ def destinataire=(destinataire)
311
+ if destinataire.nil?
312
+ fail ArgumentError, 'destinataire cannot be nil'
313
+ end
314
+
315
+ @destinataire = destinataire
316
+ end
317
+
318
+ # Custom attribute writer method with validation
319
+ # @param [Object] fournisseur Value to be assigned
320
+ def fournisseur=(fournisseur)
321
+ if fournisseur.nil?
322
+ fail ArgumentError, 'fournisseur cannot be nil'
323
+ end
324
+
325
+ @fournisseur = fournisseur
326
+ end
327
+
328
+ # Custom attribute writer method with validation
329
+ # @param [Object] cadre_de_facturation Value to be assigned
330
+ def cadre_de_facturation=(cadre_de_facturation)
331
+ if cadre_de_facturation.nil?
332
+ fail ArgumentError, 'cadre_de_facturation cannot be nil'
333
+ end
334
+
335
+ @cadre_de_facturation = cadre_de_facturation
336
+ end
337
+
338
+ # Custom attribute writer method with validation
339
+ # @param [Object] references Value to be assigned
340
+ def references=(references)
341
+ if references.nil?
342
+ fail ArgumentError, 'references cannot be nil'
343
+ end
344
+
345
+ @references = references
346
+ end
347
+
348
+ # Custom attribute writer method with validation
349
+ # @param [Object] montant_total Value to be assigned
350
+ def montant_total=(montant_total)
351
+ if montant_total.nil?
352
+ fail ArgumentError, 'montant_total cannot be nil'
353
+ end
354
+
355
+ @montant_total = montant_total
356
+ end
357
+
358
+ # Checks equality by comparing each attribute.
359
+ # @param [Object] Object to be compared
360
+ def ==(o)
361
+ return true if self.equal?(o)
362
+ self.class == o.class &&
363
+ numero_facture == o.numero_facture &&
364
+ date_echeance_paiement == o.date_echeance_paiement &&
365
+ date_facture == o.date_facture &&
366
+ mode_depot == o.mode_depot &&
367
+ destinataire == o.destinataire &&
368
+ fournisseur == o.fournisseur &&
369
+ cadre_de_facturation == o.cadre_de_facturation &&
370
+ references == o.references &&
371
+ montant_total == o.montant_total &&
372
+ lignes_de_poste == o.lignes_de_poste &&
373
+ lignes_de_tva == o.lignes_de_tva &&
374
+ commentaire == o.commentaire &&
375
+ id_utilisateur_courant == o.id_utilisateur_courant &&
376
+ pieces_jointes_complementaires == o.pieces_jointes_complementaires
377
+ end
378
+
379
+ # @see the `==` method
380
+ # @param [Object] Object to be compared
381
+ def eql?(o)
382
+ self == o
383
+ end
384
+
385
+ # Calculates hash code according to all attributes.
386
+ # @return [Integer] Hash code
387
+ def hash
388
+ [numero_facture, date_echeance_paiement, date_facture, mode_depot, destinataire, fournisseur, cadre_de_facturation, references, montant_total, lignes_de_poste, lignes_de_tva, commentaire, id_utilisateur_courant, pieces_jointes_complementaires].hash
389
+ end
390
+
391
+ # Builds the object from hash
392
+ # @param [Hash] attributes Model attributes in the form of hash
393
+ # @return [Object] Returns the model itself
394
+ def self.build_from_hash(attributes)
395
+ return nil unless attributes.is_a?(Hash)
396
+ attributes = attributes.transform_keys(&:to_sym)
397
+ transformed_hash = {}
398
+ openapi_types.each_pair do |key, type|
399
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
400
+ transformed_hash["#{key}"] = nil
401
+ elsif type =~ /\AArray<(.*)>/i
402
+ # check to ensure the input is an array given that the attribute
403
+ # is documented as an array but the input is not
404
+ if attributes[attribute_map[key]].is_a?(Array)
405
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
406
+ end
407
+ elsif !attributes[attribute_map[key]].nil?
408
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
409
+ end
410
+ end
411
+ new(transformed_hash)
412
+ end
413
+
414
+ # Returns the object in the form of hash
415
+ # @return [Hash] Returns the object in the form of hash
416
+ def to_hash
417
+ hash = {}
418
+ self.class.attribute_map.each_pair do |attr, param|
419
+ value = self.send(attr)
420
+ if value.nil?
421
+ is_nullable = self.class.openapi_nullable.include?(attr)
422
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
423
+ end
424
+
425
+ hash[param] = _to_hash(value)
426
+ end
427
+ hash
428
+ end
429
+
430
+ end
431
+
432
+ end
@@ -0,0 +1,251 @@
1
+ =begin
2
+ #API REST FactPulse
3
+
4
+ # 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\" }' ``` **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/
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.18.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Résumé d'un flux dans les résultats de recherche
18
+ class FluxResume < ApiModelBase
19
+ attr_accessor :flow_id
20
+
21
+ attr_accessor :tracking_id
22
+
23
+ attr_accessor :nom
24
+
25
+ attr_accessor :type_flux
26
+
27
+ attr_accessor :direction_flux
28
+
29
+ attr_accessor :statut_acquittement
30
+
31
+ attr_accessor :date_creation
32
+
33
+ attr_accessor :date_maj
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'flow_id' => :'flow_id',
39
+ :'tracking_id' => :'tracking_id',
40
+ :'nom' => :'nom',
41
+ :'type_flux' => :'type_flux',
42
+ :'direction_flux' => :'direction_flux',
43
+ :'statut_acquittement' => :'statut_acquittement',
44
+ :'date_creation' => :'date_creation',
45
+ :'date_maj' => :'date_maj'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'flow_id' => :'String',
63
+ :'tracking_id' => :'String',
64
+ :'nom' => :'String',
65
+ :'type_flux' => :'String',
66
+ :'direction_flux' => :'String',
67
+ :'statut_acquittement' => :'String',
68
+ :'date_creation' => :'String',
69
+ :'date_maj' => :'String'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ :'tracking_id',
77
+ :'type_flux',
78
+ :'direction_flux',
79
+ :'statut_acquittement',
80
+ :'date_creation',
81
+ :'date_maj'
82
+ ])
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ if (!attributes.is_a?(Hash))
89
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::FluxResume` initialize method"
90
+ end
91
+
92
+ # check to see if the attribute exists and convert string to symbol for hash key
93
+ acceptable_attribute_map = self.class.acceptable_attribute_map
94
+ attributes = attributes.each_with_object({}) { |(k, v), h|
95
+ if (!acceptable_attribute_map.key?(k.to_sym))
96
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::FluxResume`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
97
+ end
98
+ h[k.to_sym] = v
99
+ }
100
+
101
+ if attributes.key?(:'flow_id')
102
+ self.flow_id = attributes[:'flow_id']
103
+ else
104
+ self.flow_id = nil
105
+ end
106
+
107
+ if attributes.key?(:'tracking_id')
108
+ self.tracking_id = attributes[:'tracking_id']
109
+ end
110
+
111
+ if attributes.key?(:'nom')
112
+ self.nom = attributes[:'nom']
113
+ else
114
+ self.nom = nil
115
+ end
116
+
117
+ if attributes.key?(:'type_flux')
118
+ self.type_flux = attributes[:'type_flux']
119
+ end
120
+
121
+ if attributes.key?(:'direction_flux')
122
+ self.direction_flux = attributes[:'direction_flux']
123
+ end
124
+
125
+ if attributes.key?(:'statut_acquittement')
126
+ self.statut_acquittement = attributes[:'statut_acquittement']
127
+ end
128
+
129
+ if attributes.key?(:'date_creation')
130
+ self.date_creation = attributes[:'date_creation']
131
+ end
132
+
133
+ if attributes.key?(:'date_maj')
134
+ self.date_maj = attributes[:'date_maj']
135
+ end
136
+ end
137
+
138
+ # Show invalid properties with the reasons. Usually used together with valid?
139
+ # @return Array for valid properties with the reasons
140
+ def list_invalid_properties
141
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
142
+ invalid_properties = Array.new
143
+ if @flow_id.nil?
144
+ invalid_properties.push('invalid value for "flow_id", flow_id cannot be nil.')
145
+ end
146
+
147
+ if @nom.nil?
148
+ invalid_properties.push('invalid value for "nom", nom cannot be nil.')
149
+ end
150
+
151
+ invalid_properties
152
+ end
153
+
154
+ # Check to see if the all the properties in the model are valid
155
+ # @return true if the model is valid
156
+ def valid?
157
+ warn '[DEPRECATED] the `valid?` method is obsolete'
158
+ return false if @flow_id.nil?
159
+ return false if @nom.nil?
160
+ true
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] flow_id Value to be assigned
165
+ def flow_id=(flow_id)
166
+ if flow_id.nil?
167
+ fail ArgumentError, 'flow_id cannot be nil'
168
+ end
169
+
170
+ @flow_id = flow_id
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param [Object] nom Value to be assigned
175
+ def nom=(nom)
176
+ if nom.nil?
177
+ fail ArgumentError, 'nom cannot be nil'
178
+ end
179
+
180
+ @nom = nom
181
+ end
182
+
183
+ # Checks equality by comparing each attribute.
184
+ # @param [Object] Object to be compared
185
+ def ==(o)
186
+ return true if self.equal?(o)
187
+ self.class == o.class &&
188
+ flow_id == o.flow_id &&
189
+ tracking_id == o.tracking_id &&
190
+ nom == o.nom &&
191
+ type_flux == o.type_flux &&
192
+ direction_flux == o.direction_flux &&
193
+ statut_acquittement == o.statut_acquittement &&
194
+ date_creation == o.date_creation &&
195
+ date_maj == o.date_maj
196
+ end
197
+
198
+ # @see the `==` method
199
+ # @param [Object] Object to be compared
200
+ def eql?(o)
201
+ self == o
202
+ end
203
+
204
+ # Calculates hash code according to all attributes.
205
+ # @return [Integer] Hash code
206
+ def hash
207
+ [flow_id, tracking_id, nom, type_flux, direction_flux, statut_acquittement, date_creation, date_maj].hash
208
+ end
209
+
210
+ # Builds the object from hash
211
+ # @param [Hash] attributes Model attributes in the form of hash
212
+ # @return [Object] Returns the model itself
213
+ def self.build_from_hash(attributes)
214
+ return nil unless attributes.is_a?(Hash)
215
+ attributes = attributes.transform_keys(&:to_sym)
216
+ transformed_hash = {}
217
+ openapi_types.each_pair do |key, type|
218
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
219
+ transformed_hash["#{key}"] = nil
220
+ elsif type =~ /\AArray<(.*)>/i
221
+ # check to ensure the input is an array given that the attribute
222
+ # is documented as an array but the input is not
223
+ if attributes[attribute_map[key]].is_a?(Array)
224
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
225
+ end
226
+ elsif !attributes[attribute_map[key]].nil?
227
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
228
+ end
229
+ end
230
+ new(transformed_hash)
231
+ end
232
+
233
+ # Returns the object in the form of hash
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_hash
236
+ hash = {}
237
+ self.class.attribute_map.each_pair do |attr, param|
238
+ value = self.send(attr)
239
+ if value.nil?
240
+ is_nullable = self.class.openapi_nullable.include?(attr)
241
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
+ end
243
+
244
+ hash[param] = _to_hash(value)
245
+ end
246
+ hash
247
+ end
248
+
249
+ end
250
+
251
+ end