/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { BillingModel, BillingModel$outboundSchema } from "./billing-model.js"; import { BillingTier, BillingTier$outboundSchema } from "./billing-tier.js"; import { CreatePriceTier, CreatePriceTier$Outbound, CreatePriceTier$outboundSchema, } from "./create-price-tier.js"; import { PriceTransformQuantity, PriceTransformQuantity$Outbound, PriceTransformQuantity$outboundSchema, } from "./price-transform-quantity.js"; export type OverrideLineItemRequest = { /** * Amount is the new price amount that overrides the original price (optional) */ amount?: string | undefined; billingModel?: BillingModel | undefined; /** * PriceID references the plan price to override */ priceId: string; /** * PriceUnitAmount is the amount of the price unit (for CUSTOM type, FLAT_FEE/PACKAGE billing models) */ priceUnitAmount?: string | undefined; /** * PriceUnitTiers are the tiers for the price unit (for CUSTOM type, TIERED billing model) */ priceUnitTiers?: Array | undefined; /** * Quantity for this line item (optional) */ quantity?: string | undefined; tierMode?: BillingTier | undefined; /** * Tiers determines the pricing tiers for this line item */ tiers?: Array | undefined; transformQuantity?: PriceTransformQuantity | undefined; }; /** @internal */ export type OverrideLineItemRequest$Outbound = { amount?: string | undefined; billing_model?: string | undefined; price_id: string; price_unit_amount?: string | undefined; price_unit_tiers?: Array | undefined; quantity?: string | undefined; tier_mode?: string | undefined; tiers?: Array | undefined; transform_quantity?: PriceTransformQuantity$Outbound | undefined; }; /** @internal */ export const OverrideLineItemRequest$outboundSchema: z.ZodMiniType< OverrideLineItemRequest$Outbound, OverrideLineItemRequest > = z.pipe( z.object({ amount: z.optional(z.string()), billingModel: z.optional(BillingModel$outboundSchema), priceId: z.string(), priceUnitAmount: z.optional(z.string()), priceUnitTiers: z.optional(z.array(CreatePriceTier$outboundSchema)), quantity: z.optional(z.string()), tierMode: z.optional(BillingTier$outboundSchema), tiers: z.optional(z.array(CreatePriceTier$outboundSchema)), transformQuantity: z.optional(PriceTransformQuantity$outboundSchema), }), z.transform((v) => { return remap$(v, { billingModel: "billing_model", priceId: "price_id", priceUnitAmount: "price_unit_amount", priceUnitTiers: "price_unit_tiers", tierMode: "tier_mode", transformQuantity: "transform_quantity", }); }), ); export function overrideLineItemRequestToJSON( overrideLineItemRequest: OverrideLineItemRequest, ): string { return JSON.stringify( OverrideLineItemRequest$outboundSchema.parse(overrideLineItemRequest), ); }