Class: BudgeaClient::OCRApi
- Inherits:
-
Object
- Object
- BudgeaClient::OCRApi
- Defined in:
- lib/budgea_client/api/ocr_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ OCRApi
constructor
A new instance of OCRApi.
-
#ocr_post(file, opts = {}) ⇒ nil
Post an image with OCR Post an image and apply OCR on it to obtain found meta-data.
. -
#ocr_post_with_http_info(file, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Post an image with OCR Post an image and apply OCR on it to obtain found meta-data.<br><br>.
-
#users_id_user_ocr_post(id_user, file, opts = {}) ⇒ nil
Post an image with OCR Post an image and apply OCR on it to obtain found meta-data.
. -
#users_id_user_ocr_post_with_http_info(id_user, file, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Post an image with OCR Post an image and apply OCR on it to obtain found meta-data.<br><br>.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/budgea_client/api/ocr_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#ocr_post(file, opts = {}) ⇒ nil
Post an image with OCR Post an image and apply OCR on it to obtain found meta-data.
29 30 31 32 |
# File 'lib/budgea_client/api/ocr_api.rb', line 29 def ocr_post(file, opts = {}) ocr_post_with_http_info(file, opts) nil end |
#ocr_post_with_http_info(file, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Post an image with OCR Post an image and apply OCR on it to obtain found meta-data.<br><br>
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 |
# File 'lib/budgea_client/api/ocr_api.rb', line 41 def ocr_post_with_http_info(file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OCRApi.ocr_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 OCRApi.ocr_post" end # resource path local_var_path = '/ocr' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) # form parameters form_params = {} form_params['file'] = file form_params['id_transaction'] = opts[:'id_transaction'] if !opts[:'id_transaction'].nil? form_params['name'] = opts[:'name'] if !opts[:'name'].nil? # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: OCRApi#ocr_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#users_id_user_ocr_post(id_user, file, opts = {}) ⇒ nil
Post an image with OCR Post an image and apply OCR on it to obtain found meta-data.
90 91 92 93 |
# File 'lib/budgea_client/api/ocr_api.rb', line 90 def users_id_user_ocr_post(id_user, file, opts = {}) users_id_user_ocr_post_with_http_info(id_user, file, opts) nil end |
#users_id_user_ocr_post_with_http_info(id_user, file, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Post an image with OCR Post an image and apply OCR on it to obtain found meta-data.<br><br>
103 104 105 106 107 108 109 110 111 112 113 114 115 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 |
# File 'lib/budgea_client/api/ocr_api.rb', line 103 def users_id_user_ocr_post_with_http_info(id_user, file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OCRApi.users_id_user_ocr_post ...' end # verify the required parameter 'id_user' is set if @api_client.config.client_side_validation && id_user.nil? fail ArgumentError, "Missing the required parameter 'id_user' when calling OCRApi.users_id_user_ocr_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 OCRApi.users_id_user_ocr_post" end # resource path local_var_path = '/users/{id_user}/ocr'.sub('{' + 'id_user' + '}', id_user.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) # form parameters form_params = {} form_params['file'] = file form_params['id_transaction'] = opts[:'id_transaction'] if !opts[:'id_transaction'].nil? form_params['name'] = opts[:'name'] if !opts[:'name'].nil? # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: OCRApi#users_id_user_ocr_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |