export type DeleteApiWebhooksGlobalSubscriptionsSubscriptionIdArgs = {subscription_id: string}; export type DeleteApiWebhooksGlobalSubscriptionsSubscriptionIdOptions = {baseUrl?: string | undefined, apiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Global Webhook Subscription * * DELETE /webhooks/global/subscriptions/{subscription_id} */ export const deleteApiWebhooksGlobalSubscriptionsSubscriptionId = async (args: DeleteApiWebhooksGlobalSubscriptionsSubscriptionIdArgs, options?: DeleteApiWebhooksGlobalSubscriptionsSubscriptionIdOptions) => { const {baseUrl = "https://api.meow.com/v1", fetch: fetchFn = fetch, apiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKeyAuth !== undefined) headers.set("x-api-key", apiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/webhooks/global/subscriptions/${encodeURIComponent(String(args.subscription_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 };