/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { ChangedLineItemAction, ChangedLineItemAction$inboundSchema, } from "./changed-line-item-action.js"; import { SDKValidationError } from "./sdk-validation-error.js"; export type ChangedLineItem = { /** * created | updated | ended */ changeAction?: ChangedLineItemAction | undefined; endDate?: Date | undefined; id?: string | undefined; priceId?: string | undefined; quantity?: string | undefined; startDate?: Date | undefined; }; /** @internal */ export const ChangedLineItem$inboundSchema: z.ZodMiniType< ChangedLineItem, unknown > = z.pipe( z.object({ change_action: types.optional(ChangedLineItemAction$inboundSchema), end_date: types.optional(types.date()), id: types.optional(types.string()), price_id: types.optional(types.string()), quantity: types.optional(types.string()), start_date: types.optional(types.date()), }), z.transform((v) => { return remap$(v, { "change_action": "changeAction", "end_date": "endDate", "price_id": "priceId", "start_date": "startDate", }); }), ); export function changedLineItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ChangedLineItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChangedLineItem' from JSON`, ); }