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.

206 lines (182 loc) 6.71 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 Data from '../model/Data'; import ErrorResponse from '../model/ErrorResponse'; /** * Data service. * @module api/DataApi * @version 1.0.0 */ export default class DataApi { /** * Constructs a new DataApi. * @alias module:api/DataApi * @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 dataGet operation. * @callback module:api/DataApi~dataGetCallback * @param {String} error Error message, if any. * @param {Array.<module:model/Data>} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Get all data * This endpoint gets all data from logged user * @param {module:api/DataApi~dataGetCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Array.<module:model/Data>} */ dataGet(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 = [Data]; return this.apiClient.callApi( '/data', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback ); } /** * Callback function to receive the result of the dataIdDelete operation. * @callback module:api/DataApi~dataIdDeleteCallback * @param {String} error Error message, if any. * @param {module:model/Data} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Delete data by id * Delete data generated by job by data id * @param {String} id * @param {module:api/DataApi~dataIdDeleteCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Data} */ dataIdDelete(id, callback) { let postBody = null; // verify the required parameter 'id' is set if (id === undefined || id === null) { throw new Error("Missing the required parameter 'id' when calling dataIdDelete"); } let pathParams = { 'id': id }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = ['key']; let contentTypes = []; let accepts = ['application/json', 'application/octet-stream']; let returnType = Data; return this.apiClient.callApi( '/data/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback ); } /** * Callback function to receive the result of the dataJobIdGet operation. * @callback module:api/DataApi~dataJobIdGetCallback * @param {String} error Error message, if any. * @param {Array.<module:model/Data>} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Get data by job id * Get data generated by a job (it receives on the url the job id) * @param {String} id * @param {module:api/DataApi~dataJobIdGetCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Array.<module:model/Data>} */ dataJobIdGet(id, callback) { let postBody = null; // verify the required parameter 'id' is set if (id === undefined || id === null) { throw new Error("Missing the required parameter 'id' when calling dataJobIdGet"); } let pathParams = { 'id': id }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = ['key']; let contentTypes = []; let accepts = ['application/json', 'application/octet-stream']; let returnType = [Data]; return this.apiClient.callApi( '/data/job/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback ); } /** * Callback function to receive the result of the dataUserIdPost operation. * @callback module:api/DataApi~dataUserIdPostCallback * @param {String} error Error message, if any. * @param {module:model/Data} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * WebHook to get data when done scraped by user id * Subscribe to this webhook service to get done data related to a user id (so it'll watch all data status and send done when it's scraped) * @param {String} id * @param {module:api/DataApi~dataUserIdPostCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Data} */ dataUserIdPost(id, callback) { let postBody = null; // verify the required parameter 'id' is set if (id === undefined || id === null) { throw new Error("Missing the required parameter 'id' when calling dataUserIdPost"); } let pathParams = { 'id': id }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = ['key']; let contentTypes = []; let accepts = ['application/json', 'application/octet-stream']; let returnType = Data; return this.apiClient.callApi( '/data/user/{id}', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback ); } }