export type DeleteApiApiAdminContextContextFieldLegalValuesLegalValueArgs = {contextField: string, legalValue: string}; export type DeleteApiApiAdminContextContextFieldLegalValuesLegalValueOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete legal value for the context field * * DELETE /api/admin/context/{contextField}/legal-values/{legalValue} * * Also accepts auth: bearerToken */ export const deleteApiApiAdminContextContextFieldLegalValuesLegalValue = async (args: DeleteApiApiAdminContextContextFieldLegalValuesLegalValueArgs, options?: DeleteApiApiAdminContextContextFieldLegalValuesLegalValueOptions) => { const {baseUrl = "https://app.unleash-instance.example.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/admin/context/${encodeURIComponent(String(args.contextField))}/legal-values/${encodeURIComponent(String(args.legalValue))}${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 };