export type IntegrationType = 'Email' | 'Slack' | 'Teams' | 'Webhook'; export type DeleteApiPublicMonitoringV3IntegrationIntegrationNameArgs = {'integration-name': IntegrationType}; export type DeleteApiPublicMonitoringV3IntegrationIntegrationNameOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Integration * * DELETE /public/monitoring/v3/integration/{integration-name} */ export const deleteApiPublicMonitoringV3IntegrationIntegrationName = async (args: DeleteApiPublicMonitoringV3IntegrationIntegrationNameArgs, options: DeleteApiPublicMonitoringV3IntegrationIntegrationNameOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/public/monitoring/v3/integration/${encodeURIComponent(String(args['integration-name']))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };