export type GetApihttpLocalhost8000ProjectIdSamplersSamplerIdArgs = {project_id: string, sampler_id: string, body: {with_domains?: string | undefined, with_intervals?: string | undefined}}; export type GetApihttpLocalhost8000ProjectIdSamplersSamplerIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get details on a particular sampler. * * GET http://localhost:8000/{project_id}/samplers/{sampler_id}/ */ export const getApihttpLocalhost8000ProjectIdSamplersSamplerId = async (args: GetApihttpLocalhost8000ProjectIdSamplersSamplerIdArgs, options?: GetApihttpLocalhost8000ProjectIdSamplersSamplerIdOptions) => { const {baseUrl = "http://localhost:8000", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/x-www-form-urlencoded") const url = `${baseUrl.replace(/\/+$/, '')}http://localhost:8000/${encodeURIComponent(String(args.project_id))}/samplers/${encodeURIComponent(String(args.sampler_id))}/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers, body: new URLSearchParams(Object.entries(args.body).flatMap(([key, value]) => (value == null ? [] : [[key, String(value)]])))}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };