export type GetApiPublicV1ProductPosMappingsArgs = {product_id?: string | undefined, blaze_retailer_id?: string | undefined, dutchie_retailer_id?: string | undefined, treez_retailer_id?: number | undefined, inserted_datetime?: string | undefined, updated_datetime?: string | undefined}; export type GetApiPublicV1ProductPosMappingsOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * List product POS mappings * * GET /public/v1/product-pos-mappings */ export const getApiPublicV1ProductPosMappings = async (args: GetApiPublicV1ProductPosMappingsArgs, options?: GetApiPublicV1ProductPosMappingsOptions) => { const {baseUrl = "https://app.distru.com", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.product_id != null) query.append("product_id", String(args.product_id)) if (args.blaze_retailer_id != null) query.append("blaze_retailer_id", String(args.blaze_retailer_id)) if (args.dutchie_retailer_id != null) query.append("dutchie_retailer_id", String(args.dutchie_retailer_id)) if (args.treez_retailer_id != null) query.append("treez_retailer_id", String(args.treez_retailer_id)) if (args.inserted_datetime != null) query.append("inserted_datetime", String(args.inserted_datetime)) if (args.updated_datetime != null) query.append("updated_datetime", String(args.updated_datetime)) if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/public/v1/product-pos-mappings${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() };