/* * 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 { IpmiSessionHeaderAuthType, IpmiSessionHeaderAuthType$inboundSchema, } from "./ipmisessionheaderauthtype.js"; export type IpmiSessionHeader = { /** * The 16-byte authentication code; not present if auth_type is None. */ authCode?: string | undefined; authType?: IpmiSessionHeaderAuthType | undefined; /** * The ID of this sessiod. */ sessionId?: number | undefined; /** * The session sequence number of this packet in the session */ sessionSequenceNumber?: number | undefined; }; /** @internal */ export const IpmiSessionHeader$inboundSchema: z.ZodType< IpmiSessionHeader, z.ZodTypeDef, unknown > = z.object({ auth_code: z.string().optional(), auth_type: IpmiSessionHeaderAuthType$inboundSchema.optional(), session_id: z.number().int().optional(), session_sequence_number: z.number().int().optional(), }).transform((v) => { return remap$(v, { "auth_code": "authCode", "auth_type": "authType", "session_id": "sessionId", "session_sequence_number": "sessionSequenceNumber", }); }); export function ipmiSessionHeaderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IpmiSessionHeader$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IpmiSessionHeader' from JSON`, ); }