/* tslint:disable */ /* eslint-disable */ /** * notificationsettings/webhook * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded, } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap, } from '../base'; // @ts-ignore import type { ErrorResponse } from '../models'; // @ts-ignore import type { WebhookNotificationSettings } from '../models'; /** * NotificationSettingsApi - axios parameter creator */ export const NotificationSettingsApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * This endpoint retrieves the current notification settings for webhooks, indicating whether they are enabled or disabled for the specific tenant. * @summary Get the webhook notification settings * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhookNotificationSettings: async ( options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/notificationsettings/webhook`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This endpoint updates the state of the webhook notification settings to either ENABLED or DISABLED. * @summary Update the webhook notification settings * @param {WebhookNotificationSettings} webhookNotificationSettings Represents the webhook notification settings to be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateWebhookNotificationSettings: async ( webhookNotificationSettings: WebhookNotificationSettings, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'webhookNotificationSettings' is not null or undefined assertParamExists( 'updateWebhookNotificationSettings', 'webhookNotificationSettings', webhookNotificationSettings, ); const localVarPath = `/notificationsettings/webhook`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( webhookNotificationSettings, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * NotificationSettingsApi - functional programming interface */ export const NotificationSettingsApiFp = function ( configuration?: Configuration, ) { const localVarAxiosParamCreator = NotificationSettingsApiAxiosParamCreator(configuration); return { /** * This endpoint retrieves the current notification settings for webhooks, indicating whether they are enabled or disabled for the specific tenant. * @summary Get the webhook notification settings * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getWebhookNotificationSettings( options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getWebhookNotificationSettings(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap[ 'NotificationSettingsApi.getWebhookNotificationSettings' ]?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * This endpoint updates the state of the webhook notification settings to either ENABLED or DISABLED. * @summary Update the webhook notification settings * @param {WebhookNotificationSettings} webhookNotificationSettings Represents the webhook notification settings to be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateWebhookNotificationSettings( webhookNotificationSettings: WebhookNotificationSettings, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhookNotificationSettings( webhookNotificationSettings, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap[ 'NotificationSettingsApi.updateWebhookNotificationSettings' ]?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * NotificationSettingsApi - factory interface */ export const NotificationSettingsApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = NotificationSettingsApiFp(configuration); return { /** * This endpoint retrieves the current notification settings for webhooks, indicating whether they are enabled or disabled for the specific tenant. * @summary Get the webhook notification settings * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhookNotificationSettings( options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getWebhookNotificationSettings(options) .then((request) => request(axios, basePath)); }, /** * This endpoint updates the state of the webhook notification settings to either ENABLED or DISABLED. * @summary Update the webhook notification settings * @param {WebhookNotificationSettings} webhookNotificationSettings Represents the webhook notification settings to be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateWebhookNotificationSettings( webhookNotificationSettings: WebhookNotificationSettings, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .updateWebhookNotificationSettings(webhookNotificationSettings, options) .then((request) => request(axios, basePath)); }, }; }; /** * NotificationSettingsApi - object-oriented interface */ export class NotificationSettingsApi extends BaseAPI { /** * This endpoint retrieves the current notification settings for webhooks, indicating whether they are enabled or disabled for the specific tenant. * @summary Get the webhook notification settings * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getWebhookNotificationSettings(options?: RawAxiosRequestConfig) { return NotificationSettingsApiFp(this.configuration) .getWebhookNotificationSettings(options) .then((request) => request(this.axios, this.basePath)); } /** * This endpoint updates the state of the webhook notification settings to either ENABLED or DISABLED. * @summary Update the webhook notification settings * @param {WebhookNotificationSettings} webhookNotificationSettings Represents the webhook notification settings to be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public updateWebhookNotificationSettings( webhookNotificationSettings: WebhookNotificationSettings, options?: RawAxiosRequestConfig, ) { return NotificationSettingsApiFp(this.configuration) .updateWebhookNotificationSettings(webhookNotificationSettings, options) .then((request) => request(this.axios, this.basePath)); } }