export type PriceTierConditionsInput = {min_quantity?: ({quantity?: number | undefined, unit_type_id?: string | undefined}) | undefined, not_one_of_company_group_ids?: Array | undefined, not_one_of_company_ids?: Array | undefined, not_one_of_product_brand_ids?: Array | undefined, not_one_of_product_category_ids?: Array | undefined, not_one_of_product_group_ids?: Array | undefined, not_one_of_product_ids?: Array | undefined, not_one_of_product_subcategory_ids?: Array | undefined, not_one_of_product_tag_ids?: Array | undefined, one_of_company_group_ids?: Array | undefined, one_of_company_ids?: Array | undefined, one_of_product_brand_ids?: Array | undefined, one_of_product_category_ids?: Array | undefined, one_of_product_group_ids?: Array | undefined, one_of_product_ids?: Array | undefined, one_of_product_subcategory_ids?: Array | undefined, one_of_product_tag_ids?: Array | undefined, total_thc_percentage_range?: ({max?: number | undefined, min?: number | undefined}) | undefined}; export type CreateApiPublicV1PriceTiersArgs = {body: {id?: string | undefined, name: string, external_name?: string | undefined, price_or_percent: 'PRICE' | 'PERCENT', price?: string | undefined, percent?: string | undefined, is_flat?: boolean | undefined, valid_from_datetime?: string | undefined, valid_until_datetime?: string | undefined, menu_mode: 'ALL' | 'NONE' | 'SPECIFIC', menu_ids?: Array | undefined, menu_promo_enabled?: boolean | undefined, menu_promo_card_type?: ('TEXT' | 'IMAGE') | undefined, menu_promo_card_background_hex?: string | undefined, menu_promo_card_text_hex?: string | undefined, menu_promo_card_emoji?: string | undefined, owner_id?: string | undefined, conditions?: PriceTierConditionsInput | undefined}}; export type CreateApiPublicV1PriceTiersOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Upsert a price tier * * POST /public/v1/price-tiers */ export const createApiPublicV1PriceTiers = async (args: CreateApiPublicV1PriceTiersArgs, options?: CreateApiPublicV1PriceTiersOptions) => { const {baseUrl = "https://app.distru.com", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/public/v1/price-tiers${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };