export type GetApiV1IdentityResourcesResIdArgs = {resId: number}; export type GetApiV1IdentityResourcesResIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /V1/identityResources/{resId} */ export const getApiV1IdentityResourcesResId = async (args: GetApiV1IdentityResourcesResIdArgs, options: GetApiV1IdentityResourcesResIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/V1/identityResources/${encodeURIComponent(String(args.resId))}${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 undefined };