mirror of https://github.com/vernonkeenan/lib
125 lines
3.8 KiB
JavaScript
125 lines
3.8 KiB
JavaScript
/**
|
|
* board
|
|
* Taxnexus Onboarding Service
|
|
*
|
|
* The version of the OpenAPI document: 0.0.2
|
|
* Contact: noc@taxnexus.net
|
|
*
|
|
* 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 Error from '../model/Error';
|
|
import Lead from '../model/Lead';
|
|
import RuleExecution from '../model/RuleExecution';
|
|
|
|
/**
|
|
* Leads service.
|
|
* @module api/LeadsApi
|
|
* @version 0.0.2
|
|
*/
|
|
export default class LeadsApi {
|
|
|
|
/**
|
|
* Constructs a new LeadsApi.
|
|
* @alias module:api/LeadsApi
|
|
* @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 postLeads operation.
|
|
* @callback module:api/LeadsApi~postLeadsCallback
|
|
* @param {String} error Error message, if any.
|
|
* @param {module:model/RuleExecution} data The data returned by the service call.
|
|
* @param {String} response The complete HTTP response.
|
|
*/
|
|
|
|
/**
|
|
* Add a new Lead record
|
|
* Add a new full Lead Record
|
|
* @param {module:model/Lead} leadRequest A new Lead record as a single JSON object
|
|
* @param {module:api/LeadsApi~postLeadsCallback} callback The callback function, accepting three arguments: error, data, response
|
|
* data is of type: {@link module:model/RuleExecution}
|
|
*/
|
|
postLeads(leadRequest, callback) {
|
|
let postBody = leadRequest;
|
|
// verify the required parameter 'leadRequest' is set
|
|
if (leadRequest === undefined || leadRequest === null) {
|
|
throw new Error("Missing the required parameter 'leadRequest' when calling postLeads");
|
|
}
|
|
|
|
let pathParams = {
|
|
};
|
|
let queryParams = {
|
|
};
|
|
let headerParams = {
|
|
};
|
|
let formParams = {
|
|
};
|
|
|
|
let authNames = ['ApiKeyAuth'];
|
|
let contentTypes = ['application/json'];
|
|
let accepts = ['application/json'];
|
|
let returnType = RuleExecution;
|
|
return this.apiClient.callApi(
|
|
'/leads', 'POST',
|
|
pathParams, queryParams, headerParams, formParams, postBody,
|
|
authNames, contentTypes, accepts, returnType, null, callback
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Callback function to receive the result of the putLeads operation.
|
|
* @callback module:api/LeadsApi~putLeadsCallback
|
|
* @param {String} error Error message, if any.
|
|
* @param {module:model/RuleExecution} data The data returned by the service call.
|
|
* @param {String} response The complete HTTP response.
|
|
*/
|
|
|
|
/**
|
|
* Update Leads
|
|
* Update Lead records
|
|
* @param {module:model/Lead} leadRequest A new Lead record as a single JSON object
|
|
* @param {module:api/LeadsApi~putLeadsCallback} callback The callback function, accepting three arguments: error, data, response
|
|
* data is of type: {@link module:model/RuleExecution}
|
|
*/
|
|
putLeads(leadRequest, callback) {
|
|
let postBody = leadRequest;
|
|
// verify the required parameter 'leadRequest' is set
|
|
if (leadRequest === undefined || leadRequest === null) {
|
|
throw new Error("Missing the required parameter 'leadRequest' when calling putLeads");
|
|
}
|
|
|
|
let pathParams = {
|
|
};
|
|
let queryParams = {
|
|
};
|
|
let headerParams = {
|
|
};
|
|
let formParams = {
|
|
};
|
|
|
|
let authNames = ['ApiKeyAuth'];
|
|
let contentTypes = [];
|
|
let accepts = ['application/json'];
|
|
let returnType = RuleExecution;
|
|
return this.apiClient.callApi(
|
|
'/leads', 'PUT',
|
|
pathParams, queryParams, headerParams, formParams, postBody,
|
|
authNames, contentTypes, accepts, returnType, null, callback
|
|
);
|
|
}
|
|
|
|
|
|
}
|