UNPKG

scraper-api-datachaser

Version:

The scraping SaaS platform provides a RESTful API for developers to perform web scraping tasks. Users can submit scraping tasks, monitor task status, retrieve scraped data, and manage their account through the API.

163 lines (143 loc) 5.26 kB
/** * Scraper API * The scraping SaaS platform provides a RESTful API for developers to perform web scraping tasks. Users can submit scraping tasks, monitor task status, retrieve scraped data, and manage their account through the API. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. * */ import ApiClient from "../ApiClient"; import DeleteApiKeyRequest from '../model/DeleteApiKeyRequest'; import ErrorResponse from '../model/ErrorResponse'; import Key from '../model/Key'; import KeyCreateRequest from '../model/KeyCreateRequest'; /** * APIKeys service. * @module api/APIKeysApi * @version 1.0.0 */ export default class APIKeysApi { /** * Constructs a new APIKeysApi. * @alias module:api/APIKeysApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ constructor(apiClient) { this.apiClient = apiClient || ApiClient.instance; } /** * Callback function to receive the result of the keysDelete operation. * @callback module:api/APIKeysApi~keysDeleteCallback * @param {String} error Error message, if any. * @param {module:model/Key} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Delete API key by id * Delete API key with given api key id * @param {module:model/DeleteApiKeyRequest} body * @param {module:api/APIKeysApi~keysDeleteCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Key} */ keysDelete(body, callback) { let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling keysDelete"); } let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = ['key']; let contentTypes = ['application/json']; let accepts = ['application/json', 'application/octet-stream']; let returnType = Key; return this.apiClient.callApi( '/keys', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback ); } /** * Callback function to receive the result of the keysGet operation. * @callback module:api/APIKeysApi~keysGetCallback * @param {String} error Error message, if any. * @param {Array.<module:model/Key>} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Retrieve API keys list * Retrieve API keys list from authenticated user * @param {module:api/APIKeysApi~keysGetCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Array.<module:model/Key>} */ keysGet(callback) { let postBody = null; let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = ['key']; let contentTypes = []; let accepts = ['application/json', 'application/octet-stream']; let returnType = [Key]; return this.apiClient.callApi( '/keys', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback ); } /** * Callback function to receive the result of the keysPost operation. * @callback module:api/APIKeysApi~keysPostCallback * @param {String} error Error message, if any. * @param {module:model/Key} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Create new API Key * Create new API Key * @param {module:model/KeyCreateRequest} body * @param {module:api/APIKeysApi~keysPostCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Key} */ keysPost(body, callback) { let postBody = body; // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling keysPost"); } let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = ['key']; let contentTypes = ['application/json']; let accepts = ['application/json', 'application/octet-stream']; let returnType = Key; return this.apiClient.callApi( '/keys', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback ); } }