Class: FactPulse::DocumentConversionApi
- Inherits:
-
Object
- Object
- FactPulse::DocumentConversionApi
- Defined in:
- lib/factpulse/api/document_conversion_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#convert_document_async_api_v1_convert_async_post(file, opts = {}) ⇒ Object
Convertir un document en Factur-X (mode asynchrone) Lance une conversion asynchrone via Celery.
-
#convert_document_async_api_v1_convert_async_post_with_http_info(file, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Convertir un document en Factur-X (mode asynchrone) Lance une conversion asynchrone via Celery.
-
#download_file_api_v1_convert_conversion_id_download_filename_get(conversion_id, filename, opts = {}) ⇒ Object
Télécharger un fichier généré Télécharge le fichier Factur-X PDF ou XML généré.
-
#download_file_api_v1_convert_conversion_id_download_filename_get_with_http_info(conversion_id, filename, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Télécharger un fichier généré Télécharge le fichier Factur-X PDF ou XML généré.
-
#get_conversion_status_api_v1_convert_conversion_id_status_get(conversion_id, opts = {}) ⇒ Hash<String, Object>
Vérifier le statut d'une conversion Retourne le statut actuel d'une conversion asynchrone.
-
#get_conversion_status_api_v1_convert_conversion_id_status_get_with_http_info(conversion_id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Vérifier le statut d'une conversion Retourne le statut actuel d'une conversion asynchrone.
-
#initialize(api_client = ApiClient.default) ⇒ DocumentConversionApi
constructor
A new instance of DocumentConversionApi.
-
#resume_conversion_api_v1_convert_conversion_id_resume_post(conversion_id, convert_resume_request, opts = {}) ⇒ ConvertSuccessResponse
Reprendre une conversion avec corrections Reprend une conversion après complétion des données manquantes ou correction des erreurs.
-
#resume_conversion_api_v1_convert_conversion_id_resume_post_with_http_info(conversion_id, convert_resume_request, opts = {}) ⇒ Array<(ConvertSuccessResponse, Integer, Hash)>
Reprendre une conversion avec corrections Reprend une conversion après complétion des données manquantes ou correction des erreurs.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ DocumentConversionApi
Returns a new instance of DocumentConversionApi.
19 20 21 |
# File 'lib/factpulse/api/document_conversion_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/factpulse/api/document_conversion_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#convert_document_async_api_v1_convert_async_post(file, opts = {}) ⇒ Object
Convertir un document en Factur-X (mode asynchrone) Lance une conversion asynchrone via Celery. ## Workflow 1. Upload : Le document est envoyé en multipart/form-data 2. Task Celery : La tâche est mise en file d'attente 3. Callback : Notification par webhook à la fin ## Réponses possibles - 202 : Tâche acceptée, en cours de traitement - 400 : Fichier invalide
30 31 32 33 |
# File 'lib/factpulse/api/document_conversion_api.rb', line 30 def convert_document_async_api_v1_convert_async_post(file, opts = {}) data, _status_code, _headers = convert_document_async_api_v1_convert_async_post_with_http_info(file, opts) data end |
#convert_document_async_api_v1_convert_async_post_with_http_info(file, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Convertir un document en Factur-X (mode asynchrone) Lance une conversion asynchrone via Celery. ## Workflow 1. Upload : Le document est envoyé en multipart/form-data 2. Task Celery : La tâche est mise en file d'attente 3. Callback : Notification par webhook à la fin ## Réponses possibles - 202 : Tâche acceptée, en cours de traitement - 400 : Fichier invalide
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/factpulse/api/document_conversion_api.rb', line 43 def convert_document_async_api_v1_convert_async_post_with_http_info(file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DocumentConversionApi.convert_document_async_api_v1_convert_async_post ...' end # verify the required parameter 'file' is set if @api_client.config.client_side_validation && file.nil? fail ArgumentError, "Missing the required parameter 'file' when calling DocumentConversionApi.convert_document_async_api_v1_convert_async_post" end # resource path local_var_path = '/api/v1/convert/async' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} form_params['file'] = file form_params['output'] = opts[:'output'] if !opts[:'output'].nil? form_params['callback_url'] = opts[:'callback_url'] if !opts[:'callback_url'].nil? form_params['webhook_mode'] = opts[:'webhook_mode'] if !opts[:'webhook_mode'].nil? # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"DocumentConversionApi.convert_document_async_api_v1_convert_async_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentConversionApi#convert_document_async_api_v1_convert_async_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#download_file_api_v1_convert_conversion_id_download_filename_get(conversion_id, filename, opts = {}) ⇒ Object
Télécharger un fichier généré
Télécharge le fichier Factur-X PDF ou XML généré. ## Fichiers disponibles - facturx.pdf : PDF/A-3 avec XML embarqué - facturx.xml : XML CII seul (Cross Industry Invoice) Les fichiers sont disponibles pendant 24 heures après génération.
106 107 108 109 |
# File 'lib/factpulse/api/document_conversion_api.rb', line 106 def download_file_api_v1_convert_conversion_id_download_filename_get(conversion_id, filename, opts = {}) data, _status_code, _headers = download_file_api_v1_convert_conversion_id_download_filename_get_with_http_info(conversion_id, filename, opts) data end |
#download_file_api_v1_convert_conversion_id_download_filename_get_with_http_info(conversion_id, filename, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Télécharger un fichier généré Télécharge le fichier Factur-X PDF ou XML généré. ## Fichiers disponibles - `facturx.pdf` : PDF/A-3 avec XML embarqué - `facturx.xml` : XML CII seul (Cross Industry Invoice) Les fichiers sont disponibles pendant 24 heures après génération.
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/factpulse/api/document_conversion_api.rb', line 117 def download_file_api_v1_convert_conversion_id_download_filename_get_with_http_info(conversion_id, filename, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DocumentConversionApi.download_file_api_v1_convert_conversion_id_download_filename_get ...' end # verify the required parameter 'conversion_id' is set if @api_client.config.client_side_validation && conversion_id.nil? fail ArgumentError, "Missing the required parameter 'conversion_id' when calling DocumentConversionApi.download_file_api_v1_convert_conversion_id_download_filename_get" end # verify the required parameter 'filename' is set if @api_client.config.client_side_validation && filename.nil? fail ArgumentError, "Missing the required parameter 'filename' when calling DocumentConversionApi.download_file_api_v1_convert_conversion_id_download_filename_get" end # resource path local_var_path = '/api/v1/convert/{conversion_id}/download/{filename}'.sub('{' + 'conversion_id' + '}', CGI.escape(conversion_id.to_s)).sub('{' + 'filename' + '}', CGI.escape(filename.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"DocumentConversionApi.download_file_api_v1_convert_conversion_id_download_filename_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentConversionApi#download_file_api_v1_convert_conversion_id_download_filename_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_conversion_status_api_v1_convert_conversion_id_status_get(conversion_id, opts = {}) ⇒ Hash<String, Object>
Vérifier le statut d'une conversion Retourne le statut actuel d'une conversion asynchrone.
174 175 176 177 |
# File 'lib/factpulse/api/document_conversion_api.rb', line 174 def get_conversion_status_api_v1_convert_conversion_id_status_get(conversion_id, opts = {}) data, _status_code, _headers = get_conversion_status_api_v1_convert_conversion_id_status_get_with_http_info(conversion_id, opts) data end |
#get_conversion_status_api_v1_convert_conversion_id_status_get_with_http_info(conversion_id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Vérifier le statut d'une conversion Retourne le statut actuel d'une conversion asynchrone.
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/factpulse/api/document_conversion_api.rb', line 184 def get_conversion_status_api_v1_convert_conversion_id_status_get_with_http_info(conversion_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DocumentConversionApi.get_conversion_status_api_v1_convert_conversion_id_status_get ...' end # verify the required parameter 'conversion_id' is set if @api_client.config.client_side_validation && conversion_id.nil? fail ArgumentError, "Missing the required parameter 'conversion_id' when calling DocumentConversionApi.get_conversion_status_api_v1_convert_conversion_id_status_get" end # resource path local_var_path = '/api/v1/convert/{conversion_id}/status'.sub('{' + 'conversion_id' + '}', CGI.escape(conversion_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"DocumentConversionApi.get_conversion_status_api_v1_convert_conversion_id_status_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentConversionApi#get_conversion_status_api_v1_convert_conversion_id_status_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#resume_conversion_api_v1_convert_conversion_id_resume_post(conversion_id, convert_resume_request, opts = {}) ⇒ ConvertSuccessResponse
Reprendre une conversion avec corrections Reprend une conversion après complétion des données manquantes ou correction des erreurs. L'extraction OCR est conservée, les données sont mises à jour avec les corrections, puis une nouvelle validation Schematron est effectuée.
238 239 240 241 |
# File 'lib/factpulse/api/document_conversion_api.rb', line 238 def resume_conversion_api_v1_convert_conversion_id_resume_post(conversion_id, convert_resume_request, opts = {}) data, _status_code, _headers = resume_conversion_api_v1_convert_conversion_id_resume_post_with_http_info(conversion_id, convert_resume_request, opts) data end |
#resume_conversion_api_v1_convert_conversion_id_resume_post_with_http_info(conversion_id, convert_resume_request, opts = {}) ⇒ Array<(ConvertSuccessResponse, Integer, Hash)>
Reprendre une conversion avec corrections Reprend une conversion après complétion des données manquantes ou correction des erreurs. L'extraction OCR est conservée, les données sont mises à jour avec les corrections, puis une nouvelle validation Schematron est effectuée.
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/factpulse/api/document_conversion_api.rb', line 249 def resume_conversion_api_v1_convert_conversion_id_resume_post_with_http_info(conversion_id, convert_resume_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DocumentConversionApi.resume_conversion_api_v1_convert_conversion_id_resume_post ...' end # verify the required parameter 'conversion_id' is set if @api_client.config.client_side_validation && conversion_id.nil? fail ArgumentError, "Missing the required parameter 'conversion_id' when calling DocumentConversionApi.resume_conversion_api_v1_convert_conversion_id_resume_post" end # verify the required parameter 'convert_resume_request' is set if @api_client.config.client_side_validation && convert_resume_request.nil? fail ArgumentError, "Missing the required parameter 'convert_resume_request' when calling DocumentConversionApi.resume_conversion_api_v1_convert_conversion_id_resume_post" end # resource path local_var_path = '/api/v1/convert/{conversion_id}/resume'.sub('{' + 'conversion_id' + '}', CGI.escape(conversion_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(convert_resume_request) # return_type return_type = opts[:debug_return_type] || 'ConvertSuccessResponse' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"DocumentConversionApi.resume_conversion_api_v1_convert_conversion_id_resume_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DocumentConversionApi#resume_conversion_api_v1_convert_conversion_id_resume_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |