export type PatchApiEventTenantLocatorWebhooksWebhookLocatorUnsuspendArgs = {tenantLocator: string, webhookLocator: unknown}; export type PatchApiEventTenantLocatorWebhooksWebhookLocatorUnsuspendOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PATCH /event/{tenantLocator}/webhooks/{webhookLocator}/unsuspend */ export const patchApiEventTenantLocatorWebhooksWebhookLocatorUnsuspend = async (args: PatchApiEventTenantLocatorWebhooksWebhookLocatorUnsuspendArgs, options: PatchApiEventTenantLocatorWebhooksWebhookLocatorUnsuspendOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/event/${encodeURIComponent(String(args.tenantLocator))}/webhooks/${encodeURIComponent(String(args.webhookLocator))}/unsuspend${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };