@neynar/nodejs-sdk
Version:
SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)
555 lines (554 loc) • 31 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Neynar API
* The Neynar API allows you to interact with the Farcaster protocol among other things. See the [Neynar docs](https://docs.neynar.com/reference) for more details.
*
* The version of the OpenAPI document: 3.115.0
* Contact: team@neynar.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebhookApi = exports.WebhookApiFactory = exports.WebhookApiFp = exports.WebhookApiAxiosParamCreator = void 0;
const axios_1 = __importDefault(require("axios"));
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("../common");
// @ts-ignore
const base_1 = require("../base");
/**
* WebhookApi - axios parameter creator
* @export
*/
const WebhookApiAxiosParamCreator = function (configuration) {
return {
/**
* Delete a webhook
* @summary Delete a webhook
* @param {WebhookDeleteReqBody} webhookDeleteReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-webhook)
*
*/
deleteWebhook: async (webhookDeleteReqBody, options = {}) => {
// verify required parameter 'webhookDeleteReqBody' is not null or undefined
(0, common_1.assertParamExists)('deleteWebhook', 'webhookDeleteReqBody', webhookDeleteReqBody);
const localVarPath = `/v2/farcaster/webhook/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(webhookDeleteReqBody, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Fetch a list of webhooks associated to a user
* @summary Associated webhooks of user
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookListResponse>} A promise that resolves to a `WebhookListResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-webhooks)
*
*/
fetchWebhooks: async (options = {}) => {
const localVarPath = `/v2/farcaster/webhook/list/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Fetch a webhook
* @summary Fetch a webhook
* @param {string} webhookId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-webhook)
*
*/
lookupWebhook: async (webhookId, options = {}) => {
// verify required parameter 'webhookId' is not null or undefined
(0, common_1.assertParamExists)('lookupWebhook', 'webhookId', webhookId);
const localVarPath = `/v2/farcaster/webhook/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration);
if (webhookId !== undefined) {
localVarQueryParameter['webhook_id'] = webhookId;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Create a webhook
* @summary Create a webhook
* @param {WebhookPostReqBody} webhookPostReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-webhook)
*
*/
publishWebhook: async (webhookPostReqBody, options = {}) => {
// verify required parameter 'webhookPostReqBody' is not null or undefined
(0, common_1.assertParamExists)('publishWebhook', 'webhookPostReqBody', webhookPostReqBody);
const localVarPath = `/v2/farcaster/webhook/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(webhookPostReqBody, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Update a webhook
* @summary Update a webhook
* @param {WebhookPutReqBody} webhookPutReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook)
*
*/
updateWebhook: async (webhookPutReqBody, options = {}) => {
// verify required parameter 'webhookPutReqBody' is not null or undefined
(0, common_1.assertParamExists)('updateWebhook', 'webhookPutReqBody', webhookPutReqBody);
const localVarPath = `/v2/farcaster/webhook/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(webhookPutReqBody, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Update webhook active status
* @summary Update webhook status
* @param {WebhookPatchReqBody} webhookPatchReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook-active-status)
*
*/
updateWebhookActiveStatus: async (webhookPatchReqBody, options = {}) => {
// verify required parameter 'webhookPatchReqBody' is not null or undefined
(0, common_1.assertParamExists)('updateWebhookActiveStatus', 'webhookPatchReqBody', webhookPatchReqBody);
const localVarPath = `/v2/farcaster/webhook/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(webhookPatchReqBody, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.WebhookApiAxiosParamCreator = WebhookApiAxiosParamCreator;
/**
* WebhookApi - functional programming interface
* @export
*/
const WebhookApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.WebhookApiAxiosParamCreator)(configuration);
return {
/**
* Delete a webhook
* @summary Delete a webhook
* @param {WebhookDeleteReqBody} webhookDeleteReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-webhook)
*
*/
async deleteWebhook(webhookDeleteReqBody, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteWebhook(webhookDeleteReqBody, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['WebhookApi.deleteWebhook']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Fetch a list of webhooks associated to a user
* @summary Associated webhooks of user
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookListResponse>} A promise that resolves to a `WebhookListResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-webhooks)
*
*/
async fetchWebhooks(options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.fetchWebhooks(options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['WebhookApi.fetchWebhooks']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Fetch a webhook
* @summary Fetch a webhook
* @param {string} webhookId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-webhook)
*
*/
async lookupWebhook(webhookId, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.lookupWebhook(webhookId, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['WebhookApi.lookupWebhook']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Create a webhook
* @summary Create a webhook
* @param {WebhookPostReqBody} webhookPostReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-webhook)
*
*/
async publishWebhook(webhookPostReqBody, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.publishWebhook(webhookPostReqBody, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['WebhookApi.publishWebhook']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Update a webhook
* @summary Update a webhook
* @param {WebhookPutReqBody} webhookPutReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook)
*
*/
async updateWebhook(webhookPutReqBody, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhook(webhookPutReqBody, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['WebhookApi.updateWebhook']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Update webhook active status
* @summary Update webhook status
* @param {WebhookPatchReqBody} webhookPatchReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook-active-status)
*
*/
async updateWebhookActiveStatus(webhookPatchReqBody, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhookActiveStatus(webhookPatchReqBody, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['WebhookApi.updateWebhookActiveStatus']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
};
};
exports.WebhookApiFp = WebhookApiFp;
/**
* WebhookApi - factory interface
* @export
*/
const WebhookApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.WebhookApiFp)(configuration);
return {
/**
* Delete a webhook
* @summary Delete a webhook
* @param {WebhookApiDeleteWebhookRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-webhook)
*
*/
deleteWebhook(requestParameters, options) {
return localVarFp.deleteWebhook(requestParameters.webhookDeleteReqBody, options).then((request) => request(axios, basePath));
},
/**
* Fetch a list of webhooks associated to a user
* @summary Associated webhooks of user
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookListResponse>} A promise that resolves to a `WebhookListResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-webhooks)
*
*/
fetchWebhooks(options) {
return localVarFp.fetchWebhooks(options).then((request) => request(axios, basePath));
},
/**
* Fetch a webhook
* @summary Fetch a webhook
* @param {WebhookApiLookupWebhookRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-webhook)
*
*/
lookupWebhook(requestParameters, options) {
return localVarFp.lookupWebhook(requestParameters.webhookId, options).then((request) => request(axios, basePath));
},
/**
* Create a webhook
* @summary Create a webhook
* @param {WebhookApiPublishWebhookRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-webhook)
*
*/
publishWebhook(requestParameters, options) {
return localVarFp.publishWebhook(requestParameters.webhookPostReqBody, options).then((request) => request(axios, basePath));
},
/**
* Update a webhook
* @summary Update a webhook
* @param {WebhookApiUpdateWebhookRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook)
*
*/
updateWebhook(requestParameters, options) {
return localVarFp.updateWebhook(requestParameters.webhookPutReqBody, options).then((request) => request(axios, basePath));
},
/**
* Update webhook active status
* @summary Update webhook status
* @param {WebhookApiUpdateWebhookActiveStatusRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook-active-status)
*
*/
updateWebhookActiveStatus(requestParameters, options) {
return localVarFp.updateWebhookActiveStatus(requestParameters.webhookPatchReqBody, options).then((request) => request(axios, basePath));
},
};
};
exports.WebhookApiFactory = WebhookApiFactory;
/**
* WebhookApi - object-oriented interface
* @export
* @class WebhookApi
* @extends {BaseAPI}
*/
class WebhookApi extends base_1.BaseAPI {
/**
* Delete a webhook
* @summary Delete a webhook
* @param {WebhookApiDeleteWebhookRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof WebhookApi
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-webhook)
*
*/
deleteWebhook(requestParameters, options) {
return (0, exports.WebhookApiFp)(this.configuration).deleteWebhook(requestParameters.webhookDeleteReqBody, options).then((request) => request(this.axios, this.basePath));
}
/**
* Fetch a list of webhooks associated to a user
* @summary Associated webhooks of user
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof WebhookApi
* @returns {Promise<WebhookListResponse>} A promise that resolves to a `WebhookListResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-webhooks)
*
*/
fetchWebhooks(options) {
return (0, exports.WebhookApiFp)(this.configuration).fetchWebhooks(options).then((request) => request(this.axios, this.basePath));
}
/**
* Fetch a webhook
* @summary Fetch a webhook
* @param {WebhookApiLookupWebhookRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof WebhookApi
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-webhook)
*
*/
lookupWebhook(requestParameters, options) {
return (0, exports.WebhookApiFp)(this.configuration).lookupWebhook(requestParameters.webhookId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Create a webhook
* @summary Create a webhook
* @param {WebhookApiPublishWebhookRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof WebhookApi
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-webhook)
*
*/
publishWebhook(requestParameters, options) {
return (0, exports.WebhookApiFp)(this.configuration).publishWebhook(requestParameters.webhookPostReqBody, options).then((request) => request(this.axios, this.basePath));
}
/**
* Update a webhook
* @summary Update a webhook
* @param {WebhookApiUpdateWebhookRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof WebhookApi
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook)
*
*/
updateWebhook(requestParameters, options) {
return (0, exports.WebhookApiFp)(this.configuration).updateWebhook(requestParameters.webhookPutReqBody, options).then((request) => request(this.axios, this.basePath));
}
/**
* Update webhook active status
* @summary Update webhook status
* @param {WebhookApiUpdateWebhookActiveStatusRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof WebhookApi
* @returns {Promise<WebhookResponse>} A promise that resolves to a `WebhookResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/update-webhook-active-status)
*
*/
updateWebhookActiveStatus(requestParameters, options) {
return (0, exports.WebhookApiFp)(this.configuration).updateWebhookActiveStatus(requestParameters.webhookPatchReqBody, options).then((request) => request(this.axios, this.basePath));
}
}
exports.WebhookApi = WebhookApi;