export type IdentityLookupEntityRequest = {alias_id?: string | undefined, alias_mount_accessor?: string | undefined, alias_name?: string | undefined, id?: string | undefined, name?: string | undefined}; export type CreateApiIdentityLookupEntityArgs = {body: IdentityLookupEntityRequest}; export type CreateApiIdentityLookupEntityOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Query entities based on various properties. * * POST /identity/lookup/entity */ export const createApiIdentityLookupEntity = async (args: CreateApiIdentityLookupEntityArgs, options: CreateApiIdentityLookupEntityOptions) => { 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/lookup/entity${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 };