/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { L2TpSccrp, L2TpSccrp$inboundSchema } from "./l2tpsccrp.js"; import { L2TpStopCcn, L2TpStopCcn$inboundSchema } from "./l2tpstopccn.js"; export type L2Tp = { helloReceived?: boolean | undefined; orderedMessagesRaw?: Array | null | undefined; sccnReceived?: boolean | undefined; sccrp?: L2TpSccrp | undefined; sccrpReceived?: boolean | undefined; sccrqReceived?: boolean | undefined; stopSccn?: L2TpStopCcn | undefined; stopSccnReceived?: boolean | undefined; zlbReceived?: boolean | undefined; }; /** @internal */ export const L2Tp$inboundSchema: z.ZodType = z .object({ hello_received: z.boolean().optional(), ordered_messages_raw: z.nullable(z.array(z.string())).optional(), sccn_received: z.boolean().optional(), sccrp: L2TpSccrp$inboundSchema.optional(), sccrp_received: z.boolean().optional(), sccrq_received: z.boolean().optional(), stop_sccn: L2TpStopCcn$inboundSchema.optional(), stop_sccn_received: z.boolean().optional(), zlb_received: z.boolean().optional(), }).transform((v) => { return remap$(v, { "hello_received": "helloReceived", "ordered_messages_raw": "orderedMessagesRaw", "sccn_received": "sccnReceived", "sccrp_received": "sccrpReceived", "sccrq_received": "sccrqReceived", "stop_sccn": "stopSccn", "stop_sccn_received": "stopSccnReceived", "zlb_received": "zlbReceived", }); }); export function l2TpFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => L2Tp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'L2Tp' from JSON`, ); }