export type IdentityEntityIdRequest = {disabled?: boolean | undefined, metadata?: Record | undefined, name?: string | undefined, policies?: Array | undefined}; export type CreateApiIdentityEntityIdIdArgs = {body: IdentityEntityIdRequest}; export type CreateApiIdentityEntityIdIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Update, read or delete an entity using entity ID * * POST /identity/entity/id/{id} */ export const createApiIdentityEntityIdId = async (args: CreateApiIdentityEntityIdIdArgs, options: CreateApiIdentityEntityIdIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/identity/entity/id/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };