export type GetApiUrunUrunAramaDegerIdArgs = {Authorization?: string | undefined, deger: string, id: string}; export type GetApiUrunUrunAramaDegerIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /urun/urun-arama/{deger}/{id} */ export const getApiUrunUrunAramaDegerId = async (args: GetApiUrunUrunAramaDegerIdArgs, options?: GetApiUrunUrunAramaDegerIdOptions) => { const {baseUrl = "https://demo.poskobi.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/urun/urun-arama/${encodeURIComponent(String(args.deger))}/${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 res.blob() };