/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 3616bf6c0c1e */ import * as z from "zod/v4"; import { ClosedEnum } from "../types/enums.js"; /** * Initial state (PENDING_UPLOAD if params require upload, PENDING if inline) */ export const InitialState = { PendingUpload: "PENDING_UPLOAD", Pending: "PENDING", Dispatched: "DISPATCHED", Succeeded: "SUCCEEDED", Failed: "FAILED", Expired: "EXPIRED", } as const; /** * Initial state (PENDING_UPLOAD if params require upload, PENDING if inline) */ export type InitialState = ClosedEnum; export type CreateCommandRequest = { /** * Target deployment ID */ deploymentId: string; /** * Command name (e.g., 'analyze-repository') */ name: string; /** * Command parameters for public invocation */ params?: any | null | undefined; /** * Resource id the command is addressed to. Required when the deployment has more than one command-capable resource. */ target?: string | undefined; /** * Initial state (PENDING_UPLOAD if params require upload, PENDING if inline) */ initialState?: InitialState | undefined; /** * Optional deadline for command execution */ deadline?: Date | null | undefined; /** * Size of command params in bytes */ requestSizeBytes?: number | undefined; /** * Opaque operation result contract forwarded by a manager and persisted before dispatch */ operationResultContract?: any | null | undefined; }; /** @internal */ export const InitialState$outboundSchema: z.ZodEnum = z .enum(InitialState); /** @internal */ export type CreateCommandRequest$Outbound = { deploymentId: string; name: string; params?: any | null | undefined; target?: string | undefined; initialState?: string | undefined; deadline?: string | null | undefined; requestSizeBytes?: number | undefined; operationResultContract?: any | null | undefined; }; /** @internal */ export const CreateCommandRequest$outboundSchema: z.ZodType< CreateCommandRequest$Outbound, CreateCommandRequest > = z.object({ deploymentId: z.string(), name: z.string(), params: z.nullable(z.any()).optional(), target: z.string().optional(), initialState: InitialState$outboundSchema.optional(), deadline: z.nullable(z.date().transform(v => v.toISOString())).optional(), requestSizeBytes: z.number().optional(), operationResultContract: z.nullable(z.any()).optional(), }); export function createCommandRequestToJSON( createCommandRequest: CreateCommandRequest, ): string { return JSON.stringify( CreateCommandRequest$outboundSchema.parse(createCommandRequest), ); }