export type DeleteApiGroupsGroupIdAppsAppIdServicesServiceIdIncomingWebhooksIncomingWebhookIdOptions = {baseUrl?: string | undefined, tokenAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a webhook * * DELETE /groups/{groupId}/apps/{appId}/services/{serviceId}/incoming_webhooks/{incomingWebhookId} */ export const deleteApiGroupsGroupIdAppsAppIdServicesServiceIdIncomingWebhooksIncomingWebhookId = async (options?: DeleteApiGroupsGroupIdAppsAppIdServicesServiceIdIncomingWebhooksIncomingWebhookIdOptions) => { const {baseUrl = "https://services.cloud.mongodb.com/api/admin/v3.0", fetch: fetchFn = fetch, tokenAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (tokenAuth !== undefined) headers.set('authorization', `Bearer ${tokenAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/groups/${encodeURIComponent(String(args.groupId))}/apps/${encodeURIComponent(String(args.appId))}/services/${encodeURIComponent(String(args.serviceId))}/incoming_webhooks/${encodeURIComponent(String(args.incomingWebhookId))}${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 };