/* * 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"; import { Status, Status$inboundSchema } from "./status.js"; export type CreditnoteCreditNoteLineItem = { amount?: string | undefined; createdAt?: Date | undefined; createdBy?: string | undefined; creditNoteId?: string | undefined; currency?: string | undefined; displayName?: string | undefined; environmentId?: string | undefined; id?: string | undefined; invoiceLineItemId?: string | undefined; metadata?: { [k: string]: string } | undefined; status?: Status | undefined; tenantId?: string | undefined; updatedAt?: Date | undefined; updatedBy?: string | undefined; }; /** @internal */ export const CreditnoteCreditNoteLineItem$inboundSchema: z.ZodMiniType< CreditnoteCreditNoteLineItem, unknown > = z.pipe( z.object({ amount: types.optional(types.string()), created_at: types.optional(types.date()), created_by: types.optional(types.string()), credit_note_id: types.optional(types.string()), currency: types.optional(types.string()), display_name: types.optional(types.string()), environment_id: types.optional(types.string()), id: types.optional(types.string()), invoice_line_item_id: types.optional(types.string()), metadata: types.optional(z.record(z.string(), types.string())), status: types.optional(Status$inboundSchema), tenant_id: types.optional(types.string()), updated_at: types.optional(types.date()), updated_by: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "created_at": "createdAt", "created_by": "createdBy", "credit_note_id": "creditNoteId", "display_name": "displayName", "environment_id": "environmentId", "invoice_line_item_id": "invoiceLineItemId", "tenant_id": "tenantId", "updated_at": "updatedAt", "updated_by": "updatedBy", }); }), ); export function creditnoteCreditNoteLineItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreditnoteCreditNoteLineItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreditnoteCreditNoteLineItem' from JSON`, ); }