/* * 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 { SDKValidationError } from "./sdk-validation-error.js"; export type WebhookDtoInvoiceLineItem = { amount?: string | undefined; displayName?: string | undefined; id?: string | undefined; periodEnd?: Date | undefined; periodStart?: Date | undefined; planDisplayName?: string | undefined; priceId?: string | undefined; quantity?: string | undefined; }; /** @internal */ export const WebhookDtoInvoiceLineItem$inboundSchema: z.ZodMiniType< WebhookDtoInvoiceLineItem, unknown > = z.pipe( z.object({ amount: types.optional(types.string()), display_name: types.optional(types.string()), id: types.optional(types.string()), period_end: types.optional(types.date()), period_start: types.optional(types.date()), plan_display_name: types.optional(types.string()), price_id: types.optional(types.string()), quantity: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "display_name": "displayName", "period_end": "periodEnd", "period_start": "periodStart", "plan_display_name": "planDisplayName", "price_id": "priceId", }); }), ); export function webhookDtoInvoiceLineItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDtoInvoiceLineItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDtoInvoiceLineItem' from JSON`, ); }