factpulse 3.0.32 → 3.0.33

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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -17
  3. data/Gemfile.lock +1 -1
  4. data/docs/ActionCodeInfo.md +22 -0
  5. data/docs/ActionCodesResponse.md +22 -0
  6. data/docs/BodySubmitCdarApiV1CdarSubmitPost.md +20 -0
  7. data/docs/BodySubmitCdarXmlApiV1CdarSubmitXmlPost.md +20 -0
  8. data/docs/CDARCycleDeVieApi.md +489 -0
  9. data/docs/ChorusProCredentials.md +8 -8
  10. data/docs/ChorusProDestination.md +1 -1
  11. data/docs/CreateCDARRequest.md +52 -0
  12. data/docs/Encaisseamount.md +15 -0
  13. data/docs/Encaisseamount1.md +15 -0
  14. data/docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md +26 -0
  15. data/docs/FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md +18 -0
  16. data/docs/GenerateCDARResponse.md +26 -0
  17. data/docs/GetChorusProIdRequest.md +1 -1
  18. data/docs/GetInvoiceRequest.md +1 -1
  19. data/docs/GetStructureRequest.md +1 -1
  20. data/docs/ReasonCodeInfo.md +22 -0
  21. data/docs/ReasonCodesResponse.md +22 -0
  22. data/docs/RecipientInput.md +26 -0
  23. data/docs/SearchStructureRequest.md +1 -1
  24. data/docs/StatusCodeInfo.md +22 -0
  25. data/docs/StatusCodesResponse.md +22 -0
  26. data/docs/SubmitCDARRequest.md +54 -0
  27. data/docs/SubmitCDARResponse.md +24 -0
  28. data/docs/SubmitCDARXMLRequest.md +22 -0
  29. data/docs/SubmitInvoiceRequest.md +1 -1
  30. data/docs/ValidateCDARRequest.md +32 -0
  31. data/docs/ValidateCDARResponse.md +22 -0
  32. data/docs/ValidationErrorResponse.md +8 -2
  33. data/lib/factpulse/api/cdar_cycle_de_vie_api.rb +491 -0
  34. data/lib/factpulse/helpers/client.rb +1 -1
  35. data/lib/factpulse/models/action_code_info.rb +220 -0
  36. data/lib/factpulse/models/action_codes_response.rb +207 -0
  37. data/lib/factpulse/models/body_submit_cdar_api_v1_cdar_submit_post.rb +174 -0
  38. data/lib/factpulse/models/body_submit_cdar_xml_api_v1_cdar_submit_xml_post.rb +174 -0
  39. data/lib/factpulse/models/chorus_pro_credentials.rb +26 -94
  40. data/lib/factpulse/models/chorus_pro_destination.rb +1 -1
  41. data/lib/factpulse/models/create_cdar_request.rb +414 -0
  42. data/lib/factpulse/models/encaisseamount.rb +104 -0
  43. data/lib/factpulse/models/encaisseamount1.rb +103 -0
  44. data/lib/factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.rb +259 -0
  45. data/lib/factpulse/models/facture_electronique_rest_api_schemas_validation_validation_error_response.rb +168 -0
  46. data/lib/factpulse/models/generate_cdar_response.rb +273 -0
  47. data/lib/factpulse/models/get_chorus_pro_id_request.rb +1 -1
  48. data/lib/factpulse/models/get_invoice_request.rb +1 -1
  49. data/lib/factpulse/models/get_structure_request.rb +1 -1
  50. data/lib/factpulse/models/reason_code_info.rb +220 -0
  51. data/lib/factpulse/models/reason_codes_response.rb +207 -0
  52. data/lib/factpulse/models/recipient_input.rb +191 -0
  53. data/lib/factpulse/models/search_structure_request.rb +1 -1
  54. data/lib/factpulse/models/status_code_info.rb +220 -0
  55. data/lib/factpulse/models/status_codes_response.rb +207 -0
  56. data/lib/factpulse/models/submit_cdar_request.rb +426 -0
  57. data/lib/factpulse/models/submit_cdar_response.rb +213 -0
  58. data/lib/factpulse/models/submit_cdarxml_request.rb +188 -0
  59. data/lib/factpulse/models/submit_invoice_request.rb +1 -1
  60. data/lib/factpulse/models/validate_cdar_request.rb +219 -0
  61. data/lib/factpulse/models/{facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb → validate_cdar_response.rb} +47 -48
  62. data/lib/factpulse/models/validation_error_response.rb +67 -20
  63. data/lib/factpulse/version.rb +1 -1
  64. data/lib/factpulse.rb +21 -1
  65. metadata +44 -4
  66. data/docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md +0 -26
@@ -0,0 +1,259 @@
1
+ =begin
2
+ #FactPulse REST API
3
+
4
+ # REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: contact@factpulse.fr
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Chorus Pro credentials for Zero-Trust mode. **Zero-Trust Mode**: Credentials are passed in each request and are NEVER stored. **Security**: - Credentials are never persisted in the database - They are used only for the duration of the request - Secure transmission via HTTPS **Use cases**: - High-security environments (banks, administrations) - Strict GDPR compliance - Tests with temporary credentials - Users who don't want to store their credentials
18
+ class FactureElectroniqueRestApiSchemasChorusProChorusProCredentials < ApiModelBase
19
+ # PISTE Client ID (government API portal)
20
+ attr_accessor :piste_client_id
21
+
22
+ # PISTE Client Secret
23
+ attr_accessor :piste_client_secret
24
+
25
+ # Chorus Pro login
26
+ attr_accessor :chorus_pro_login
27
+
28
+ # Chorus Pro password
29
+ attr_accessor :chorus_pro_password
30
+
31
+ # Use sandbox environment (true) or production (false)
32
+ attr_accessor :sandbox
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'piste_client_id' => :'pisteClientId',
38
+ :'piste_client_secret' => :'pisteClientSecret',
39
+ :'chorus_pro_login' => :'chorusProLogin',
40
+ :'chorus_pro_password' => :'chorusProPassword',
41
+ :'sandbox' => :'sandbox'
42
+ }
43
+ end
44
+
45
+ # Returns attribute mapping this model knows about
46
+ def self.acceptable_attribute_map
47
+ attribute_map
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ acceptable_attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'piste_client_id' => :'String',
59
+ :'piste_client_secret' => :'String',
60
+ :'chorus_pro_login' => :'String',
61
+ :'chorus_pro_password' => :'String',
62
+ :'sandbox' => :'Boolean'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::FactureElectroniqueRestApiSchemasChorusProChorusProCredentials` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ acceptable_attribute_map = self.class.acceptable_attribute_map
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!acceptable_attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::FactureElectroniqueRestApiSchemasChorusProChorusProCredentials`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'piste_client_id')
89
+ self.piste_client_id = attributes[:'piste_client_id']
90
+ else
91
+ self.piste_client_id = nil
92
+ end
93
+
94
+ if attributes.key?(:'piste_client_secret')
95
+ self.piste_client_secret = attributes[:'piste_client_secret']
96
+ else
97
+ self.piste_client_secret = nil
98
+ end
99
+
100
+ if attributes.key?(:'chorus_pro_login')
101
+ self.chorus_pro_login = attributes[:'chorus_pro_login']
102
+ else
103
+ self.chorus_pro_login = nil
104
+ end
105
+
106
+ if attributes.key?(:'chorus_pro_password')
107
+ self.chorus_pro_password = attributes[:'chorus_pro_password']
108
+ else
109
+ self.chorus_pro_password = nil
110
+ end
111
+
112
+ if attributes.key?(:'sandbox')
113
+ self.sandbox = attributes[:'sandbox']
114
+ else
115
+ self.sandbox = true
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
123
+ invalid_properties = Array.new
124
+ if @piste_client_id.nil?
125
+ invalid_properties.push('invalid value for "piste_client_id", piste_client_id cannot be nil.')
126
+ end
127
+
128
+ if @piste_client_secret.nil?
129
+ invalid_properties.push('invalid value for "piste_client_secret", piste_client_secret cannot be nil.')
130
+ end
131
+
132
+ if @chorus_pro_login.nil?
133
+ invalid_properties.push('invalid value for "chorus_pro_login", chorus_pro_login cannot be nil.')
134
+ end
135
+
136
+ if @chorus_pro_password.nil?
137
+ invalid_properties.push('invalid value for "chorus_pro_password", chorus_pro_password cannot be nil.')
138
+ end
139
+
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
+ return false if @piste_client_id.nil?
148
+ return false if @piste_client_secret.nil?
149
+ return false if @chorus_pro_login.nil?
150
+ return false if @chorus_pro_password.nil?
151
+ true
152
+ end
153
+
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] piste_client_id Value to be assigned
156
+ def piste_client_id=(piste_client_id)
157
+ if piste_client_id.nil?
158
+ fail ArgumentError, 'piste_client_id cannot be nil'
159
+ end
160
+
161
+ @piste_client_id = piste_client_id
162
+ end
163
+
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] piste_client_secret Value to be assigned
166
+ def piste_client_secret=(piste_client_secret)
167
+ if piste_client_secret.nil?
168
+ fail ArgumentError, 'piste_client_secret cannot be nil'
169
+ end
170
+
171
+ @piste_client_secret = piste_client_secret
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] chorus_pro_login Value to be assigned
176
+ def chorus_pro_login=(chorus_pro_login)
177
+ if chorus_pro_login.nil?
178
+ fail ArgumentError, 'chorus_pro_login cannot be nil'
179
+ end
180
+
181
+ @chorus_pro_login = chorus_pro_login
182
+ end
183
+
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] chorus_pro_password Value to be assigned
186
+ def chorus_pro_password=(chorus_pro_password)
187
+ if chorus_pro_password.nil?
188
+ fail ArgumentError, 'chorus_pro_password cannot be nil'
189
+ end
190
+
191
+ @chorus_pro_password = chorus_pro_password
192
+ end
193
+
194
+ # Checks equality by comparing each attribute.
195
+ # @param [Object] Object to be compared
196
+ def ==(o)
197
+ return true if self.equal?(o)
198
+ self.class == o.class &&
199
+ piste_client_id == o.piste_client_id &&
200
+ piste_client_secret == o.piste_client_secret &&
201
+ chorus_pro_login == o.chorus_pro_login &&
202
+ chorus_pro_password == o.chorus_pro_password &&
203
+ sandbox == o.sandbox
204
+ end
205
+
206
+ # @see the `==` method
207
+ # @param [Object] Object to be compared
208
+ def eql?(o)
209
+ self == o
210
+ end
211
+
212
+ # Calculates hash code according to all attributes.
213
+ # @return [Integer] Hash code
214
+ def hash
215
+ [piste_client_id, piste_client_secret, chorus_pro_login, chorus_pro_password, sandbox].hash
216
+ end
217
+
218
+ # Builds the object from hash
219
+ # @param [Hash] attributes Model attributes in the form of hash
220
+ # @return [Object] Returns the model itself
221
+ def self.build_from_hash(attributes)
222
+ return nil unless attributes.is_a?(Hash)
223
+ attributes = attributes.transform_keys(&:to_sym)
224
+ transformed_hash = {}
225
+ openapi_types.each_pair do |key, type|
226
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
227
+ transformed_hash["#{key}"] = nil
228
+ elsif type =~ /\AArray<(.*)>/i
229
+ # check to ensure the input is an array given that the attribute
230
+ # is documented as an array but the input is not
231
+ if attributes[attribute_map[key]].is_a?(Array)
232
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
233
+ end
234
+ elsif !attributes[attribute_map[key]].nil?
235
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
236
+ end
237
+ end
238
+ new(transformed_hash)
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ if value.nil?
248
+ is_nullable = self.class.openapi_nullable.include?(attr)
249
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
+ end
251
+
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+
257
+ end
258
+
259
+ end
@@ -0,0 +1,168 @@
1
+ =begin
2
+ #FactPulse REST API
3
+
4
+ # REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: contact@factpulse.fr
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Response for validation errors.
18
+ class FactureElectroniqueRestApiSchemasValidationValidationErrorResponse < ApiModelBase
19
+ # List of detected validation errors.
20
+ attr_accessor :detail
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'detail' => :'detail'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'detail' => :'Array<String>'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::FactureElectroniqueRestApiSchemasValidationValidationErrorResponse` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::FactureElectroniqueRestApiSchemasValidationValidationErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'detail')
69
+ if (value = attributes[:'detail']).is_a?(Array)
70
+ self.detail = value
71
+ end
72
+ else
73
+ self.detail = nil
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ invalid_properties = Array.new
82
+ if @detail.nil?
83
+ invalid_properties.push('invalid value for "detail", detail cannot be nil.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ return false if @detail.nil?
94
+ true
95
+ end
96
+
97
+ # Custom attribute writer method with validation
98
+ # @param [Object] detail Value to be assigned
99
+ def detail=(detail)
100
+ if detail.nil?
101
+ fail ArgumentError, 'detail cannot be nil'
102
+ end
103
+
104
+ @detail = detail
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ detail == o.detail
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [detail].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ transformed_hash = {}
134
+ openapi_types.each_pair do |key, type|
135
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = nil
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[attribute_map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
142
+ end
143
+ elsif !attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
145
+ end
146
+ end
147
+ new(transformed_hash)
148
+ end
149
+
150
+ # Returns the object in the form of hash
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_hash
153
+ hash = {}
154
+ self.class.attribute_map.each_pair do |attr, param|
155
+ value = self.send(attr)
156
+ if value.nil?
157
+ is_nullable = self.class.openapi_nullable.include?(attr)
158
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
159
+ end
160
+
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ end
167
+
168
+ end