Class: FlatApi::OMRApi
- Inherits:
-
Object
- Object
- FlatApi::OMRApi
- Defined in:
- lib/flat_api/api/omr_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add_omr_job_file(job, omr_job_file_upload, opts = {}) ⇒ OmrJobFileUploadResult
Add a file to an OMR job Add one image or PDF to a draft job.
-
#add_omr_job_file_with_http_info(job, omr_job_file_upload, opts = {}) ⇒ Array<(OmrJobFileUploadResult, Integer, Hash)>
Add a file to an OMR job Add one image or PDF to a draft job.
-
#cancel_omr_job(job, opts = {}) ⇒ OmrJob
Cancel an OMR job Cancel a draft or in-flight job.
-
#cancel_omr_job_with_http_info(job, opts = {}) ⇒ Array<(OmrJob, Integer, Hash)>
Cancel an OMR job Cancel a draft or in-flight job.
-
#create_omr_job(omr_job_creation, opts = {}) ⇒ OmrJob
Create an OMR job Create an Optical Music Recognition job.
-
#create_omr_job_with_http_info(omr_job_creation, opts = {}) ⇒ Array<(OmrJob, Integer, Hash)>
Create an OMR job Create an Optical Music Recognition job.
-
#delete_omr_job(job, opts = {}) ⇒ OmrJob
Delete an OMR job's data Erase a job's uploaded files and recognition results now, instead of waiting for its retention deadline.
-
#delete_omr_job_with_http_info(job, opts = {}) ⇒ Array<(OmrJob, Integer, Hash)>
Delete an OMR job's data Erase a job's uploaded files and recognition results now, instead of waiting for its retention deadline.
-
#get_omr_capabilities(opts = {}) ⇒ OmrCapabilities
OMR capabilities and limits Advertises the supported steps, export formats, limits, cost-per-page, remaining credits and locales, so clients can feature-detect instead of hardcoding behavior.
-
#get_omr_capabilities_with_http_info(opts = {}) ⇒ Array<(OmrCapabilities, Integer, Hash)>
OMR capabilities and limits Advertises the supported steps, export formats, limits, cost-per-page, remaining credits and locales, so clients can feature-detect instead of hardcoding behavior.
-
#get_omr_job(job, opts = {}) ⇒ OmrJob
Get an OMR job Get the current state of an OMR job.
-
#get_omr_job_export(job, format, opts = {}) ⇒ File
Download the finalized result Stream the finalized result in the requested format.
-
#get_omr_job_export_with_http_info(job, format, opts = {}) ⇒ Array<(File, Integer, Hash)>
Download the finalized result Stream the finalized result in the requested format.
-
#get_omr_job_file(job, index, opts = {}) ⇒ File
Get an input page image Fetch one of the job's input files (a page image or PDF) by index, for the review UI.
-
#get_omr_job_file_with_http_info(job, index, opts = {}) ⇒ Array<(File, Integer, Hash)>
Get an input page image Fetch one of the job's input files (a page image or PDF) by index, for the review UI.
-
#get_omr_job_with_http_info(job, opts = {}) ⇒ Array<(OmrJob, Integer, Hash)>
Get an OMR job Get the current state of an OMR job.
-
#initialize(api_client = ApiClient.default) ⇒ OMRApi
constructor
A new instance of OMRApi.
-
#list_billing_credits_history(opts = {}) ⇒ Array<CreditTransaction>
List credit history The credit ledger of the authenticated account, sorted by creation date descending (most recent entry first).
-
#list_billing_credits_history_with_http_info(opts = {}) ⇒ Array<(Array<CreditTransaction>, Integer, Hash)>
List credit history The credit ledger of the authenticated account, sorted by creation date descending (most recent entry first).
-
#list_omr_jobs(opts = {}) ⇒ Array<OmrJob>
List OMR jobs List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts.
-
#list_omr_jobs_with_http_info(opts = {}) ⇒ Array<(Array<OmrJob>, Integer, Hash)>
List OMR jobs List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts.
-
#start_omr_job(job, opts = {}) ⇒ OmrJob
Start an OMR job Validate the attached files, run the permission, quota and credit checks, then queue the job for processing.
-
#start_omr_job_with_http_info(job, opts = {}) ⇒ Array<(OmrJob, Integer, Hash)>
Start an OMR job Validate the attached files, run the permission, quota and credit checks, then queue the job for processing.
-
#submit_omr_job_step(job, step, body, opts = {}) ⇒ OmrJob
Submit an interactive step Resolve the step the job is currently awaiting and resume the pipeline.
-
#submit_omr_job_step_with_http_info(job, step, body, opts = {}) ⇒ Array<(OmrJob, Integer, Hash)>
Submit an interactive step Resolve the step the job is currently awaiting and resume the pipeline.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/flat_api/api/omr_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#add_omr_job_file(job, omr_job_file_upload, opts = {}) ⇒ OmrJobFileUploadResult
Add a file to an OMR job Add one image or PDF to a draft job. Call once per file; files keep their upload order.
29 30 31 32 |
# File 'lib/flat_api/api/omr_api.rb', line 29 def add_omr_job_file(job, omr_job_file_upload, opts = {}) data, _status_code, _headers = add_omr_job_file_with_http_info(job, omr_job_file_upload, opts) data end |
#add_omr_job_file_with_http_info(job, omr_job_file_upload, opts = {}) ⇒ Array<(OmrJobFileUploadResult, Integer, Hash)>
Add a file to an OMR job Add one image or PDF to a draft job. Call once per file; files keep their upload order.
41 42 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 |
# File 'lib/flat_api/api/omr_api.rb', line 41 def add_omr_job_file_with_http_info(job, omr_job_file_upload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OMRApi.add_omr_job_file ...' end # verify the required parameter 'job' is set if @api_client.config.client_side_validation && job.nil? fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.add_omr_job_file" end # verify the required parameter 'omr_job_file_upload' is set if @api_client.config.client_side_validation && omr_job_file_upload.nil? fail ArgumentError, "Missing the required parameter 'omr_job_file_upload' when calling OMRApi.add_omr_job_file" end # resource path local_var_path = '/omr/jobs/{job}/files'.sub('{job}', CGI.escape(job.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 header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(omr_job_file_upload) # return_type return_type = opts[:debug_return_type] || 'OmrJobFileUploadResult' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"OMRApi.add_omr_job_file", :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: OMRApi#add_omr_job_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#cancel_omr_job(job, opts = {}) ⇒ OmrJob
Cancel an OMR job Cancel a draft or in-flight job. Any charged credits are reversed.
105 106 107 108 |
# File 'lib/flat_api/api/omr_api.rb', line 105 def cancel_omr_job(job, opts = {}) data, _status_code, _headers = cancel_omr_job_with_http_info(job, opts) data end |
#cancel_omr_job_with_http_info(job, opts = {}) ⇒ Array<(OmrJob, Integer, Hash)>
Cancel an OMR job Cancel a draft or in-flight job. Any charged credits are reversed.
116 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 |
# File 'lib/flat_api/api/omr_api.rb', line 116 def cancel_omr_job_with_http_info(job, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OMRApi.cancel_omr_job ...' end # verify the required parameter 'job' is set if @api_client.config.client_side_validation && job.nil? fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.cancel_omr_job" end # resource path local_var_path = '/omr/jobs/{job}/cancel'.sub('{job}', CGI.escape(job.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'] header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OmrJob' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"OMRApi.cancel_omr_job", :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: OMRApi#cancel_omr_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_omr_job(omr_job_creation, opts = {}) ⇒ OmrJob
Create an OMR job
Create an Optical Music Recognition job. There are two ways to call this endpoint: * Draft: send the parameters without files to create an empty job, then add files with addOmrJobFile, then run it with startOmrJob. Best for multiple images or incremental mobile capture. * One-shot: include files and autoStart: true to import in a single request. Best for a single PDF or a third-party integration. Declare the interactive steps your client supports in interactiveSteps: the pipeline runs fully automatically and only pauses at the steps you list. Steps you do not list, including ones added in the future, are auto-resolved with server defaults, so older clients never break.
171 172 173 174 |
# File 'lib/flat_api/api/omr_api.rb', line 171 def create_omr_job(omr_job_creation, opts = {}) data, _status_code, _headers = create_omr_job_with_http_info(omr_job_creation, opts) data end |
#create_omr_job_with_http_info(omr_job_creation, opts = {}) ⇒ Array<(OmrJob, Integer, Hash)>
Create an OMR job Create an Optical Music Recognition job. There are two ways to call this endpoint: * Draft: send the parameters without `files` to create an empty job, then add files with `addOmrJobFile`, then run it with `startOmrJob`. Best for multiple images or incremental mobile capture. * One-shot: include `files` and `autoStart: true` to import in a single request. Best for a single PDF or a third-party integration. Declare the interactive steps your client supports in `interactiveSteps`: the pipeline runs fully automatically and only pauses at the steps you list. Steps you do not list, including ones added in the future, are auto-resolved with server defaults, so older clients never break.
182 183 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 231 232 233 234 |
# File 'lib/flat_api/api/omr_api.rb', line 182 def create_omr_job_with_http_info(omr_job_creation, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OMRApi.create_omr_job ...' end # verify the required parameter 'omr_job_creation' is set if @api_client.config.client_side_validation && omr_job_creation.nil? fail ArgumentError, "Missing the required parameter 'omr_job_creation' when calling OMRApi.create_omr_job" end # resource path local_var_path = '/omr/jobs' # 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 header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(omr_job_creation) # return_type return_type = opts[:debug_return_type] || 'OmrJob' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"OMRApi.create_omr_job", :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: OMRApi#create_omr_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_omr_job(job, opts = {}) ⇒ OmrJob
Delete an OMR job's data
Erase a job's uploaded files and recognition results now, instead of waiting for its retention deadline. Use this to serve a deletion request from your own end user. Reaches the same end state as the scheduled cleanup: the files are gone, the job keeps the status it finished with, stays listable, and reports retention.expiredDate. Downloads then fail with OMR_JOB_EXPIRED. Only available for jobs whose output is musicxml. Library imports are not covered by the retention policy and are rejected with OMR_JOB_NOT_EXPIRABLE; delete the resulting score instead. The job must have finished (done, error or canceled). A draft or in-flight job is rejected with OMR_JOB_IN_PROGRESS: cancel it first, then delete. Deleting never cancels on your behalf, because cancellation reverses charged credits and that must not happen as a side effect of erasing data. Calling this again on an already-erased job succeeds and changes nothing.
242 243 244 245 |
# File 'lib/flat_api/api/omr_api.rb', line 242 def delete_omr_job(job, opts = {}) data, _status_code, _headers = delete_omr_job_with_http_info(job, opts) data end |
#delete_omr_job_with_http_info(job, opts = {}) ⇒ Array<(OmrJob, Integer, Hash)>
Delete an OMR job's data Erase a job's uploaded files and recognition results now, instead of waiting for its retention deadline. Use this to serve a deletion request from your own end user. Reaches the same end state as the scheduled cleanup: the files are gone, the job keeps the `status` it finished with, stays listable, and reports `retention.expiredDate`. Downloads then fail with `OMR_JOB_EXPIRED`. Only available for jobs whose `output` is `musicxml`. Library imports are not covered by the retention policy and are rejected with `OMR_JOB_NOT_EXPIRABLE`; delete the resulting score instead. The job must have finished (`done`, `error` or `canceled`). A draft or in-flight job is rejected with `OMR_JOB_IN_PROGRESS`: cancel it first, then delete. Deleting never cancels on your behalf, because cancellation reverses charged credits and that must not happen as a side effect of erasing data. Calling this again on an already-erased job succeeds and changes nothing.
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 |
# File 'lib/flat_api/api/omr_api.rb', line 253 def delete_omr_job_with_http_info(job, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OMRApi.delete_omr_job ...' end # verify the required parameter 'job' is set if @api_client.config.client_side_validation && job.nil? fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.delete_omr_job" end # resource path local_var_path = '/omr/jobs/{job}'.sub('{job}', CGI.escape(job.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'] header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OmrJob' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"OMRApi.delete_omr_job", :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(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: OMRApi#delete_omr_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_omr_capabilities(opts = {}) ⇒ OmrCapabilities
OMR capabilities and limits
Advertises the supported steps, export formats, limits, cost-per-page, remaining credits and locales, so clients can feature-detect instead of hardcoding behavior. Authentication is optional: called without an account, the limits are those of the free plan and remainingCredits is omitted.
307 308 309 310 |
# File 'lib/flat_api/api/omr_api.rb', line 307 def get_omr_capabilities(opts = {}) data, _status_code, _headers = get_omr_capabilities_with_http_info(opts) data end |
#get_omr_capabilities_with_http_info(opts = {}) ⇒ Array<(OmrCapabilities, Integer, Hash)>
OMR capabilities and limits Advertises the supported steps, export formats, limits, cost-per-page, remaining credits and locales, so clients can feature-detect instead of hardcoding behavior. Authentication is optional: called without an account, the limits are those of the free plan and `remainingCredits` is omitted.
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
# File 'lib/flat_api/api/omr_api.rb', line 317 def get_omr_capabilities_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OMRApi.get_omr_capabilities ...' end # resource path local_var_path = '/omr/capabilities' # 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'] header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OmrCapabilities' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"OMRApi.get_omr_capabilities", :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: OMRApi#get_omr_capabilities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_omr_job(job, opts = {}) ⇒ OmrJob
Get an OMR job
Get the current state of an OMR job. This is the primary polling endpoint. Pass wait to long-poll until the state changes.
369 370 371 372 |
# File 'lib/flat_api/api/omr_api.rb', line 369 def get_omr_job(job, opts = {}) data, _status_code, _headers = get_omr_job_with_http_info(job, opts) data end |
#get_omr_job_export(job, format, opts = {}) ⇒ File
Download the finalized result
Stream the finalized result in the requested format. Available once the job is done. For output: musicxml jobs this is the primary way to retrieve the result; no library score is created.
446 447 448 449 |
# File 'lib/flat_api/api/omr_api.rb', line 446 def get_omr_job_export(job, format, opts = {}) data, _status_code, _headers = get_omr_job_export_with_http_info(job, format, opts) data end |
#get_omr_job_export_with_http_info(job, format, opts = {}) ⇒ Array<(File, Integer, Hash)>
Download the finalized result Stream the finalized result in the requested format. Available once the job is `done`. For `output: musicxml` jobs this is the primary way to retrieve the result; no library score is created.
458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 |
# File 'lib/flat_api/api/omr_api.rb', line 458 def get_omr_job_export_with_http_info(job, format, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OMRApi.get_omr_job_export ...' end # verify the required parameter 'job' is set if @api_client.config.client_side_validation && job.nil? fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.get_omr_job_export" end # verify the required parameter 'format' is set if @api_client.config.client_side_validation && format.nil? fail ArgumentError, "Missing the required parameter 'format' when calling OMRApi.get_omr_job_export" end # verify enum value allowable_values = ["musicxml", "mxl", "midi", "thumbnail.png"] if @api_client.config.client_side_validation && !allowable_values.include?(format) fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}" end # resource path local_var_path = '/omr/jobs/{job}/exports/{format}'.sub('{job}', CGI.escape(job.to_s)).sub('{format}', CGI.escape(format.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/octet-stream', 'application/json']) unless header_params['Accept'] header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'File' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"OMRApi.get_omr_job_export", :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: OMRApi#get_omr_job_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_omr_job_file(job, index, opts = {}) ⇒ File
Get an input page image
Fetch one of the job's input files (a page image or PDF) by index, for the review UI. Once data retention has erased the job, this returns 409 OMR_JOB_EXPIRED. Read retention.expiredDate on the job to tell that case apart before requesting a file.
523 524 525 526 |
# File 'lib/flat_api/api/omr_api.rb', line 523 def get_omr_job_file(job, index, opts = {}) data, _status_code, _headers = get_omr_job_file_with_http_info(job, index, opts) data end |
#get_omr_job_file_with_http_info(job, index, opts = {}) ⇒ Array<(File, Integer, Hash)>
Get an input page image Fetch one of the job's input files (a page image or PDF) by index, for the review UI. Once data retention has erased the job, this returns 409 `OMR_JOB_EXPIRED`. Read `retention.expiredDate` on the job to tell that case apart before requesting a file.
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 |
# File 'lib/flat_api/api/omr_api.rb', line 535 def get_omr_job_file_with_http_info(job, index, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OMRApi.get_omr_job_file ...' end # verify the required parameter 'job' is set if @api_client.config.client_side_validation && job.nil? fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.get_omr_job_file" end # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? fail ArgumentError, "Missing the required parameter 'index' when calling OMRApi.get_omr_job_file" end # resource path local_var_path = '/omr/jobs/{job}/files/{index}'.sub('{job}', CGI.escape(job.to_s)).sub('{index}', CGI.escape(index.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(['image/jpeg', 'application/json']) unless header_params['Accept'] header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'File' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"OMRApi.get_omr_job_file", :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: OMRApi#get_omr_job_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_omr_job_with_http_info(job, opts = {}) ⇒ Array<(OmrJob, Integer, Hash)>
Get an OMR job Get the current state of an OMR job. This is the primary polling endpoint. Pass `wait` to long-poll until the state changes.
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
# File 'lib/flat_api/api/omr_api.rb', line 381 def get_omr_job_with_http_info(job, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OMRApi.get_omr_job ...' end # verify the required parameter 'job' is set if @api_client.config.client_side_validation && job.nil? fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.get_omr_job" end if @api_client.config.client_side_validation && !opts[:'wait'].nil? && opts[:'wait'] > 25 fail ArgumentError, 'invalid value for "opts[:"wait"]" when calling OMRApi.get_omr_job, must be smaller than or equal to 25.' end if @api_client.config.client_side_validation && !opts[:'wait'].nil? && opts[:'wait'] < 0 fail ArgumentError, 'invalid value for "opts[:"wait"]" when calling OMRApi.get_omr_job, must be greater than or equal to 0.' end # resource path local_var_path = '/omr/jobs/{job}'.sub('{job}', CGI.escape(job.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil? # 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'] header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OmrJob' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"OMRApi.get_omr_job", :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: OMRApi#get_omr_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_billing_credits_history(opts = {}) ⇒ Array<CreditTransaction>
List credit history
The credit ledger of the authenticated account, sorted by creation date descending (most recent entry first). Every entry that moved the balance is listed: the deductions taken when an import runs, and the top-ups added by a credit pack. Reversing a deduction does not add an entry, it flips the original one's state to canceled. Canceled entries stay in the list, so an import that was charged and then failed still shows its deduction rather than disappearing. Read state to tell the two apart, and sum only active entries. A refund can additionally add a positive entry when cancelling alone could not restore the full cost, for instance because the plan's allowance has since reset. The current balance is not computed from this list: read it from getOmrCapabilities.
595 596 597 598 |
# File 'lib/flat_api/api/omr_api.rb', line 595 def list_billing_credits_history(opts = {}) data, _status_code, _headers = list_billing_credits_history_with_http_info(opts) data end |
#list_billing_credits_history_with_http_info(opts = {}) ⇒ Array<(Array<CreditTransaction>, Integer, Hash)>
List credit history The credit ledger of the authenticated account, sorted by creation date descending (most recent entry first). Every entry that moved the balance is listed: the deductions taken when an import runs, and the top-ups added by a credit pack. Reversing a deduction does not add an entry, it flips the original one's `state` to `canceled`. Canceled entries stay in the list, so an import that was charged and then failed still shows its deduction rather than disappearing. Read `state` to tell the two apart, and sum only `active` entries. A refund can additionally add a positive entry when cancelling alone could not restore the full cost, for instance because the plan's allowance has since reset. The current balance is not computed from this list: read it from `getOmrCapabilities`.
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 |
# File 'lib/flat_api/api/omr_api.rb', line 607 def list_billing_credits_history_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OMRApi.list_billing_credits_history ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OMRApi.list_billing_credits_history, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OMRApi.list_billing_credits_history, must be greater than or equal to 1.' end # resource path local_var_path = '/billing/credits/history' # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil? query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil? # 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] || 'Array<CreditTransaction>' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"OMRApi.list_billing_credits_history", :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: OMRApi#list_billing_credits_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_omr_jobs(opts = {}) ⇒ Array<OmrJob>
List OMR jobs List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts.
672 673 674 675 |
# File 'lib/flat_api/api/omr_api.rb', line 672 def list_omr_jobs(opts = {}) data, _status_code, _headers = list_omr_jobs_with_http_info(opts) data end |
#list_omr_jobs_with_http_info(opts = {}) ⇒ Array<(Array<OmrJob>, Integer, Hash)>
List OMR jobs List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts.
687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 |
# File 'lib/flat_api/api/omr_api.rb', line 687 def list_omr_jobs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OMRApi.list_omr_jobs ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OMRApi.list_omr_jobs, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OMRApi.list_omr_jobs, must be greater than or equal to 1.' end # resource path local_var_path = '/omr/jobs' # query parameters query_params = opts[:query_params] || {} query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'expired'] = opts[:'expired'] if !opts[:'expired'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil? query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil? # 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'] header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<OmrJob>' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"OMRApi.list_omr_jobs", :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: OMRApi#list_omr_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#start_omr_job(job, opts = {}) ⇒ OmrJob
Start an OMR job Validate the attached files, run the permission, quota and credit checks, then queue the job for processing.
751 752 753 754 |
# File 'lib/flat_api/api/omr_api.rb', line 751 def start_omr_job(job, opts = {}) data, _status_code, _headers = start_omr_job_with_http_info(job, opts) data end |
#start_omr_job_with_http_info(job, opts = {}) ⇒ Array<(OmrJob, Integer, Hash)>
Start an OMR job Validate the attached files, run the permission, quota and credit checks, then queue the job for processing.
762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 |
# File 'lib/flat_api/api/omr_api.rb', line 762 def start_omr_job_with_http_info(job, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OMRApi.start_omr_job ...' end # verify the required parameter 'job' is set if @api_client.config.client_side_validation && job.nil? fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.start_omr_job" end # resource path local_var_path = '/omr/jobs/{job}/start'.sub('{job}', CGI.escape(job.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'] header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OmrJob' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"OMRApi.start_omr_job", :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: OMRApi#start_omr_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#submit_omr_job_step(job, step, body, opts = {}) ⇒ OmrJob
Submit an interactive step
Resolve the step the job is currently awaiting and resume the pipeline. The request body shape depends on step (a oneOf discriminated by the step name).
819 820 821 822 |
# File 'lib/flat_api/api/omr_api.rb', line 819 def submit_omr_job_step(job, step, body, opts = {}) data, _status_code, _headers = submit_omr_job_step_with_http_info(job, step, body, opts) data end |
#submit_omr_job_step_with_http_info(job, step, body, opts = {}) ⇒ Array<(OmrJob, Integer, Hash)>
Submit an interactive step Resolve the step the job is currently awaiting and resume the pipeline. The request body shape depends on `step` (a `oneOf` discriminated by the step name).
832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 |
# File 'lib/flat_api/api/omr_api.rb', line 832 def submit_omr_job_step_with_http_info(job, step, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OMRApi.submit_omr_job_step ...' end # verify the required parameter 'job' is set if @api_client.config.client_side_validation && job.nil? fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.submit_omr_job_step" end # verify the required parameter 'step' is set if @api_client.config.client_side_validation && step.nil? fail ArgumentError, "Missing the required parameter 'step' when calling OMRApi.submit_omr_job_step" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling OMRApi.submit_omr_job_step" end # resource path local_var_path = '/omr/jobs/{job}/steps/{step}'.sub('{job}', CGI.escape(job.to_s)).sub('{step}', CGI.escape(step.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 header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'OmrJob' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] = opts.merge( :operation => :"OMRApi.submit_omr_job_step", :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: OMRApi#submit_omr_job_step\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |