export type CustomerId = string; export type VendorInfo5 = {content_type: 'application/json', json: Record, vendor: string} | {content_type: 'text/xml', vendor: string, xml: string}; export type WatchlistAlert = {created?: string | undefined, id?: string | undefined, provider_info?: Record | undefined, provider_subject_id?: string | undefined, provider_subscription_id?: string | undefined, provider_watchlist_name?: string | undefined, status: 'ACTIVE' | 'SUPPRESSED', urls?: Array | undefined, vendor_info?: VendorInfo5 | undefined}; export type UpdateApiCustomersCustomerIdWatchlistsAlertsAlertIdArgs = {alert_id: string, customer_id: CustomerId, body: WatchlistAlert}; export type UpdateApiCustomersCustomerIdWatchlistsAlertsAlertIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update watchlist alert * * PUT /customers/{customer_id}/watchlists/alerts/{alert_id} */ export const updateApiCustomersCustomerIdWatchlistsAlertsAlertId = async (args: UpdateApiCustomersCustomerIdWatchlistsAlertsAlertIdArgs, options?: UpdateApiCustomersCustomerIdWatchlistsAlertsAlertIdOptions) => { const {baseUrl = "https://api-sandbox.synctera.com/v0", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/customers/${encodeURIComponent(String(args.customer_id))}/watchlists/alerts/${encodeURIComponent(String(args.alert_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 undefined };