factpulse 3.0.4 → 3.0.6

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 (207) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -3
  3. data/Gemfile.lock +1 -1
  4. data/docs/AdditionalDocument.md +26 -0
  5. data/docs/AllowanceCharge.md +32 -0
  6. data/docs/AllowanceTotalAmount.md +15 -0
  7. data/docs/{APIProfile.md → Amount.md} +2 -2
  8. data/docs/{DocumentType.md → BaseAmount.md} +2 -2
  9. data/docs/ChargeTotalAmount.md +15 -0
  10. data/docs/Contact.md +24 -0
  11. data/docs/ConvertErrorResponse.md +26 -0
  12. data/docs/ConvertPendingInputResponse.md +32 -0
  13. data/docs/ConvertResumeRequest.md +18 -0
  14. data/docs/ConvertSuccessResponse.md +36 -0
  15. data/docs/ConvertValidationFailedResponse.md +34 -0
  16. data/docs/DeliveryParty.md +24 -0
  17. data/docs/DocumentConversionApi.md +373 -0
  18. data/docs/DocumentTypeInfo.md +22 -0
  19. data/docs/ExtractionInfo.md +24 -0
  20. data/docs/FacturXInvoice.md +29 -1
  21. data/docs/FacturXProfile.md +15 -0
  22. data/docs/FileInfo.md +20 -0
  23. data/docs/FilesInfo.md +20 -0
  24. data/docs/GrossUnitPrice.md +15 -0
  25. data/docs/IncomingInvoice.md +1 -1
  26. data/docs/InvoiceLine.md +43 -9
  27. data/docs/InvoiceProcessingApi.md +8 -8
  28. data/docs/InvoiceReferences.md +26 -6
  29. data/docs/InvoiceTotals.md +10 -2
  30. data/docs/LineTotalAmount.md +15 -0
  31. data/docs/MissingField.md +28 -0
  32. data/docs/Payee.md +5 -1
  33. data/docs/PaymentCard.md +20 -0
  34. data/docs/Percentage.md +15 -0
  35. data/docs/PostalAddress.md +5 -1
  36. data/docs/PriceAllowanceAmount.md +15 -0
  37. data/docs/PriceBasisQuantity.md +15 -0
  38. data/docs/ProcessingOptions.md +3 -3
  39. data/docs/ProductCharacteristic.md +20 -0
  40. data/docs/ProductClassification.md +22 -0
  41. data/docs/Recipient.md +7 -1
  42. data/docs/RoundingAmount.md +15 -0
  43. data/docs/Supplier.md +17 -1
  44. data/docs/TaxRepresentative.md +22 -0
  45. data/docs/VATLine.md +2 -0
  46. data/docs/VATPointDateCode.md +15 -0
  47. data/docs/ValidationInfo.md +28 -0
  48. data/docs/VatRate.md +15 -0
  49. data/factpulse.gemspec +1 -1
  50. data/lib/factpulse/api/afnorpdppa_api.rb +1 -1
  51. data/lib/factpulse/api/afnorpdppa_directory_service_api.rb +1 -1
  52. data/lib/factpulse/api/afnorpdppa_flow_service_api.rb +1 -1
  53. data/lib/factpulse/api/chorus_pro_api.rb +1 -1
  54. data/lib/factpulse/api/document_conversion_api.rb +378 -0
  55. data/lib/factpulse/api/health_api.rb +1 -1
  56. data/lib/factpulse/api/invoice_processing_api.rb +9 -9
  57. data/lib/factpulse/api/pdfxml_verification_api.rb +1 -1
  58. data/lib/factpulse/api/user_api.rb +1 -1
  59. data/lib/factpulse/api_client.rb +1 -1
  60. data/lib/factpulse/api_error.rb +1 -1
  61. data/lib/factpulse/api_model_base.rb +1 -1
  62. data/lib/factpulse/configuration.rb +1 -1
  63. data/lib/factpulse/models/acknowledgment_status.rb +1 -1
  64. data/lib/factpulse/models/additional_document.rb +206 -0
  65. data/lib/factpulse/models/afnor_credentials.rb +1 -1
  66. data/lib/factpulse/models/afnor_destination.rb +1 -1
  67. data/lib/factpulse/models/afnor_health_check_response.rb +1 -1
  68. data/lib/factpulse/models/afnor_result.rb +1 -1
  69. data/lib/factpulse/models/allowance_charge.rb +252 -0
  70. data/lib/factpulse/models/allowance_reason_code.rb +1 -1
  71. data/lib/factpulse/models/allowance_total_amount.rb +104 -0
  72. data/lib/factpulse/models/amount.rb +104 -0
  73. data/lib/factpulse/models/amount_due.rb +2 -2
  74. data/lib/factpulse/models/api_error.rb +1 -1
  75. data/lib/factpulse/models/async_task_status.rb +1 -1
  76. data/lib/factpulse/models/base_amount.rb +104 -0
  77. data/lib/factpulse/models/bounding_box_schema.rb +1 -1
  78. data/lib/factpulse/models/celery_status.rb +1 -1
  79. data/lib/factpulse/models/certificate_info_response.rb +1 -1
  80. data/lib/factpulse/models/charge_total_amount.rb +104 -0
  81. data/lib/factpulse/models/chorus_pro_destination.rb +1 -1
  82. data/lib/factpulse/models/chorus_pro_result.rb +1 -1
  83. data/lib/factpulse/models/contact.rb +179 -0
  84. data/lib/factpulse/models/convert_error_response.rb +224 -0
  85. data/lib/factpulse/models/convert_pending_input_response.rb +322 -0
  86. data/lib/factpulse/models/convert_resume_request.rb +151 -0
  87. data/lib/factpulse/models/convert_success_response.rb +360 -0
  88. data/lib/factpulse/models/convert_validation_failed_response.rb +334 -0
  89. data/lib/factpulse/models/delivery_party.rb +179 -0
  90. data/lib/factpulse/models/destination.rb +1 -1
  91. data/lib/factpulse/models/document_type_info.rb +220 -0
  92. data/lib/factpulse/models/electronic_address.rb +1 -1
  93. data/lib/factpulse/models/enriched_invoice_info.rb +1 -1
  94. data/lib/factpulse/models/error_level.rb +1 -1
  95. data/lib/factpulse/models/error_source.rb +1 -1
  96. data/lib/factpulse/models/extraction_info.rb +217 -0
  97. data/lib/factpulse/models/factur_x_invoice.rb +150 -6
  98. data/lib/factpulse/models/{api_profile.rb → factur_x_profile.rb} +4 -4
  99. data/lib/factpulse/models/factur_xpdf_info.rb +1 -1
  100. data/lib/factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.rb +5 -5
  101. data/lib/factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb +1 -1
  102. data/lib/factpulse/models/field_status.rb +1 -1
  103. data/lib/factpulse/models/file_info.rb +161 -0
  104. data/lib/factpulse/models/files_info.rb +159 -0
  105. data/lib/factpulse/models/flow_direction.rb +1 -1
  106. data/lib/factpulse/models/flow_profile.rb +1 -1
  107. data/lib/factpulse/models/flow_summary.rb +1 -1
  108. data/lib/factpulse/models/flow_syntax.rb +1 -1
  109. data/lib/factpulse/models/flow_type.rb +1 -1
  110. data/lib/factpulse/models/generate_certificate_request.rb +6 -6
  111. data/lib/factpulse/models/generate_certificate_response.rb +1 -1
  112. data/lib/factpulse/models/get_chorus_pro_id_request.rb +2 -2
  113. data/lib/factpulse/models/get_chorus_pro_id_response.rb +1 -1
  114. data/lib/factpulse/models/get_invoice_request.rb +2 -2
  115. data/lib/factpulse/models/get_invoice_response.rb +1 -1
  116. data/lib/factpulse/models/get_structure_request.rb +3 -3
  117. data/lib/factpulse/models/get_structure_response.rb +1 -1
  118. data/lib/factpulse/models/global_allowance_amount.rb +2 -2
  119. data/lib/factpulse/models/gross_unit_price.rb +104 -0
  120. data/lib/factpulse/models/http_validation_error.rb +1 -1
  121. data/lib/factpulse/models/incoming_invoice.rb +2 -2
  122. data/lib/factpulse/models/incoming_supplier.rb +1 -1
  123. data/lib/factpulse/models/invoice_format.rb +1 -1
  124. data/lib/factpulse/models/invoice_line.rb +209 -25
  125. data/lib/factpulse/models/invoice_line_allowance_amount.rb +2 -2
  126. data/lib/factpulse/models/invoice_note.rb +1 -1
  127. data/lib/factpulse/models/invoice_references.rb +119 -16
  128. data/lib/factpulse/models/invoice_status.rb +1 -1
  129. data/lib/factpulse/models/invoice_totals.rb +52 -12
  130. data/lib/factpulse/models/invoice_totals_prepayment.rb +2 -2
  131. data/lib/factpulse/models/invoice_type_code.rb +1 -1
  132. data/lib/factpulse/models/invoicing_framework.rb +1 -1
  133. data/lib/factpulse/models/invoicing_framework_code.rb +1 -1
  134. data/lib/factpulse/models/line_net_amount.rb +2 -2
  135. data/lib/factpulse/models/line_total_amount.rb +104 -0
  136. data/lib/factpulse/models/mandatory_note_schema.rb +1 -1
  137. data/lib/factpulse/models/manual_rate.rb +2 -2
  138. data/lib/factpulse/models/manual_vat_rate.rb +2 -2
  139. data/lib/factpulse/models/missing_field.rb +269 -0
  140. data/lib/factpulse/models/operation_nature.rb +1 -1
  141. data/lib/factpulse/models/output_format.rb +1 -1
  142. data/lib/factpulse/models/page_dimensions_schema.rb +1 -1
  143. data/lib/factpulse/models/payee.rb +28 -6
  144. data/lib/factpulse/models/payment_card.rb +159 -0
  145. data/lib/factpulse/models/payment_means.rb +1 -1
  146. data/lib/factpulse/models/pdf_validation_result_api.rb +1 -1
  147. data/lib/factpulse/models/pdp_credentials.rb +6 -6
  148. data/lib/factpulse/models/percentage.rb +104 -0
  149. data/lib/factpulse/models/postal_address.rb +27 -7
  150. data/lib/factpulse/models/price_allowance_amount.rb +104 -0
  151. data/lib/factpulse/models/price_basis_quantity.rb +104 -0
  152. data/lib/factpulse/models/processing_options.rb +10 -10
  153. data/lib/factpulse/models/product_characteristic.rb +193 -0
  154. data/lib/factpulse/models/product_classification.rb +186 -0
  155. data/lib/factpulse/models/quantity.rb +2 -2
  156. data/lib/factpulse/models/recipient.rb +39 -7
  157. data/lib/factpulse/models/rounding_amount.rb +104 -0
  158. data/lib/factpulse/models/scheme_id.rb +12 -6
  159. data/lib/factpulse/models/search_flow_request.rb +8 -8
  160. data/lib/factpulse/models/search_flow_response.rb +1 -1
  161. data/lib/factpulse/models/search_services_response.rb +1 -1
  162. data/lib/factpulse/models/search_structure_request.rb +5 -5
  163. data/lib/factpulse/models/search_structure_response.rb +1 -1
  164. data/lib/factpulse/models/signature_info.rb +1 -1
  165. data/lib/factpulse/models/signature_info_api.rb +1 -1
  166. data/lib/factpulse/models/signature_parameters.rb +1 -1
  167. data/lib/factpulse/models/simplified_invoice_data.rb +1 -1
  168. data/lib/factpulse/models/structure_info.rb +1 -1
  169. data/lib/factpulse/models/structure_parameters.rb +1 -1
  170. data/lib/factpulse/models/structure_service.rb +1 -1
  171. data/lib/factpulse/models/submission_mode.rb +1 -1
  172. data/lib/factpulse/models/submit_complete_invoice_request.rb +1 -1
  173. data/lib/factpulse/models/submit_complete_invoice_response.rb +1 -1
  174. data/lib/factpulse/models/submit_flow_request.rb +7 -7
  175. data/lib/factpulse/models/submit_flow_response.rb +1 -1
  176. data/lib/factpulse/models/submit_gross_amount.rb +1 -1
  177. data/lib/factpulse/models/submit_invoice_request.rb +14 -14
  178. data/lib/factpulse/models/submit_invoice_response.rb +1 -1
  179. data/lib/factpulse/models/submit_net_amount.rb +1 -1
  180. data/lib/factpulse/models/submit_vat_amount.rb +1 -1
  181. data/lib/factpulse/models/supplementary_attachment.rb +1 -1
  182. data/lib/factpulse/models/supplier.rb +89 -7
  183. data/lib/factpulse/models/task_response.rb +1 -1
  184. data/lib/factpulse/models/tax_representative.rb +220 -0
  185. data/lib/factpulse/models/taxable_amount.rb +2 -2
  186. data/lib/factpulse/models/total_gross_amount.rb +2 -2
  187. data/lib/factpulse/models/total_net_amount.rb +2 -2
  188. data/lib/factpulse/models/total_vat_amount.rb +2 -2
  189. data/lib/factpulse/models/unit_net_price.rb +2 -2
  190. data/lib/factpulse/models/unit_of_measure.rb +1 -1
  191. data/lib/factpulse/models/validation_error.rb +1 -1
  192. data/lib/factpulse/models/validation_error_detail.rb +1 -1
  193. data/lib/factpulse/models/validation_error_loc_inner.rb +1 -1
  194. data/lib/factpulse/models/validation_error_response.rb +1 -1
  195. data/lib/factpulse/models/validation_info.rb +255 -0
  196. data/lib/factpulse/models/validation_success_response.rb +1 -1
  197. data/lib/factpulse/models/vat_accounting_code.rb +1 -1
  198. data/lib/factpulse/models/vat_amount.rb +2 -2
  199. data/lib/factpulse/models/vat_category.rb +1 -1
  200. data/lib/factpulse/models/vat_line.rb +13 -3
  201. data/lib/factpulse/models/{document_type.rb → vat_point_date_code.rb} +8 -10
  202. data/lib/factpulse/models/vat_rate.rb +104 -0
  203. data/lib/factpulse/models/verification_success_response.rb +1 -1
  204. data/lib/factpulse/models/verified_field_schema.rb +1 -1
  205. data/lib/factpulse/version.rb +2 -2
  206. data/lib/factpulse.rb +34 -3
  207. metadata +68 -6
@@ -0,0 +1,206 @@
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://www.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://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.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://www.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://www.factpulse.fr/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://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.19.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Additional supporting document (BG-24). References to external documents or embedded attachments.
18
+ class AdditionalDocument < ApiModelBase
19
+ # Document reference identifier (BT-122).
20
+ attr_accessor :id
21
+
22
+ attr_accessor :type_code
23
+
24
+ attr_accessor :name
25
+
26
+ attr_accessor :uri
27
+
28
+ attr_accessor :reference_type_code
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'id' => :'id',
34
+ :'type_code' => :'type_code',
35
+ :'name' => :'name',
36
+ :'uri' => :'uri',
37
+ :'reference_type_code' => :'reference_type_code'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'id' => :'String',
55
+ :'type_code' => :'String',
56
+ :'name' => :'String',
57
+ :'uri' => :'String',
58
+ :'reference_type_code' => :'String'
59
+ }
60
+ end
61
+
62
+ # List of attributes with nullable: true
63
+ def self.openapi_nullable
64
+ Set.new([
65
+ :'type_code',
66
+ :'name',
67
+ :'uri',
68
+ :'reference_type_code'
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::AdditionalDocument` 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::AdditionalDocument`. 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?(:'id')
89
+ self.id = attributes[:'id']
90
+ else
91
+ self.id = nil
92
+ end
93
+
94
+ if attributes.key?(:'type_code')
95
+ self.type_code = attributes[:'type_code']
96
+ end
97
+
98
+ if attributes.key?(:'name')
99
+ self.name = attributes[:'name']
100
+ end
101
+
102
+ if attributes.key?(:'uri')
103
+ self.uri = attributes[:'uri']
104
+ end
105
+
106
+ if attributes.key?(:'reference_type_code')
107
+ self.reference_type_code = attributes[:'reference_type_code']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
+ invalid_properties = Array.new
116
+ if @id.nil?
117
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
118
+ end
119
+
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
+ return false if @id.nil?
128
+ true
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param [Object] id Value to be assigned
133
+ def id=(id)
134
+ if id.nil?
135
+ fail ArgumentError, 'id cannot be nil'
136
+ end
137
+
138
+ @id = id
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param [Object] Object to be compared
143
+ def ==(o)
144
+ return true if self.equal?(o)
145
+ self.class == o.class &&
146
+ id == o.id &&
147
+ type_code == o.type_code &&
148
+ name == o.name &&
149
+ uri == o.uri &&
150
+ reference_type_code == o.reference_type_code
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [id, type_code, name, uri, reference_type_code].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ attributes = attributes.transform_keys(&:to_sym)
171
+ transformed_hash = {}
172
+ openapi_types.each_pair do |key, type|
173
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = nil
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[attribute_map[key]].is_a?(Array)
179
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
180
+ end
181
+ elsif !attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
183
+ end
184
+ end
185
+ new(transformed_hash)
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ end
205
+
206
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.19.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.19.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.19.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.19.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,252 @@
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://www.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://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.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://www.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://www.factpulse.fr/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://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.19.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Document-level or line-level allowance/charge. Represents BG-20 (Document level allowances), BG-21 (Document level charges), BG-27 (Invoice line allowances), or BG-28 (Invoice line charges).
18
+ class AllowanceCharge < ApiModelBase
19
+ # True for charge, False for allowance (ChargeIndicator).
20
+ attr_accessor :is_charge
21
+
22
+ attr_accessor :amount
23
+
24
+ attr_accessor :base_amount
25
+
26
+ attr_accessor :percentage
27
+
28
+ attr_accessor :reason
29
+
30
+ attr_accessor :reason_code
31
+
32
+ attr_accessor :vat_category
33
+
34
+ attr_accessor :vat_rate
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'is_charge' => :'is_charge',
40
+ :'amount' => :'amount',
41
+ :'base_amount' => :'base_amount',
42
+ :'percentage' => :'percentage',
43
+ :'reason' => :'reason',
44
+ :'reason_code' => :'reason_code',
45
+ :'vat_category' => :'vat_category',
46
+ :'vat_rate' => :'vat_rate'
47
+ }
48
+ end
49
+
50
+ # Returns attribute mapping this model knows about
51
+ def self.acceptable_attribute_map
52
+ attribute_map
53
+ end
54
+
55
+ # Returns all the JSON keys this model knows about
56
+ def self.acceptable_attributes
57
+ acceptable_attribute_map.values
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.openapi_types
62
+ {
63
+ :'is_charge' => :'Boolean',
64
+ :'amount' => :'Amount',
65
+ :'base_amount' => :'BaseAmount',
66
+ :'percentage' => :'Percentage',
67
+ :'reason' => :'String',
68
+ :'reason_code' => :'String',
69
+ :'vat_category' => :'String',
70
+ :'vat_rate' => :'VatRate'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ :'base_amount',
78
+ :'percentage',
79
+ :'reason',
80
+ :'reason_code',
81
+ :'vat_category',
82
+ :'vat_rate'
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::AllowanceCharge` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::AllowanceCharge`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'is_charge')
103
+ self.is_charge = attributes[:'is_charge']
104
+ else
105
+ self.is_charge = nil
106
+ end
107
+
108
+ if attributes.key?(:'amount')
109
+ self.amount = attributes[:'amount']
110
+ else
111
+ self.amount = nil
112
+ end
113
+
114
+ if attributes.key?(:'base_amount')
115
+ self.base_amount = attributes[:'base_amount']
116
+ end
117
+
118
+ if attributes.key?(:'percentage')
119
+ self.percentage = attributes[:'percentage']
120
+ end
121
+
122
+ if attributes.key?(:'reason')
123
+ self.reason = attributes[:'reason']
124
+ end
125
+
126
+ if attributes.key?(:'reason_code')
127
+ self.reason_code = attributes[:'reason_code']
128
+ end
129
+
130
+ if attributes.key?(:'vat_category')
131
+ self.vat_category = attributes[:'vat_category']
132
+ end
133
+
134
+ if attributes.key?(:'vat_rate')
135
+ self.vat_rate = attributes[:'vat_rate']
136
+ end
137
+ end
138
+
139
+ # Show invalid properties with the reasons. Usually used together with valid?
140
+ # @return Array for valid properties with the reasons
141
+ def list_invalid_properties
142
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
143
+ invalid_properties = Array.new
144
+ if @is_charge.nil?
145
+ invalid_properties.push('invalid value for "is_charge", is_charge cannot be nil.')
146
+ end
147
+
148
+ if @amount.nil?
149
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
150
+ end
151
+
152
+ invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ warn '[DEPRECATED] the `valid?` method is obsolete'
159
+ return false if @is_charge.nil?
160
+ return false if @amount.nil?
161
+ true
162
+ end
163
+
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] is_charge Value to be assigned
166
+ def is_charge=(is_charge)
167
+ if is_charge.nil?
168
+ fail ArgumentError, 'is_charge cannot be nil'
169
+ end
170
+
171
+ @is_charge = is_charge
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] amount Value to be assigned
176
+ def amount=(amount)
177
+ if amount.nil?
178
+ fail ArgumentError, 'amount cannot be nil'
179
+ end
180
+
181
+ @amount = amount
182
+ end
183
+
184
+ # Checks equality by comparing each attribute.
185
+ # @param [Object] Object to be compared
186
+ def ==(o)
187
+ return true if self.equal?(o)
188
+ self.class == o.class &&
189
+ is_charge == o.is_charge &&
190
+ amount == o.amount &&
191
+ base_amount == o.base_amount &&
192
+ percentage == o.percentage &&
193
+ reason == o.reason &&
194
+ reason_code == o.reason_code &&
195
+ vat_category == o.vat_category &&
196
+ vat_rate == o.vat_rate
197
+ end
198
+
199
+ # @see the `==` method
200
+ # @param [Object] Object to be compared
201
+ def eql?(o)
202
+ self == o
203
+ end
204
+
205
+ # Calculates hash code according to all attributes.
206
+ # @return [Integer] Hash code
207
+ def hash
208
+ [is_charge, amount, base_amount, percentage, reason, reason_code, vat_category, vat_rate].hash
209
+ end
210
+
211
+ # Builds the object from hash
212
+ # @param [Hash] attributes Model attributes in the form of hash
213
+ # @return [Object] Returns the model itself
214
+ def self.build_from_hash(attributes)
215
+ return nil unless attributes.is_a?(Hash)
216
+ attributes = attributes.transform_keys(&:to_sym)
217
+ transformed_hash = {}
218
+ openapi_types.each_pair do |key, type|
219
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
220
+ transformed_hash["#{key}"] = nil
221
+ elsif type =~ /\AArray<(.*)>/i
222
+ # check to ensure the input is an array given that the attribute
223
+ # is documented as an array but the input is not
224
+ if attributes[attribute_map[key]].is_a?(Array)
225
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
226
+ end
227
+ elsif !attributes[attribute_map[key]].nil?
228
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
229
+ end
230
+ end
231
+ new(transformed_hash)
232
+ end
233
+
234
+ # Returns the object in the form of hash
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_hash
237
+ hash = {}
238
+ self.class.attribute_map.each_pair do |attr, param|
239
+ value = self.send(attr)
240
+ if value.nil?
241
+ is_nullable = self.class.openapi_nullable.include?(attr)
242
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
243
+ end
244
+
245
+ hash[param] = _to_hash(value)
246
+ end
247
+ hash
248
+ end
249
+
250
+ end
251
+
252
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.19.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,104 @@
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://www.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://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.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://www.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://www.factpulse.fr/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://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.19.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Sum of all allowances on document level (BT-107).
18
+ module AllowanceTotalAmount
19
+ class << self
20
+ # List of class defined in anyOf (OpenAPI v3)
21
+ def openapi_any_of
22
+ [
23
+ :'Float',
24
+ :'String'
25
+ ]
26
+ end
27
+
28
+ # Builds the object
29
+ # @param [Mixed] Data to be matched against the list of anyOf items
30
+ # @return [Object] Returns the model or the data itself
31
+ def build(data)
32
+ # Go through the list of anyOf items and attempt to identify the appropriate one.
33
+ # Note:
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_any_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ return find_and_cast_into_type(klass, data)
42
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
43
+ end
44
+ end
45
+
46
+ openapi_any_of.include?(:AnyType) ? data : nil
47
+ end
48
+
49
+ private
50
+
51
+ SchemaMismatchError = Class.new(StandardError)
52
+
53
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
54
+ def find_and_cast_into_type(klass, data)
55
+ return if data.nil?
56
+
57
+ case klass.to_s
58
+ when 'Boolean'
59
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
60
+ when 'Float'
61
+ return data if data.instance_of?(Float)
62
+ when 'Integer'
63
+ return data if data.instance_of?(Integer)
64
+ when 'Time'
65
+ return Time.parse(data)
66
+ when 'Date'
67
+ return Date.iso8601(data)
68
+ when 'String'
69
+ return data if data.instance_of?(String)
70
+ when 'Object' # "type: object"
71
+ return data if data.instance_of?(Hash)
72
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
73
+ if data.instance_of?(Array)
74
+ sub_type = Regexp.last_match[:sub_type]
75
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
76
+ end
77
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
78
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
79
+ sub_type = Regexp.last_match[:sub_type]
80
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
81
+ end
82
+ else # model
83
+ const = FactPulse.const_get(klass)
84
+ if const
85
+ if const.respond_to?(:openapi_any_of) # nested anyOf model
86
+ model = const.build(data)
87
+ return model if model
88
+ else
89
+ # raise if data contains keys that are not known to the model
90
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
91
+ model = const.build_from_hash(data)
92
+ return model if model
93
+ end
94
+ end
95
+ end
96
+
97
+ raise # if no match by now, raise
98
+ rescue
99
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
100
+ end
101
+ end
102
+ end
103
+
104
+ end