export type DeleteApiApiV1SocketsSocketIdWebhooksWebhookIdArgs = {socket_id: string, webhook_id: string}; export type DeleteApiApiV1SocketsSocketIdWebhooksWebhookIdOptions = {baseUrl: string, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete webhook * * DELETE /api/v1/sockets/{socket_id}/webhooks/{webhook_id} */ export const deleteApiApiV1SocketsSocketIdWebhooksWebhookId = async (args: DeleteApiApiV1SocketsSocketIdWebhooksWebhookIdArgs, options: DeleteApiApiV1SocketsSocketIdWebhooksWebhookIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/sockets/${encodeURIComponent(String(args.socket_id))}/webhooks/${encodeURIComponent(String(args.webhook_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 };