export type Terms = {id: string, name: string, documentBase64: string, version?: string | undefined, type?: string | undefined, active: boolean};
export type UpdateApiApiMetadataTermsIdArgs = {id: string, body: Terms};
export type UpdateApiApiMetadataTermsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined};
/**
* Allowed user roles:
Update a terms record for a specific SDZ
*
* PUT /api/metadata/terms/{id}
*/
export const updateApiApiMetadataTermsId = async (args: UpdateApiApiMetadataTermsIdArgs, options?: UpdateApiApiMetadataTermsIdOptions) => {
const {baseUrl = "https://api.burstiq.com", fetch: fetchFn = fetch} = options ?? {}
const query = new URLSearchParams()
const headers = new Headers()
headers.set('content-type', "application/json")
const url = `${baseUrl.replace(/\/+$/, '')}/api/metadata/terms/${encodeURIComponent(String(args.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
};