export type FnolPatchRequest = {setData: {[key: string]: Record}, removeData: {[key: string]: Record}, incidentTime?: string | undefined, incidentTimezone?: string | undefined, incidentSummary?: string | undefined, region?: string | undefined, accountLocator?: unknown | undefined, policyLocator?: unknown | undefined}; export type PatchApiClaimTenantLocatorFnolsLocatorArgs = {tenantLocator: string, locator: unknown, body: FnolPatchRequest}; export type PatchApiClaimTenantLocatorFnolsLocatorOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PATCH /claim/{tenantLocator}/fnols/{locator} */ export const patchApiClaimTenantLocatorFnolsLocator = async (args: PatchApiClaimTenantLocatorFnolsLocatorArgs, options: PatchApiClaimTenantLocatorFnolsLocatorOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/claim/${encodeURIComponent(String(args.tenantLocator))}/fnols/${encodeURIComponent(String(args.locator))}${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() };