import { z } from 'zod'; import { Environment } from '../../http/environment.js'; import { ThrowableError } from '../../http/errors/throwable-error.js'; import { SerializationStyle } from '../../http/serialization/base-serializer.js'; import { RequestBuilder } from '../../http/transport/request-builder.js'; import { ContentType, HttpResponse, RequestConfig } from '../../http/types.js'; import { BaseService } from '../base-service.js'; import { ApnsConfigCollection, apnsConfigCollectionResponse } from './models/apns-config-collection.js'; import { ApnsConfigPayload, apnsConfigPayloadRequest, apnsConfigPayloadResponse, } from './models/apns-config-payload.js'; import { EventSourceConfigCollection, eventSourceConfigCollectionResponse, } from './models/event-source-config-collection.js'; import { EventSourceConfigPayload, eventSourceConfigPayloadRequest, eventSourceConfigPayloadResponse, } from './models/event-source-config-payload.js'; import { ExpoConfigCollection, expoConfigCollectionResponse } from './models/expo-config-collection.js'; import { ExpoConfigPayload, expoConfigPayloadRequest, expoConfigPayloadResponse, } from './models/expo-config-payload.js'; import { FcmConfigCollection, fcmConfigCollectionResponse } from './models/fcm-config-collection.js'; import { FcmConfigPayload, fcmConfigPayloadRequest, fcmConfigPayloadResponse } from './models/fcm-config-payload.js'; import { GithubConfigCollection, githubConfigCollectionResponse } from './models/github-config-collection.js'; import { GithubConfigPayload, githubConfigPayloadRequest, githubConfigPayloadResponse, } from './models/github-config-payload.js'; import { InboxConfigCollection, inboxConfigCollectionResponse } from './models/inbox-config-collection.js'; import { InboxConfigPayload, inboxConfigPayloadRequest, inboxConfigPayloadResponse, } from './models/inbox-config-payload.js'; import { IntegrationConfigCollection, integrationConfigCollectionResponse, } from './models/integration-config-collection.js'; import { MailgunConfigCollection, mailgunConfigCollectionResponse } from './models/mailgun-config-collection.js'; import { MailgunConfigPayload, mailgunConfigPayloadRequest, mailgunConfigPayloadResponse, } from './models/mailgun-config-payload.js'; import { PingConfigCollection, pingConfigCollectionResponse } from './models/ping-config-collection.js'; import { PingConfigPayload, pingConfigPayloadRequest, pingConfigPayloadResponse, } from './models/ping-config-payload.js'; import { SendgridConfigCollection, sendgridConfigCollectionResponse } from './models/sendgrid-config-collection.js'; import { SendgridConfigPayload, sendgridConfigPayloadRequest, sendgridConfigPayloadResponse, } from './models/sendgrid-config-payload.js'; import { SesConfigCollection, sesConfigCollectionResponse } from './models/ses-config-collection.js'; import { SesConfigPayload, sesConfigPayloadRequest, sesConfigPayloadResponse } from './models/ses-config-payload.js'; import { SlackBotConfigCollection, slackBotConfigCollectionResponse } from './models/slack-bot-config-collection.js'; import { SlackBotConfigPayload, slackBotConfigPayloadRequest, slackBotConfigPayloadResponse, } from './models/slack-bot-config-payload.js'; import { SlackConfigCollection, slackConfigCollectionResponse } from './models/slack-config-collection.js'; import { SlackConfigPayload, slackConfigPayloadRequest, slackConfigPayloadResponse, } from './models/slack-config-payload.js'; import { SmtpConfig, smtpConfigRequest, smtpConfigResponse } from './models/smtp-config.js'; import { SmtpConfigObjectCollection, smtpConfigObjectCollectionResponse, } from './models/smtp-config-object-collection.js'; import { StripeConfigCollection, stripeConfigCollectionResponse } from './models/stripe-config-collection.js'; import { StripeConfigPayload, stripeConfigPayloadRequest, stripeConfigPayloadResponse, } from './models/stripe-config-payload.js'; import { TwilioConfigCollection, twilioConfigCollectionResponse } from './models/twilio-config-collection.js'; import { TwilioConfigPayload, twilioConfigPayloadRequest, twilioConfigPayloadResponse, } from './models/twilio-config-payload.js'; import { WebpushConfigCollection, webpushConfigCollectionResponse } from './models/webpush-config-collection.js'; import { WebpushConfigPayload, webpushConfigPayloadRequest, webpushConfigPayloadResponse, } from './models/webpush-config-payload.js'; import { DeleteApnsIntegrationParams, DeleteEventsourceIntegrationParams, DeleteExpoIntegrationParams, DeleteFcmIntegrationParams, DeleteGithubIntegrationParams, DeleteInboxIntegrationParams, DeleteMagicbellSlackbotIntegrationParams, DeleteMailgunIntegrationParams, DeletePingEmailIntegrationParams, DeleteSendgridIntegrationParams, DeleteSesIntegrationParams, DeleteSlackIntegrationParams, DeleteSmtpIntegrationParams, DeleteStripeIntegrationParams, DeleteTwilioIntegrationParams, DeleteWebPushIntegrationParams, ListIntegrationsParams, } from './request-params.js'; /** * Service class for IntegrationsService operations. * Provides methods to interact with IntegrationsService-related API endpoints. * All methods return promises and handle request/response serialization automatically. */ export class IntegrationsService extends BaseService { /** * Lists all available and configured integrations for the project. Returns a summary of each integration including its type, status, and basic configuration information. * @param {number} [params.limit] - defines the maximum number of items to return per page (default: 50) * @param {string} [params.startingAfter] - a cursor for use in pagination, points to the last ID in previous page * @param {string} [params.endingBefore] - a cursor for use in pagination, points to the first ID in next page * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listIntegrations( params?: ListIntegrationsParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: integrationConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'limit', value: params?.limit, }) .addQueryParam({ key: 'starting_after', value: params?.startingAfter, }) .addQueryParam({ key: 'ending_before', value: params?.endingBefore, }) .build(); return this.client.call(request); } /** * Retrieves the current APNs integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listApnsIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/apns') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: apnsConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the APNs integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveApnsIntegration( body: ApnsConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/apns') .setRequestSchema(apnsConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: apnsConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the APNs integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteApnsIntegration( params?: DeleteApnsIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/apns') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current EventSource integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listEventsourceIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/eventsource') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: eventSourceConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the EventSource integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveEventsourceIntegration( body: EventSourceConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/eventsource') .setRequestSchema(eventSourceConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: eventSourceConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the EventSource integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteEventsourceIntegration( params?: DeleteEventsourceIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/eventsource') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current Expo integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listExpoIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/expo') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: expoConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the Expo integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveExpoIntegration( body: ExpoConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/expo') .setRequestSchema(expoConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: expoConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the Expo integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteExpoIntegration( params?: DeleteExpoIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/expo') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current FCM integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listFcmIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/fcm') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: fcmConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the FCM integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveFcmIntegration( body: FcmConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/fcm') .setRequestSchema(fcmConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: fcmConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the FCM integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteFcmIntegration( params?: DeleteFcmIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/fcm') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current GitHub integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listGithubIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/github') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: githubConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the GitHub integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveGithubIntegration( body: GithubConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/github') .setRequestSchema(githubConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: githubConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the GitHub integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteGithubIntegration( params?: DeleteGithubIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/github') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current Inbox integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listInboxIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/inbox') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: inboxConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the Inbox integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveInboxIntegration( body: InboxConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/inbox') .setRequestSchema(inboxConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: inboxConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the Inbox integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteInboxIntegration( params?: DeleteInboxIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/inbox') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current MagicBell SlackBot integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listMagicbellSlackbotIntegrations( requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/magicbell_slackbot') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: slackBotConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the MagicBell SlackBot integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveMagicbellSlackbotIntegration( body: SlackBotConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/magicbell_slackbot') .setRequestSchema(slackBotConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: slackBotConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the MagicBell SlackBot integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteMagicbellSlackbotIntegration( params?: DeleteMagicbellSlackbotIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/magicbell_slackbot') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current Mailgun integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listMailgunIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/mailgun') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: mailgunConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the Mailgun integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveMailgunIntegration( body: MailgunConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/mailgun') .setRequestSchema(mailgunConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: mailgunConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the Mailgun integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteMailgunIntegration( params?: DeleteMailgunIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/mailgun') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current Ping Email integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listPingEmailIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/ping_email') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: pingConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the Ping Email integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async savePingEmailIntegration( body: PingConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/ping_email') .setRequestSchema(pingConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: pingConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the Ping Email integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deletePingEmailIntegration( params?: DeletePingEmailIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/ping_email') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current SendGrid integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listSendgridIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/sendgrid') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: sendgridConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the SendGrid integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveSendgridIntegration( body: SendgridConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/sendgrid') .setRequestSchema(sendgridConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: sendgridConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the SendGrid integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteSendgridIntegration( params?: DeleteSendgridIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/sendgrid') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current Amazon SES integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listSesIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/ses') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: sesConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the Amazon SES integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveSesIntegration( body: SesConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/ses') .setRequestSchema(sesConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: sesConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the Amazon SES integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteSesIntegration( params?: DeleteSesIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/ses') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current Slack integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listSlackIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/slack') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: slackConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the Slack integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveSlackIntegration( body: SlackConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/slack') .setRequestSchema(slackConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: slackConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the Slack integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteSlackIntegration( params?: DeleteSlackIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/slack') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current SMTP integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listSmtpIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/smtp') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: smtpConfigObjectCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the SMTP integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveSmtpIntegration(body: SmtpConfig, requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/smtp') .setRequestSchema(smtpConfigRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: smtpConfigResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the SMTP integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteSmtpIntegration( params?: DeleteSmtpIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/smtp') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current Stripe integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listStripeIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/stripe') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: stripeConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the Stripe integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveStripeIntegration( body: StripeConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/stripe') .setRequestSchema(stripeConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: stripeConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the Stripe integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteStripeIntegration( params?: DeleteStripeIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/stripe') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current Twilio integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listTwilioIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/twilio') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: twilioConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the Twilio integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveTwilioIntegration( body: TwilioConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/twilio') .setRequestSchema(twilioConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: twilioConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the Twilio integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteTwilioIntegration( params?: DeleteTwilioIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/twilio') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } /** * Retrieves the current Web Push integration configurations for a specific integration type in the project. Returns configuration details and status information. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async listWebPushIntegrations(requestConfig?: RequestConfig): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('GET') .setPath('/integrations/web_push') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: webpushConfigCollectionResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .build(); return this.client.call(request); } /** * Updates or creates the Web Push integration for the project. * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - OK */ async saveWebPushIntegration( body: WebpushConfigPayload, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('PUT') .setPath('/integrations/web_push') .setRequestSchema(webpushConfigPayloadRequest) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: webpushConfigPayloadResponse, contentType: ContentType.Json, status: 200, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addHeaderParam({ key: 'Content-Type', value: 'application/json' }) .addBody(body) .build(); return this.client.call(request); } /** * Deletes the Web Push integration configuration from the project. This will disable the integration's functionality within the project. * @param {string} [params.id] - the unique identifier of the integration to be deleted * @param {RequestConfig} [requestConfig] - The request configuration for retry and validation. * @returns {Promise>} - No Content */ async deleteWebPushIntegration( params?: DeleteWebPushIntegrationParams, requestConfig?: RequestConfig, ): Promise> { const request = new RequestBuilder() .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT) .setConfig(this.config) .setMethod('DELETE') .setPath('/integrations/web_push') .setRequestSchema(z.any()) .addAccessTokenAuth(this.config.token, 'Bearer') .setRequestContentType(ContentType.Json) .addResponse({ schema: z.undefined(), contentType: ContentType.NoContent, status: 204, }) .setRetryAttempts(this.config, requestConfig) .setRetryDelayMs(this.config, requestConfig) .setResponseValidation(this.config, requestConfig) .addQueryParam({ key: 'id', value: params?.id, }) .build(); return this.client.call(request); } }