export type SetDenylistRequestBody = {denied?: boolean | undefined}; export type UpdateApiV1UsersDenylistIdentifyIdArgs = {identifyId: string, body: SetDenylistRequestBody}; export type UpdateApiV1UsersDenylistIdentifyIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update user Denylist flag * * PUT /v1/users/denylist/{identifyId} */ export const updateApiV1UsersDenylistIdentifyId = async (args: UpdateApiV1UsersDenylistIdentifyIdArgs, options?: UpdateApiV1UsersDenylistIdentifyIdOptions) => { const {baseUrl = "https://app.aptrinsic.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/users/denylist/${encodeURIComponent(String(args.identifyId))}${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 };