export type WebhookProfileUpdateRequest = {eventTypes?: (Array<'TRANSACTION_CRYPTO_PENDING' | 'TRANSACTION_CRYPTO_FAILED' | 'TRANSACTION_CRYPTO_TRANSFERRING' | 'TRANSACTION_CRYPTO_COMPLETE' | 'TRANSACTION_FIAT_CREATED' | 'TRANSACTION_FIAT_UPDATED' | 'BANK_LINKING_CONNECTION_COMPLETED' | 'BANK_LINKING_CONNECTION_DELETED' | 'BANK_LINKING_CONNECTION_STATUS_CHANGE' | 'BANK_LINKING_ACCOUNTS_ADDED' | 'BANK_LINKING_ACCOUNTS_UPDATING' | 'BANK_LINKING_ACCOUNTS_UPDATED' | 'BANK_LINKING_ACCOUNTS_REMOVED' | 'BANK_LINKING_TRANSACTIONS_AGGREGATED' | 'BANK_LINKING_HISTORICAL_TRANSACTIONS_AGGREGATED' | 'BANK_LINKING_NEW_ACCOUNTS_AVAILABLE' | 'CUSTOMER_KYC_STATUS_CHANGE' | 'TEST' | 'WEBHOOK_TEST'>) | undefined, eventVersion?: string | undefined, name?: string | undefined, status?: ('ACTIVE' | 'DISABLED') | undefined, url?: string | undefined}; export type PatchApiNotificationsWebhooksWebhookProfileIdArgs = {webhookProfileId: string, body: WebhookProfileUpdateRequest}; export type PatchApiNotificationsWebhooksWebhookProfileIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an existing webhook profile * * PATCH /notifications/webhooks/{webhookProfileId} */ export const patchApiNotificationsWebhooksWebhookProfileId = async (args: PatchApiNotificationsWebhooksWebhookProfileIdArgs, options?: PatchApiNotificationsWebhooksWebhookProfileIdOptions) => { const {baseUrl = "https://api-sb.meld.io", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (ApiKeyAuth !== undefined) headers.set("Authorization", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/notifications/webhooks/${encodeURIComponent(String(args.webhookProfileId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };