export type DeleteApiApiVVersionWebhooksEndpointsEndpointIdArgs = {version: string, endpointId: string, 'X-Tenant': string}; export type DeleteApiApiVVersionWebhooksEndpointsEndpointIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a webhook endpoint * * DELETE /api/v{version}/webhooks/endpoints/{endpointId} */ export const deleteApiApiVVersionWebhooksEndpointsEndpointId = async (args: DeleteApiApiVVersionWebhooksEndpointsEndpointIdArgs, options?: DeleteApiApiVVersionWebhooksEndpointsEndpointIdOptions) => { const {baseUrl = "https://api.zrexpress.app", fetch: fetchFn = fetch, bearerAuth, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Tenant'] != null) headers.set("X-Tenant", String(args['X-Tenant'])) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) if (apiKey !== undefined) headers.set("X-Api-Key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v${encodeURIComponent(String(args.version))}/webhooks/endpoints/${encodeURIComponent(String(args.endpointId))}${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 };