factpulse 2.0.34 → 2.0.36

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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -3
  3. data/Gemfile.lock +2 -2
  4. data/docs/BoundingBoxSchema.md +30 -0
  5. data/docs/CadreDeFacturation.md +2 -0
  6. data/docs/ChampVerifieSchema.md +34 -0
  7. data/docs/DimensionPageSchema.md +20 -0
  8. data/docs/DirectionFlux.md +15 -0
  9. data/docs/FluxResume.md +32 -0
  10. data/docs/LigneDeTVA.md +5 -1
  11. data/docs/NatureOperation.md +15 -0
  12. data/docs/Note.md +4 -4
  13. data/docs/NoteObligatoireSchema.md +30 -0
  14. data/docs/PDPCredentials.md +26 -0
  15. data/docs/ProfilFlux.md +15 -0
  16. data/docs/ReponseHealthcheckAFNOR.md +22 -0
  17. data/docs/ReponseRechercheFlux.md +24 -0
  18. data/docs/ReponseSoumissionFlux.md +30 -0
  19. data/docs/ReponseVerificationSucces.md +36 -0
  20. data/docs/RequeteRechercheFlux.md +34 -0
  21. data/docs/RequeteSoumissionFlux.md +28 -0
  22. data/docs/StatutAcquittement.md +15 -0
  23. data/docs/StatutChampAPI.md +15 -0
  24. data/docs/SyntaxeFlux.md +15 -0
  25. data/docs/TraitementFactureApi.md +2 -2
  26. data/docs/TypeFlux.md +15 -0
  27. data/docs/VrificationPDFXMLApi.md +435 -0
  28. data/lib/factpulse/api/traitement_facture_api.rb +4 -4
  29. data/lib/factpulse/api/vrification_pdfxml_api.rb +430 -0
  30. data/lib/factpulse/helpers/client.rb +2 -1
  31. data/lib/factpulse/models/bounding_box_schema.rb +332 -0
  32. data/lib/factpulse/models/cadre_de_facturation.rb +12 -2
  33. data/lib/factpulse/models/champ_verifie_schema.rb +334 -0
  34. data/lib/factpulse/models/dimension_page_schema.rb +193 -0
  35. data/lib/factpulse/models/direction_flux.rb +40 -0
  36. data/lib/factpulse/models/flux_resume.rb +251 -0
  37. data/lib/factpulse/models/ligne_de_tva.rb +26 -6
  38. data/lib/factpulse/models/nature_operation.rb +66 -0
  39. data/lib/factpulse/models/note.rb +23 -23
  40. data/lib/factpulse/models/note_obligatoire_schema.rb +265 -0
  41. data/lib/factpulse/models/pdp_credentials.rb +257 -0
  42. data/lib/factpulse/models/profil_flux.rb +41 -0
  43. data/lib/factpulse/models/reponse_healthcheck_afnor.rb +220 -0
  44. data/lib/factpulse/models/reponse_recherche_flux.rb +249 -0
  45. data/lib/factpulse/models/reponse_soumission_flux.rb +294 -0
  46. data/lib/factpulse/models/reponse_verification_succes.rb +343 -0
  47. data/lib/factpulse/models/requete_recherche_flux.rb +306 -0
  48. data/lib/factpulse/models/requete_soumission_flux.rb +238 -0
  49. data/lib/factpulse/models/statut_acquittement.rb +41 -0
  50. data/lib/factpulse/models/statut_champ_api.rb +43 -0
  51. data/lib/factpulse/models/syntaxe_flux.rb +43 -0
  52. data/lib/factpulse/models/type_flux.rb +43 -0
  53. data/lib/factpulse/version.rb +1 -1
  54. data/lib/factpulse.rb +20 -0
  55. metadata +42 -2
@@ -0,0 +1,294 @@
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\" }' ``` **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/
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éponse après soumission d'un flux
18
+ class ReponseSoumissionFlux < ApiModelBase
19
+ # Identifiant unique du flux généré par la PDP
20
+ attr_accessor :flow_id
21
+
22
+ attr_accessor :tracking_id
23
+
24
+ # Nom du flux
25
+ attr_accessor :nom
26
+
27
+ # Syntaxe du flux (CII, UBL, etc.)
28
+ attr_accessor :syntaxe_flux
29
+
30
+ attr_accessor :profil_flux
31
+
32
+ # Hash SHA256 du fichier soumis
33
+ attr_accessor :sha256
34
+
35
+ # Message de confirmation
36
+ attr_accessor :message
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'flow_id' => :'flow_id',
42
+ :'tracking_id' => :'tracking_id',
43
+ :'nom' => :'nom',
44
+ :'syntaxe_flux' => :'syntaxe_flux',
45
+ :'profil_flux' => :'profil_flux',
46
+ :'sha256' => :'sha256',
47
+ :'message' => :'message'
48
+ }
49
+ end
50
+
51
+ # Returns attribute mapping this model knows about
52
+ def self.acceptable_attribute_map
53
+ attribute_map
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ acceptable_attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'flow_id' => :'String',
65
+ :'tracking_id' => :'String',
66
+ :'nom' => :'String',
67
+ :'syntaxe_flux' => :'String',
68
+ :'profil_flux' => :'String',
69
+ :'sha256' => :'String',
70
+ :'message' => :'String'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ :'tracking_id',
78
+ :'profil_flux',
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::ReponseSoumissionFlux` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::ReponseSoumissionFlux`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'flow_id')
99
+ self.flow_id = attributes[:'flow_id']
100
+ else
101
+ self.flow_id = nil
102
+ end
103
+
104
+ if attributes.key?(:'tracking_id')
105
+ self.tracking_id = attributes[:'tracking_id']
106
+ end
107
+
108
+ if attributes.key?(:'nom')
109
+ self.nom = attributes[:'nom']
110
+ else
111
+ self.nom = nil
112
+ end
113
+
114
+ if attributes.key?(:'syntaxe_flux')
115
+ self.syntaxe_flux = attributes[:'syntaxe_flux']
116
+ else
117
+ self.syntaxe_flux = nil
118
+ end
119
+
120
+ if attributes.key?(:'profil_flux')
121
+ self.profil_flux = attributes[:'profil_flux']
122
+ end
123
+
124
+ if attributes.key?(:'sha256')
125
+ self.sha256 = attributes[:'sha256']
126
+ else
127
+ self.sha256 = nil
128
+ end
129
+
130
+ if attributes.key?(:'message')
131
+ self.message = attributes[:'message']
132
+ else
133
+ self.message = nil
134
+ end
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properties with the reasons
139
+ def list_invalid_properties
140
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
141
+ invalid_properties = Array.new
142
+ if @flow_id.nil?
143
+ invalid_properties.push('invalid value for "flow_id", flow_id cannot be nil.')
144
+ end
145
+
146
+ if @nom.nil?
147
+ invalid_properties.push('invalid value for "nom", nom cannot be nil.')
148
+ end
149
+
150
+ if @syntaxe_flux.nil?
151
+ invalid_properties.push('invalid value for "syntaxe_flux", syntaxe_flux cannot be nil.')
152
+ end
153
+
154
+ if @sha256.nil?
155
+ invalid_properties.push('invalid value for "sha256", sha256 cannot be nil.')
156
+ end
157
+
158
+ if @message.nil?
159
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
160
+ end
161
+
162
+ invalid_properties
163
+ end
164
+
165
+ # Check to see if the all the properties in the model are valid
166
+ # @return true if the model is valid
167
+ def valid?
168
+ warn '[DEPRECATED] the `valid?` method is obsolete'
169
+ return false if @flow_id.nil?
170
+ return false if @nom.nil?
171
+ return false if @syntaxe_flux.nil?
172
+ return false if @sha256.nil?
173
+ return false if @message.nil?
174
+ true
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] flow_id Value to be assigned
179
+ def flow_id=(flow_id)
180
+ if flow_id.nil?
181
+ fail ArgumentError, 'flow_id cannot be nil'
182
+ end
183
+
184
+ @flow_id = flow_id
185
+ end
186
+
187
+ # Custom attribute writer method with validation
188
+ # @param [Object] nom Value to be assigned
189
+ def nom=(nom)
190
+ if nom.nil?
191
+ fail ArgumentError, 'nom cannot be nil'
192
+ end
193
+
194
+ @nom = nom
195
+ end
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] syntaxe_flux Value to be assigned
199
+ def syntaxe_flux=(syntaxe_flux)
200
+ if syntaxe_flux.nil?
201
+ fail ArgumentError, 'syntaxe_flux cannot be nil'
202
+ end
203
+
204
+ @syntaxe_flux = syntaxe_flux
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] sha256 Value to be assigned
209
+ def sha256=(sha256)
210
+ if sha256.nil?
211
+ fail ArgumentError, 'sha256 cannot be nil'
212
+ end
213
+
214
+ @sha256 = sha256
215
+ end
216
+
217
+ # Custom attribute writer method with validation
218
+ # @param [Object] message Value to be assigned
219
+ def message=(message)
220
+ if message.nil?
221
+ fail ArgumentError, 'message cannot be nil'
222
+ end
223
+
224
+ @message = message
225
+ end
226
+
227
+ # Checks equality by comparing each attribute.
228
+ # @param [Object] Object to be compared
229
+ def ==(o)
230
+ return true if self.equal?(o)
231
+ self.class == o.class &&
232
+ flow_id == o.flow_id &&
233
+ tracking_id == o.tracking_id &&
234
+ nom == o.nom &&
235
+ syntaxe_flux == o.syntaxe_flux &&
236
+ profil_flux == o.profil_flux &&
237
+ sha256 == o.sha256 &&
238
+ message == o.message
239
+ end
240
+
241
+ # @see the `==` method
242
+ # @param [Object] Object to be compared
243
+ def eql?(o)
244
+ self == o
245
+ end
246
+
247
+ # Calculates hash code according to all attributes.
248
+ # @return [Integer] Hash code
249
+ def hash
250
+ [flow_id, tracking_id, nom, syntaxe_flux, profil_flux, sha256, message].hash
251
+ end
252
+
253
+ # Builds the object from hash
254
+ # @param [Hash] attributes Model attributes in the form of hash
255
+ # @return [Object] Returns the model itself
256
+ def self.build_from_hash(attributes)
257
+ return nil unless attributes.is_a?(Hash)
258
+ attributes = attributes.transform_keys(&:to_sym)
259
+ transformed_hash = {}
260
+ openapi_types.each_pair do |key, type|
261
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
262
+ transformed_hash["#{key}"] = nil
263
+ elsif type =~ /\AArray<(.*)>/i
264
+ # check to ensure the input is an array given that the attribute
265
+ # is documented as an array but the input is not
266
+ if attributes[attribute_map[key]].is_a?(Array)
267
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
268
+ end
269
+ elsif !attributes[attribute_map[key]].nil?
270
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
271
+ end
272
+ end
273
+ new(transformed_hash)
274
+ end
275
+
276
+ # Returns the object in the form of hash
277
+ # @return [Hash] Returns the object in the form of hash
278
+ def to_hash
279
+ hash = {}
280
+ self.class.attribute_map.each_pair do |attr, param|
281
+ value = self.send(attr)
282
+ if value.nil?
283
+ is_nullable = self.class.openapi_nullable.include?(attr)
284
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
285
+ end
286
+
287
+ hash[param] = _to_hash(value)
288
+ end
289
+ hash
290
+ end
291
+
292
+ end
293
+
294
+ end
@@ -0,0 +1,343 @@
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\" }' ``` **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/
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éponse de vérification réussie avec données unifiées.
18
+ class ReponseVerificationSucces < ApiModelBase
19
+ # True si aucun écart critique
20
+ attr_accessor :est_conforme
21
+
22
+ # Score de conformité (0-100%)
23
+ attr_accessor :score_conformite
24
+
25
+ # Nombre de champs vérifiés
26
+ attr_accessor :champs_verifies
27
+
28
+ # Nombre de champs conformes
29
+ attr_accessor :champs_conformes
30
+
31
+ # True si le PDF contient du XML Factur-X
32
+ attr_accessor :est_facturx
33
+
34
+ attr_accessor :profil_facturx
35
+
36
+ # Liste des champs vérifiés avec valeurs, statuts et coordonnées PDF
37
+ attr_accessor :champs
38
+
39
+ # Notes obligatoires (PMT, PMD, AAB) avec localisation PDF
40
+ attr_accessor :notes_obligatoires
41
+
42
+ # Dimensions de chaque page du PDF (largeur, hauteur)
43
+ attr_accessor :dimensions_pages
44
+
45
+ # Avertissements non bloquants
46
+ attr_accessor :avertissements
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'est_conforme' => :'est_conforme',
52
+ :'score_conformite' => :'score_conformite',
53
+ :'champs_verifies' => :'champs_verifies',
54
+ :'champs_conformes' => :'champs_conformes',
55
+ :'est_facturx' => :'est_facturx',
56
+ :'profil_facturx' => :'profil_facturx',
57
+ :'champs' => :'champs',
58
+ :'notes_obligatoires' => :'notes_obligatoires',
59
+ :'dimensions_pages' => :'dimensions_pages',
60
+ :'avertissements' => :'avertissements'
61
+ }
62
+ end
63
+
64
+ # Returns attribute mapping this model knows about
65
+ def self.acceptable_attribute_map
66
+ attribute_map
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ acceptable_attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'est_conforme' => :'Boolean',
78
+ :'score_conformite' => :'Float',
79
+ :'champs_verifies' => :'Integer',
80
+ :'champs_conformes' => :'Integer',
81
+ :'est_facturx' => :'Boolean',
82
+ :'profil_facturx' => :'String',
83
+ :'champs' => :'Array<ChampVerifieSchema>',
84
+ :'notes_obligatoires' => :'Array<NoteObligatoireSchema>',
85
+ :'dimensions_pages' => :'Array<DimensionPageSchema>',
86
+ :'avertissements' => :'Array<String>'
87
+ }
88
+ end
89
+
90
+ # List of attributes with nullable: true
91
+ def self.openapi_nullable
92
+ Set.new([
93
+ :'profil_facturx',
94
+ ])
95
+ end
96
+
97
+ # Initializes the object
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ def initialize(attributes = {})
100
+ if (!attributes.is_a?(Hash))
101
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::ReponseVerificationSucces` initialize method"
102
+ end
103
+
104
+ # check to see if the attribute exists and convert string to symbol for hash key
105
+ acceptable_attribute_map = self.class.acceptable_attribute_map
106
+ attributes = attributes.each_with_object({}) { |(k, v), h|
107
+ if (!acceptable_attribute_map.key?(k.to_sym))
108
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::ReponseVerificationSucces`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
109
+ end
110
+ h[k.to_sym] = v
111
+ }
112
+
113
+ if attributes.key?(:'est_conforme')
114
+ self.est_conforme = attributes[:'est_conforme']
115
+ else
116
+ self.est_conforme = nil
117
+ end
118
+
119
+ if attributes.key?(:'score_conformite')
120
+ self.score_conformite = attributes[:'score_conformite']
121
+ else
122
+ self.score_conformite = nil
123
+ end
124
+
125
+ if attributes.key?(:'champs_verifies')
126
+ self.champs_verifies = attributes[:'champs_verifies']
127
+ else
128
+ self.champs_verifies = 0
129
+ end
130
+
131
+ if attributes.key?(:'champs_conformes')
132
+ self.champs_conformes = attributes[:'champs_conformes']
133
+ else
134
+ self.champs_conformes = 0
135
+ end
136
+
137
+ if attributes.key?(:'est_facturx')
138
+ self.est_facturx = attributes[:'est_facturx']
139
+ else
140
+ self.est_facturx = false
141
+ end
142
+
143
+ if attributes.key?(:'profil_facturx')
144
+ self.profil_facturx = attributes[:'profil_facturx']
145
+ end
146
+
147
+ if attributes.key?(:'champs')
148
+ if (value = attributes[:'champs']).is_a?(Array)
149
+ self.champs = value
150
+ end
151
+ end
152
+
153
+ if attributes.key?(:'notes_obligatoires')
154
+ if (value = attributes[:'notes_obligatoires']).is_a?(Array)
155
+ self.notes_obligatoires = value
156
+ end
157
+ end
158
+
159
+ if attributes.key?(:'dimensions_pages')
160
+ if (value = attributes[:'dimensions_pages']).is_a?(Array)
161
+ self.dimensions_pages = value
162
+ end
163
+ end
164
+
165
+ if attributes.key?(:'avertissements')
166
+ if (value = attributes[:'avertissements']).is_a?(Array)
167
+ self.avertissements = value
168
+ end
169
+ end
170
+ end
171
+
172
+ # Show invalid properties with the reasons. Usually used together with valid?
173
+ # @return Array for valid properties with the reasons
174
+ def list_invalid_properties
175
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
176
+ invalid_properties = Array.new
177
+ if @est_conforme.nil?
178
+ invalid_properties.push('invalid value for "est_conforme", est_conforme cannot be nil.')
179
+ end
180
+
181
+ if @score_conformite.nil?
182
+ invalid_properties.push('invalid value for "score_conformite", score_conformite cannot be nil.')
183
+ end
184
+
185
+ if @score_conformite > 100.0
186
+ invalid_properties.push('invalid value for "score_conformite", must be smaller than or equal to 100.0.')
187
+ end
188
+
189
+ if @score_conformite < 0.0
190
+ invalid_properties.push('invalid value for "score_conformite", must be greater than or equal to 0.0.')
191
+ end
192
+
193
+ if !@champs_verifies.nil? && @champs_verifies < 0
194
+ invalid_properties.push('invalid value for "champs_verifies", must be greater than or equal to 0.')
195
+ end
196
+
197
+ if !@champs_conformes.nil? && @champs_conformes < 0
198
+ invalid_properties.push('invalid value for "champs_conformes", must be greater than or equal to 0.')
199
+ end
200
+
201
+ invalid_properties
202
+ end
203
+
204
+ # Check to see if the all the properties in the model are valid
205
+ # @return true if the model is valid
206
+ def valid?
207
+ warn '[DEPRECATED] the `valid?` method is obsolete'
208
+ return false if @est_conforme.nil?
209
+ return false if @score_conformite.nil?
210
+ return false if @score_conformite > 100.0
211
+ return false if @score_conformite < 0.0
212
+ return false if !@champs_verifies.nil? && @champs_verifies < 0
213
+ return false if !@champs_conformes.nil? && @champs_conformes < 0
214
+ true
215
+ end
216
+
217
+ # Custom attribute writer method with validation
218
+ # @param [Object] est_conforme Value to be assigned
219
+ def est_conforme=(est_conforme)
220
+ if est_conforme.nil?
221
+ fail ArgumentError, 'est_conforme cannot be nil'
222
+ end
223
+
224
+ @est_conforme = est_conforme
225
+ end
226
+
227
+ # Custom attribute writer method with validation
228
+ # @param [Object] score_conformite Value to be assigned
229
+ def score_conformite=(score_conformite)
230
+ if score_conformite.nil?
231
+ fail ArgumentError, 'score_conformite cannot be nil'
232
+ end
233
+
234
+ if score_conformite > 100.0
235
+ fail ArgumentError, 'invalid value for "score_conformite", must be smaller than or equal to 100.0.'
236
+ end
237
+
238
+ if score_conformite < 0.0
239
+ fail ArgumentError, 'invalid value for "score_conformite", must be greater than or equal to 0.0.'
240
+ end
241
+
242
+ @score_conformite = score_conformite
243
+ end
244
+
245
+ # Custom attribute writer method with validation
246
+ # @param [Object] champs_verifies Value to be assigned
247
+ def champs_verifies=(champs_verifies)
248
+ if champs_verifies.nil?
249
+ fail ArgumentError, 'champs_verifies cannot be nil'
250
+ end
251
+
252
+ if champs_verifies < 0
253
+ fail ArgumentError, 'invalid value for "champs_verifies", must be greater than or equal to 0.'
254
+ end
255
+
256
+ @champs_verifies = champs_verifies
257
+ end
258
+
259
+ # Custom attribute writer method with validation
260
+ # @param [Object] champs_conformes Value to be assigned
261
+ def champs_conformes=(champs_conformes)
262
+ if champs_conformes.nil?
263
+ fail ArgumentError, 'champs_conformes cannot be nil'
264
+ end
265
+
266
+ if champs_conformes < 0
267
+ fail ArgumentError, 'invalid value for "champs_conformes", must be greater than or equal to 0.'
268
+ end
269
+
270
+ @champs_conformes = champs_conformes
271
+ end
272
+
273
+ # Checks equality by comparing each attribute.
274
+ # @param [Object] Object to be compared
275
+ def ==(o)
276
+ return true if self.equal?(o)
277
+ self.class == o.class &&
278
+ est_conforme == o.est_conforme &&
279
+ score_conformite == o.score_conformite &&
280
+ champs_verifies == o.champs_verifies &&
281
+ champs_conformes == o.champs_conformes &&
282
+ est_facturx == o.est_facturx &&
283
+ profil_facturx == o.profil_facturx &&
284
+ champs == o.champs &&
285
+ notes_obligatoires == o.notes_obligatoires &&
286
+ dimensions_pages == o.dimensions_pages &&
287
+ avertissements == o.avertissements
288
+ end
289
+
290
+ # @see the `==` method
291
+ # @param [Object] Object to be compared
292
+ def eql?(o)
293
+ self == o
294
+ end
295
+
296
+ # Calculates hash code according to all attributes.
297
+ # @return [Integer] Hash code
298
+ def hash
299
+ [est_conforme, score_conformite, champs_verifies, champs_conformes, est_facturx, profil_facturx, champs, notes_obligatoires, dimensions_pages, avertissements].hash
300
+ end
301
+
302
+ # Builds the object from hash
303
+ # @param [Hash] attributes Model attributes in the form of hash
304
+ # @return [Object] Returns the model itself
305
+ def self.build_from_hash(attributes)
306
+ return nil unless attributes.is_a?(Hash)
307
+ attributes = attributes.transform_keys(&:to_sym)
308
+ transformed_hash = {}
309
+ openapi_types.each_pair do |key, type|
310
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
311
+ transformed_hash["#{key}"] = nil
312
+ elsif type =~ /\AArray<(.*)>/i
313
+ # check to ensure the input is an array given that the attribute
314
+ # is documented as an array but the input is not
315
+ if attributes[attribute_map[key]].is_a?(Array)
316
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
317
+ end
318
+ elsif !attributes[attribute_map[key]].nil?
319
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
320
+ end
321
+ end
322
+ new(transformed_hash)
323
+ end
324
+
325
+ # Returns the object in the form of hash
326
+ # @return [Hash] Returns the object in the form of hash
327
+ def to_hash
328
+ hash = {}
329
+ self.class.attribute_map.each_pair do |attr, param|
330
+ value = self.send(attr)
331
+ if value.nil?
332
+ is_nullable = self.class.openapi_nullable.include?(attr)
333
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
334
+ end
335
+
336
+ hash[param] = _to_hash(value)
337
+ end
338
+ hash
339
+ end
340
+
341
+ end
342
+
343
+ end