// This file is auto-generated by @hey-api/openapi-ts import { type Options, getApiV1Volumes } from "../sdk.gen"; import { queryOptions } from "@tanstack/react-query"; import type { GetApiV1VolumesData } from "../types.gen"; import { client as _heyApiClient } from "../client.gen"; export type QueryKey = [ Pick & { _id: string; _infinite?: boolean; tags?: ReadonlyArray; }, ]; const createQueryKey = ( id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray, ): [QueryKey[0]] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? _heyApiClient).getConfig().baseUrl, } as QueryKey[0]; if (infinite) { params._infinite = infinite; } if (tags) { params.tags = tags; } if (options?.body) { params.body = options.body; } if (options?.headers) { params.headers = options.headers; } if (options?.path) { params.path = options.path; } if (options?.query) { params.query = options.query; } return [params]; }; export const getApiV1VolumesQueryKey = ( options?: Options, ) => createQueryKey("getApiV1Volumes", options); /** * List all volumes */ export const getApiV1VolumesOptions = ( options?: Options, ) => { return queryOptions({ queryFn: async ({ queryKey, signal }) => { const { data } = await getApiV1Volumes({ ...options, ...queryKey[0], signal, throwOnError: true, }); return data; }, queryKey: getApiV1VolumesQueryKey(options), }); };