/* * 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"; export type IpmiCommandPayloadPackedNetFnNetFn = { /** * True if the least-significant bit is zero */ isRequest?: boolean | undefined; /** * True if the least-significant bit is one */ isResponse?: boolean | undefined; /** * The human-readable name of the NetFn */ name?: string | undefined; /** * The raw value of the NetFn (6 bits, least significant indicates request/response) */ raw?: number | undefined; /** * The normalized value of the NetFn (i.e. raw & 0xfe, so it is always even) */ value?: number | undefined; }; /** @internal */ export const IpmiCommandPayloadPackedNetFnNetFn$inboundSchema: z.ZodType< IpmiCommandPayloadPackedNetFnNetFn, z.ZodTypeDef, unknown > = z.object({ is_request: z.boolean().optional(), is_response: z.boolean().optional(), name: z.string().optional(), raw: z.number().int().optional(), value: z.number().int().optional(), }).transform((v) => { return remap$(v, { "is_request": "isRequest", "is_response": "isResponse", }); }); export function ipmiCommandPayloadPackedNetFnNetFnFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IpmiCommandPayloadPackedNetFnNetFn$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IpmiCommandPayloadPackedNetFnNetFn' from JSON`, ); }