/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 37d2bbfb5053 */ import * as z from "zod/v4"; import { ClosedEnum } from "../types/enums.js"; /** * New command state */ export const UpdateCommandRequestState = { PendingUpload: "PENDING_UPLOAD", Pending: "PENDING", Dispatched: "DISPATCHED", Succeeded: "SUCCEEDED", Failed: "FAILED", Expired: "EXPIRED", } as const; /** * New command state */ export type UpdateCommandRequestState = ClosedEnum< typeof UpdateCommandRequestState >; export type UpdateCommandRequest = { /** * New command state */ state?: UpdateCommandRequestState | undefined; /** * Current attempt number */ attempt?: number | undefined; /** * When command was dispatched */ dispatchedAt?: Date | null | undefined; /** * When command completed */ completedAt?: Date | null | undefined; /** * Size of response in bytes */ responseSizeBytes?: number | null | undefined; /** * Error details if failed */ error?: { [k: string]: any | null } | null | undefined; }; /** @internal */ export const UpdateCommandRequestState$outboundSchema: z.ZodEnum< typeof UpdateCommandRequestState > = z.enum(UpdateCommandRequestState); /** @internal */ export type UpdateCommandRequest$Outbound = { state?: string | undefined; attempt?: number | undefined; dispatchedAt?: string | null | undefined; completedAt?: string | null | undefined; responseSizeBytes?: number | null | undefined; error?: { [k: string]: any | null } | null | undefined; }; /** @internal */ export const UpdateCommandRequest$outboundSchema: z.ZodType< UpdateCommandRequest$Outbound, UpdateCommandRequest > = z.object({ state: UpdateCommandRequestState$outboundSchema.optional(), attempt: z.number().optional(), dispatchedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), completedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), responseSizeBytes: z.nullable(z.number()).optional(), error: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(), }); export function updateCommandRequestToJSON( updateCommandRequest: UpdateCommandRequest, ): string { return JSON.stringify( UpdateCommandRequest$outboundSchema.parse(updateCommandRequest), ); }