factpulse 2.0.20 → 2.0.21

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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -3
  3. data/Gemfile.lock +1 -1
  4. data/docs/ChorusProApi.md +65 -69
  5. data/docs/TraitementFactureApi.md +1 -1
  6. data/lib/factpulse/api/chorus_pro_api.rb +94 -107
  7. data/lib/factpulse/api/traitement_facture_api.rb +2 -2
  8. data/lib/factpulse/helpers/client.rb +66 -15
  9. data/lib/factpulse/version.rb +1 -1
  10. data/lib/factpulse.rb +0 -13
  11. metadata +2 -28
  12. data/docs/BodyAjouterFichierApiV1ChorusProTransversesAjouterFichierPost.md +0 -22
  13. data/docs/BodyCompleterFactureApiV1ChorusProFacturesCompleterPost.md +0 -22
  14. data/docs/BodyListerServicesStructureApiV1ChorusProStructuresIdStructureCppServicesGet.md +0 -20
  15. data/docs/BodyRechercherFacturesDestinataireApiV1ChorusProFacturesRechercherDestinatairePost.md +0 -22
  16. data/docs/BodyRechercherFacturesFournisseurApiV1ChorusProFacturesRechercherFournisseurPost.md +0 -22
  17. data/docs/BodyRecyclerFactureApiV1ChorusProFacturesRecyclerPost.md +0 -22
  18. data/docs/BodyTelechargerGroupeFacturesApiV1ChorusProFacturesTelechargerGroupePost.md +0 -22
  19. data/docs/BodyTraiterFactureRecueApiV1ChorusProFacturesTraiterFactureRecuePost.md +0 -22
  20. data/docs/BodyValideurConsulterFactureApiV1ChorusProFacturesValideurConsulterPost.md +0 -22
  21. data/docs/BodyValideurRechercherFacturesApiV1ChorusProFacturesValideurRechercherPost.md +0 -22
  22. data/docs/BodyValideurTraiterFactureApiV1ChorusProFacturesValideurTraiterPost.md +0 -22
  23. data/docs/QuotaInfo.md +0 -26
  24. data/docs/Utilisateur.md +0 -40
  25. data/lib/factpulse/models/body_ajouter_fichier_api_v1_chorus_pro_transverses_ajouter_fichier_post.rb +0 -202
  26. data/lib/factpulse/models/body_completer_facture_api_v1_chorus_pro_factures_completer_post.rb +0 -202
  27. data/lib/factpulse/models/body_lister_services_structure_api_v1_chorus_pro_structures_id_structure_cpp_services_get.rb +0 -174
  28. data/lib/factpulse/models/body_rechercher_factures_destinataire_api_v1_chorus_pro_factures_rechercher_destinataire_post.rb +0 -202
  29. data/lib/factpulse/models/body_rechercher_factures_fournisseur_api_v1_chorus_pro_factures_rechercher_fournisseur_post.rb +0 -202
  30. data/lib/factpulse/models/body_recycler_facture_api_v1_chorus_pro_factures_recycler_post.rb +0 -202
  31. data/lib/factpulse/models/body_telecharger_groupe_factures_api_v1_chorus_pro_factures_telecharger_groupe_post.rb +0 -202
  32. data/lib/factpulse/models/body_traiter_facture_recue_api_v1_chorus_pro_factures_traiter_facture_recue_post.rb +0 -202
  33. data/lib/factpulse/models/body_valideur_consulter_facture_api_v1_chorus_pro_factures_valideur_consulter_post.rb +0 -202
  34. data/lib/factpulse/models/body_valideur_rechercher_factures_api_v1_chorus_pro_factures_valideur_rechercher_post.rb +0 -202
  35. data/lib/factpulse/models/body_valideur_traiter_facture_api_v1_chorus_pro_factures_valideur_traiter_post.rb +0 -202
  36. data/lib/factpulse/models/quota_info.rb +0 -269
  37. data/lib/factpulse/models/utilisateur.rb +0 -328
@@ -1,269 +0,0 @@
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
- # Informations détaillées sur le quota.
18
- class QuotaInfo < ApiModelBase
19
- attr_accessor :limit
20
-
21
- attr_accessor :usage
22
-
23
- attr_accessor :remaining
24
-
25
- attr_accessor :reset_date
26
-
27
- attr_accessor :plan
28
-
29
- # Attribute mapping from ruby-style variable name to JSON key.
30
- def self.attribute_map
31
- {
32
- :'limit' => :'limit',
33
- :'usage' => :'usage',
34
- :'remaining' => :'remaining',
35
- :'reset_date' => :'reset_date',
36
- :'plan' => :'plan'
37
- }
38
- end
39
-
40
- # Returns attribute mapping this model knows about
41
- def self.acceptable_attribute_map
42
- attribute_map
43
- end
44
-
45
- # Returns all the JSON keys this model knows about
46
- def self.acceptable_attributes
47
- acceptable_attribute_map.values
48
- end
49
-
50
- # Attribute type mapping.
51
- def self.openapi_types
52
- {
53
- :'limit' => :'Integer',
54
- :'usage' => :'Integer',
55
- :'remaining' => :'Integer',
56
- :'reset_date' => :'String',
57
- :'plan' => :'String'
58
- }
59
- end
60
-
61
- # List of attributes with nullable: true
62
- def self.openapi_nullable
63
- Set.new([
64
- ])
65
- end
66
-
67
- # Initializes the object
68
- # @param [Hash] attributes Model attributes in the form of hash
69
- def initialize(attributes = {})
70
- if (!attributes.is_a?(Hash))
71
- fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::QuotaInfo` initialize method"
72
- end
73
-
74
- # check to see if the attribute exists and convert string to symbol for hash key
75
- acceptable_attribute_map = self.class.acceptable_attribute_map
76
- attributes = attributes.each_with_object({}) { |(k, v), h|
77
- if (!acceptable_attribute_map.key?(k.to_sym))
78
- fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::QuotaInfo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
- end
80
- h[k.to_sym] = v
81
- }
82
-
83
- if attributes.key?(:'limit')
84
- self.limit = attributes[:'limit']
85
- else
86
- self.limit = nil
87
- end
88
-
89
- if attributes.key?(:'usage')
90
- self.usage = attributes[:'usage']
91
- else
92
- self.usage = nil
93
- end
94
-
95
- if attributes.key?(:'remaining')
96
- self.remaining = attributes[:'remaining']
97
- else
98
- self.remaining = nil
99
- end
100
-
101
- if attributes.key?(:'reset_date')
102
- self.reset_date = attributes[:'reset_date']
103
- else
104
- self.reset_date = nil
105
- end
106
-
107
- if attributes.key?(:'plan')
108
- self.plan = attributes[:'plan']
109
- else
110
- self.plan = nil
111
- end
112
- end
113
-
114
- # Show invalid properties with the reasons. Usually used together with valid?
115
- # @return Array for valid properties with the reasons
116
- def list_invalid_properties
117
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
118
- invalid_properties = Array.new
119
- if @limit.nil?
120
- invalid_properties.push('invalid value for "limit", limit cannot be nil.')
121
- end
122
-
123
- if @usage.nil?
124
- invalid_properties.push('invalid value for "usage", usage cannot be nil.')
125
- end
126
-
127
- if @remaining.nil?
128
- invalid_properties.push('invalid value for "remaining", remaining cannot be nil.')
129
- end
130
-
131
- if @reset_date.nil?
132
- invalid_properties.push('invalid value for "reset_date", reset_date cannot be nil.')
133
- end
134
-
135
- if @plan.nil?
136
- invalid_properties.push('invalid value for "plan", plan cannot be nil.')
137
- end
138
-
139
- invalid_properties
140
- end
141
-
142
- # Check to see if the all the properties in the model are valid
143
- # @return true if the model is valid
144
- def valid?
145
- warn '[DEPRECATED] the `valid?` method is obsolete'
146
- return false if @limit.nil?
147
- return false if @usage.nil?
148
- return false if @remaining.nil?
149
- return false if @reset_date.nil?
150
- return false if @plan.nil?
151
- true
152
- end
153
-
154
- # Custom attribute writer method with validation
155
- # @param [Object] limit Value to be assigned
156
- def limit=(limit)
157
- if limit.nil?
158
- fail ArgumentError, 'limit cannot be nil'
159
- end
160
-
161
- @limit = limit
162
- end
163
-
164
- # Custom attribute writer method with validation
165
- # @param [Object] usage Value to be assigned
166
- def usage=(usage)
167
- if usage.nil?
168
- fail ArgumentError, 'usage cannot be nil'
169
- end
170
-
171
- @usage = usage
172
- end
173
-
174
- # Custom attribute writer method with validation
175
- # @param [Object] remaining Value to be assigned
176
- def remaining=(remaining)
177
- if remaining.nil?
178
- fail ArgumentError, 'remaining cannot be nil'
179
- end
180
-
181
- @remaining = remaining
182
- end
183
-
184
- # Custom attribute writer method with validation
185
- # @param [Object] reset_date Value to be assigned
186
- def reset_date=(reset_date)
187
- if reset_date.nil?
188
- fail ArgumentError, 'reset_date cannot be nil'
189
- end
190
-
191
- @reset_date = reset_date
192
- end
193
-
194
- # Custom attribute writer method with validation
195
- # @param [Object] plan Value to be assigned
196
- def plan=(plan)
197
- if plan.nil?
198
- fail ArgumentError, 'plan cannot be nil'
199
- end
200
-
201
- @plan = plan
202
- end
203
-
204
- # Checks equality by comparing each attribute.
205
- # @param [Object] Object to be compared
206
- def ==(o)
207
- return true if self.equal?(o)
208
- self.class == o.class &&
209
- limit == o.limit &&
210
- usage == o.usage &&
211
- remaining == o.remaining &&
212
- reset_date == o.reset_date &&
213
- plan == o.plan
214
- end
215
-
216
- # @see the `==` method
217
- # @param [Object] Object to be compared
218
- def eql?(o)
219
- self == o
220
- end
221
-
222
- # Calculates hash code according to all attributes.
223
- # @return [Integer] Hash code
224
- def hash
225
- [limit, usage, remaining, reset_date, plan].hash
226
- end
227
-
228
- # Builds the object from hash
229
- # @param [Hash] attributes Model attributes in the form of hash
230
- # @return [Object] Returns the model itself
231
- def self.build_from_hash(attributes)
232
- return nil unless attributes.is_a?(Hash)
233
- attributes = attributes.transform_keys(&:to_sym)
234
- transformed_hash = {}
235
- openapi_types.each_pair do |key, type|
236
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
237
- transformed_hash["#{key}"] = nil
238
- elsif type =~ /\AArray<(.*)>/i
239
- # check to ensure the input is an array given that the attribute
240
- # is documented as an array but the input is not
241
- if attributes[attribute_map[key]].is_a?(Array)
242
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
243
- end
244
- elsif !attributes[attribute_map[key]].nil?
245
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
246
- end
247
- end
248
- new(transformed_hash)
249
- end
250
-
251
- # Returns the object in the form of hash
252
- # @return [Hash] Returns the object in the form of hash
253
- def to_hash
254
- hash = {}
255
- self.class.attribute_map.each_pair do |attr, param|
256
- value = self.send(attr)
257
- if value.nil?
258
- is_nullable = self.class.openapi_nullable.include?(attr)
259
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
260
- end
261
-
262
- hash[param] = _to_hash(value)
263
- end
264
- hash
265
- end
266
-
267
- end
268
-
269
- end
@@ -1,328 +0,0 @@
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
- # Modèle Pydantic représentant les données de l'utilisateur authentifié.
18
- class Utilisateur < ApiModelBase
19
- attr_accessor :id
20
-
21
- attr_accessor :username
22
-
23
- attr_accessor :email
24
-
25
- attr_accessor :is_active
26
-
27
- attr_accessor :is_superuser
28
-
29
- attr_accessor :is_staff
30
-
31
- attr_accessor :bypass_quota
32
-
33
- attr_accessor :team_id
34
-
35
- attr_accessor :has_quota
36
-
37
- attr_accessor :quota_info
38
-
39
- attr_accessor :is_trial
40
-
41
- attr_accessor :client_uid
42
-
43
- # Attribute mapping from ruby-style variable name to JSON key.
44
- def self.attribute_map
45
- {
46
- :'id' => :'id',
47
- :'username' => :'username',
48
- :'email' => :'email',
49
- :'is_active' => :'is_active',
50
- :'is_superuser' => :'is_superuser',
51
- :'is_staff' => :'is_staff',
52
- :'bypass_quota' => :'bypass_quota',
53
- :'team_id' => :'team_id',
54
- :'has_quota' => :'has_quota',
55
- :'quota_info' => :'quota_info',
56
- :'is_trial' => :'is_trial',
57
- :'client_uid' => :'client_uid'
58
- }
59
- end
60
-
61
- # Returns attribute mapping this model knows about
62
- def self.acceptable_attribute_map
63
- attribute_map
64
- end
65
-
66
- # Returns all the JSON keys this model knows about
67
- def self.acceptable_attributes
68
- acceptable_attribute_map.values
69
- end
70
-
71
- # Attribute type mapping.
72
- def self.openapi_types
73
- {
74
- :'id' => :'Integer',
75
- :'username' => :'String',
76
- :'email' => :'String',
77
- :'is_active' => :'Boolean',
78
- :'is_superuser' => :'Boolean',
79
- :'is_staff' => :'Boolean',
80
- :'bypass_quota' => :'Boolean',
81
- :'team_id' => :'Integer',
82
- :'has_quota' => :'Boolean',
83
- :'quota_info' => :'QuotaInfo',
84
- :'is_trial' => :'Boolean',
85
- :'client_uid' => :'String'
86
- }
87
- end
88
-
89
- # List of attributes with nullable: true
90
- def self.openapi_nullable
91
- Set.new([
92
- :'team_id',
93
- :'quota_info',
94
- :'client_uid'
95
- ])
96
- end
97
-
98
- # Initializes the object
99
- # @param [Hash] attributes Model attributes in the form of hash
100
- def initialize(attributes = {})
101
- if (!attributes.is_a?(Hash))
102
- fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::Utilisateur` initialize method"
103
- end
104
-
105
- # check to see if the attribute exists and convert string to symbol for hash key
106
- acceptable_attribute_map = self.class.acceptable_attribute_map
107
- attributes = attributes.each_with_object({}) { |(k, v), h|
108
- if (!acceptable_attribute_map.key?(k.to_sym))
109
- fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::Utilisateur`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
110
- end
111
- h[k.to_sym] = v
112
- }
113
-
114
- if attributes.key?(:'id')
115
- self.id = attributes[:'id']
116
- else
117
- self.id = nil
118
- end
119
-
120
- if attributes.key?(:'username')
121
- self.username = attributes[:'username']
122
- else
123
- self.username = nil
124
- end
125
-
126
- if attributes.key?(:'email')
127
- self.email = attributes[:'email']
128
- else
129
- self.email = nil
130
- end
131
-
132
- if attributes.key?(:'is_active')
133
- self.is_active = attributes[:'is_active']
134
- else
135
- self.is_active = nil
136
- end
137
-
138
- if attributes.key?(:'is_superuser')
139
- self.is_superuser = attributes[:'is_superuser']
140
- else
141
- self.is_superuser = false
142
- end
143
-
144
- if attributes.key?(:'is_staff')
145
- self.is_staff = attributes[:'is_staff']
146
- else
147
- self.is_staff = false
148
- end
149
-
150
- if attributes.key?(:'bypass_quota')
151
- self.bypass_quota = attributes[:'bypass_quota']
152
- else
153
- self.bypass_quota = false
154
- end
155
-
156
- if attributes.key?(:'team_id')
157
- self.team_id = attributes[:'team_id']
158
- end
159
-
160
- if attributes.key?(:'has_quota')
161
- self.has_quota = attributes[:'has_quota']
162
- else
163
- self.has_quota = true
164
- end
165
-
166
- if attributes.key?(:'quota_info')
167
- self.quota_info = attributes[:'quota_info']
168
- end
169
-
170
- if attributes.key?(:'is_trial')
171
- self.is_trial = attributes[:'is_trial']
172
- else
173
- self.is_trial = false
174
- end
175
-
176
- if attributes.key?(:'client_uid')
177
- self.client_uid = attributes[:'client_uid']
178
- end
179
- end
180
-
181
- # Show invalid properties with the reasons. Usually used together with valid?
182
- # @return Array for valid properties with the reasons
183
- def list_invalid_properties
184
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
185
- invalid_properties = Array.new
186
- if @id.nil?
187
- invalid_properties.push('invalid value for "id", id cannot be nil.')
188
- end
189
-
190
- if @username.nil?
191
- invalid_properties.push('invalid value for "username", username cannot be nil.')
192
- end
193
-
194
- if @email.nil?
195
- invalid_properties.push('invalid value for "email", email cannot be nil.')
196
- end
197
-
198
- if @is_active.nil?
199
- invalid_properties.push('invalid value for "is_active", is_active cannot be nil.')
200
- end
201
-
202
- invalid_properties
203
- end
204
-
205
- # Check to see if the all the properties in the model are valid
206
- # @return true if the model is valid
207
- def valid?
208
- warn '[DEPRECATED] the `valid?` method is obsolete'
209
- return false if @id.nil?
210
- return false if @username.nil?
211
- return false if @email.nil?
212
- return false if @is_active.nil?
213
- true
214
- end
215
-
216
- # Custom attribute writer method with validation
217
- # @param [Object] id Value to be assigned
218
- def id=(id)
219
- if id.nil?
220
- fail ArgumentError, 'id cannot be nil'
221
- end
222
-
223
- @id = id
224
- end
225
-
226
- # Custom attribute writer method with validation
227
- # @param [Object] username Value to be assigned
228
- def username=(username)
229
- if username.nil?
230
- fail ArgumentError, 'username cannot be nil'
231
- end
232
-
233
- @username = username
234
- end
235
-
236
- # Custom attribute writer method with validation
237
- # @param [Object] email Value to be assigned
238
- def email=(email)
239
- if email.nil?
240
- fail ArgumentError, 'email cannot be nil'
241
- end
242
-
243
- @email = email
244
- end
245
-
246
- # Custom attribute writer method with validation
247
- # @param [Object] is_active Value to be assigned
248
- def is_active=(is_active)
249
- if is_active.nil?
250
- fail ArgumentError, 'is_active cannot be nil'
251
- end
252
-
253
- @is_active = is_active
254
- end
255
-
256
- # Checks equality by comparing each attribute.
257
- # @param [Object] Object to be compared
258
- def ==(o)
259
- return true if self.equal?(o)
260
- self.class == o.class &&
261
- id == o.id &&
262
- username == o.username &&
263
- email == o.email &&
264
- is_active == o.is_active &&
265
- is_superuser == o.is_superuser &&
266
- is_staff == o.is_staff &&
267
- bypass_quota == o.bypass_quota &&
268
- team_id == o.team_id &&
269
- has_quota == o.has_quota &&
270
- quota_info == o.quota_info &&
271
- is_trial == o.is_trial &&
272
- client_uid == o.client_uid
273
- end
274
-
275
- # @see the `==` method
276
- # @param [Object] Object to be compared
277
- def eql?(o)
278
- self == o
279
- end
280
-
281
- # Calculates hash code according to all attributes.
282
- # @return [Integer] Hash code
283
- def hash
284
- [id, username, email, is_active, is_superuser, is_staff, bypass_quota, team_id, has_quota, quota_info, is_trial, client_uid].hash
285
- end
286
-
287
- # Builds the object from hash
288
- # @param [Hash] attributes Model attributes in the form of hash
289
- # @return [Object] Returns the model itself
290
- def self.build_from_hash(attributes)
291
- return nil unless attributes.is_a?(Hash)
292
- attributes = attributes.transform_keys(&:to_sym)
293
- transformed_hash = {}
294
- openapi_types.each_pair do |key, type|
295
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
296
- transformed_hash["#{key}"] = nil
297
- elsif type =~ /\AArray<(.*)>/i
298
- # check to ensure the input is an array given that the attribute
299
- # is documented as an array but the input is not
300
- if attributes[attribute_map[key]].is_a?(Array)
301
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
302
- end
303
- elsif !attributes[attribute_map[key]].nil?
304
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
305
- end
306
- end
307
- new(transformed_hash)
308
- end
309
-
310
- # Returns the object in the form of hash
311
- # @return [Hash] Returns the object in the form of hash
312
- def to_hash
313
- hash = {}
314
- self.class.attribute_map.each_pair do |attr, param|
315
- value = self.send(attr)
316
- if value.nil?
317
- is_nullable = self.class.openapi_nullable.include?(attr)
318
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
319
- end
320
-
321
- hash[param] = _to_hash(value)
322
- end
323
- hash
324
- end
325
-
326
- end
327
-
328
- end