export type GetApiApiV1CachesProviderProviderObjectGroupIdArgs = {provider: string, group: string, id: string}; export type GetApiApiV1CachesProviderProviderObjectGroupIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /api/v1/caches/provider/{provider}/object/{group}/{id} */ export const getApiApiV1CachesProviderProviderObjectGroupId = async (args: GetApiApiV1CachesProviderProviderObjectGroupIdArgs, options: GetApiApiV1CachesProviderProviderObjectGroupIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/caches/provider/${encodeURIComponent(String(args.provider))}/object/${encodeURIComponent(String(args.group))}/${encodeURIComponent(String(args.id))}${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 };