export type GetApiUrunUrunAramaV2DegerArgs = {Authorization?: string | undefined, deger: string}; export type GetApiUrunUrunAramaV2DegerOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /urun/urun-aramaV2/{deger} */ export const getApiUrunUrunAramaV2Deger = async (args: GetApiUrunUrunAramaV2DegerArgs, options?: GetApiUrunUrunAramaV2DegerOptions) => { 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-aramaV2/${encodeURIComponent(String(args.deger))}${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() };