export type GetApiApiCustomerDeliveryHoursAcceptorCodeOkayArgs = {acceptorCode: string}; export type GetApiApiCustomerDeliveryHoursAcceptorCodeOkayOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * timeframes * * GET /api/customer/delivery-hours/{acceptorCode}/okay */ export const getApiApiCustomerDeliveryHoursAcceptorCodeOkay = async (args: GetApiApiCustomerDeliveryHoursAcceptorCodeOkayArgs, options: GetApiApiCustomerDeliveryHoursAcceptorCodeOkayOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/customer/delivery-hours/${encodeURIComponent(String(args.acceptorCode))}/okay${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() };