export type DeleteApiV1PersonsPersonIdFlagsFlagIdArgs = {'Customer-Id': number, personId: string, flagId: number}; export type DeleteApiV1PersonsPersonIdFlagsFlagIdOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove a flag from a person * * DELETE /v1/persons/{personId}/flags/{flagId} */ export const deleteApiV1PersonsPersonIdFlagsFlagId = async (args: DeleteApiV1PersonsPersonIdFlagsFlagIdArgs, options?: DeleteApiV1PersonsPersonIdFlagsFlagIdOptions) => { const {baseUrl = "https://api.bigchange.com", fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Customer-Id'] != null) headers.set("Customer-Id", String(args['Customer-Id'])) if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/persons/${encodeURIComponent(String(args.personId))}/flags/${encodeURIComponent(String(args.flagId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };