export type GetApihttpLocalhost8000ClientDatastoresNameArgs = {name: string, project_id?: string | undefined}; export type GetApihttpLocalhost8000ClientDatastoresNameOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * List key-value data in a datastore for the client. * * GET http://localhost:8000/client/datastores/{name}/ */ export const getApihttpLocalhost8000ClientDatastoresName = async (args: GetApihttpLocalhost8000ClientDatastoresNameArgs, options?: GetApihttpLocalhost8000ClientDatastoresNameOptions) => { const {baseUrl = "http://localhost:8000", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.project_id != null) query.append("project_id", String(args.project_id)) const url = `${baseUrl.replace(/\/+$/, '')}http://localhost:8000/client/datastores/${encodeURIComponent(String(args.name))}/${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 };