export type GetApiApiV1ToolgroupsLayoutIdUserHasLayoutArgs = {layoutId: string, userid?: string | undefined}; export type GetApiApiV1ToolgroupsLayoutIdUserHasLayoutOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /api/v1/toolgroups/{layoutId}/_userHasLayout */ export const getApiApiV1ToolgroupsLayoutIdUserHasLayout = async (args: GetApiApiV1ToolgroupsLayoutIdUserHasLayoutArgs, options: GetApiApiV1ToolgroupsLayoutIdUserHasLayoutOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.userid != null) query.append("userid", String(args.userid)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/toolgroups/${encodeURIComponent(String(args.layoutId))}/_userHasLayout${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };