Class: DocRaptor::ClientApi
- Inherits:
-
Object
- Object
- DocRaptor::ClientApi
- Defined in:
- lib/docraptor/api/client_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_async_doc(doc, opts = {}) ⇒ AsyncDoc
Creates a document asynchronously.nYou must use a callback url or the the returned status id and the status api to find out when it completes.
-
#create_async_doc_with_http_info(doc, opts = {}) ⇒ Array<(AsyncDoc, Fixnum, Hash)>
Creates a document asynchronously.nYou must use a callback url or the the returned status id and the status api to find out when it completes.
-
#create_doc(doc, opts = {}) ⇒ String
Creates a document synchronously.
-
#create_doc_with_http_info(doc, opts = {}) ⇒ Array<(String, Fixnum, Hash)>
Creates a document synchronously.
-
#get_async_doc(id, opts = {}) ⇒ String
Downloads a document.
-
#get_async_doc_status(id, opts = {}) ⇒ AsyncDocStatus
Check on the status of an asynchronously created document.
-
#get_async_doc_status_with_http_info(id, opts = {}) ⇒ Array<(AsyncDocStatus, Fixnum, Hash)>
Check on the status of an asynchronously created document.
-
#get_async_doc_with_http_info(id, opts = {}) ⇒ Array<(String, Fixnum, Hash)>
Downloads a document.
-
#initialize(api_client = ApiClient.default) ⇒ ClientApi
constructor
A new instance of ClientApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ClientApi
Returns a new instance of ClientApi.
7 8 9 |
# File 'lib/docraptor/api/client_api.rb', line 7 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
5 6 7 |
# File 'lib/docraptor/api/client_api.rb', line 5 def api_client @api_client end |
Instance Method Details
#create_async_doc(doc, opts = {}) ⇒ AsyncDoc
Creates a document asynchronously.nYou must use a callback url or the the returned status id and the status api to find out when it completes. Then use the download api to get the document.
16 17 18 19 |
# File 'lib/docraptor/api/client_api.rb', line 16 def create_async_doc(doc, opts = {}) data, status_code, headers = create_async_doc_with_http_info(doc, opts) return data end |
#create_async_doc_with_http_info(doc, opts = {}) ⇒ Array<(AsyncDoc, Fixnum, Hash)>
Creates a document asynchronously.nYou must use a callback url or the the returned status id and the status api to find out when it completes. Then use the download api to get the document.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 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 |
# File 'lib/docraptor/api/client_api.rb', line 26 def create_async_doc_with_http_info(doc, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ClientApi#create_async_doc ..." end # verify the required parameter 'doc' is set fail "Missing the required parameter 'doc' when calling create_async_doc" if doc.nil? # resource path path = "/async_docs".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json', 'application/xml', 'application/pdf', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(doc) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AsyncDoc') if @api_client.config.debugging @api_client.config.logger.debug "API called: ClientApi#create_async_doc\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_doc(doc, opts = {}) ⇒ String
Creates a document synchronously.
77 78 79 80 |
# File 'lib/docraptor/api/client_api.rb', line 77 def create_doc(doc, opts = {}) data, status_code, headers = create_doc_with_http_info(doc, opts) return data end |
#create_doc_with_http_info(doc, opts = {}) ⇒ Array<(String, Fixnum, Hash)>
Creates a document synchronously.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 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 |
# File 'lib/docraptor/api/client_api.rb', line 87 def create_doc_with_http_info(doc, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ClientApi#create_doc ..." end # verify the required parameter 'doc' is set fail "Missing the required parameter 'doc' when calling create_doc" if doc.nil? # resource path path = "/docs".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json', 'application/xml', 'application/pdf', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(doc) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: ClientApi#create_doc\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_async_doc(id, opts = {}) ⇒ String
Downloads a document.
138 139 140 141 |
# File 'lib/docraptor/api/client_api.rb', line 138 def get_async_doc(id, opts = {}) data, status_code, headers = get_async_doc_with_http_info(id, opts) return data end |
#get_async_doc_status(id, opts = {}) ⇒ AsyncDocStatus
Check on the status of an asynchronously created document.
199 200 201 202 |
# File 'lib/docraptor/api/client_api.rb', line 199 def get_async_doc_status(id, opts = {}) data, status_code, headers = get_async_doc_status_with_http_info(id, opts) return data end |
#get_async_doc_status_with_http_info(id, opts = {}) ⇒ Array<(AsyncDocStatus, Fixnum, Hash)>
Check on the status of an asynchronously created document.
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 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/docraptor/api/client_api.rb', line 209 def get_async_doc_status_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ClientApi#get_async_doc_status ..." end # verify the required parameter 'id' is set fail "Missing the required parameter 'id' when calling get_async_doc_status" if id.nil? # resource path path = "/status/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json', 'application/xml', 'application/pdf', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AsyncDocStatus') if @api_client.config.debugging @api_client.config.logger.debug "API called: ClientApi#get_async_doc_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_async_doc_with_http_info(id, opts = {}) ⇒ Array<(String, Fixnum, Hash)>
Downloads a document.
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/docraptor/api/client_api.rb', line 148 def get_async_doc_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ClientApi#get_async_doc ..." end # verify the required parameter 'id' is set fail "Missing the required parameter 'id' when calling get_async_doc" if id.nil? # resource path path = "/download/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json', 'application/xml', 'application/pdf', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: ClientApi#get_async_doc\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |