export type DeleteApiApiV1NotificationsChannelsChannelIdArgs = {channel_id: string, 'unstructured-api-key'?: (string | null) | undefined}; export type DeleteApiApiV1NotificationsChannelsChannelIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete Channel * * DELETE /api/v1/notifications/channels/{channel_id} */ export const deleteApiApiV1NotificationsChannelsChannelId = async (args: DeleteApiApiV1NotificationsChannelsChannelIdArgs, options: DeleteApiApiV1NotificationsChannelsChannelIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['unstructured-api-key'] != null) headers.set("unstructured-api-key", String(args['unstructured-api-key'])) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/notifications/channels/${encodeURIComponent(String(args.channel_id))}${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 };