/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: befac2e0c999 */ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; /** * The kind of command-capable resource a command targets. */ export const ResolvedCommandTargetResourceType = { Worker: "worker", Container: "container", Daemon: "daemon", } as const; /** * The kind of command-capable resource a command targets. */ export type ResolvedCommandTargetResourceType = ClosedEnum< typeof ResolvedCommandTargetResourceType >; /** * Identifies the specific resource a command is addressed to. */ export type ResolvedCommandTargetTarget = { /** * The resource ID within the deployment's stack (e.g. a Worker/Container/Daemon id). */ resourceId: string; /** * The kind of command-capable resource a command targets. */ resourceType: ResolvedCommandTargetResourceType; }; /** * How a command is delivered to its target resource. * * @remarks * * This is a Commands-protocol-specific concept and is intentionally distinct * from `DeploymentModel` (see `stack_settings.rs`), which governs the * infrastructure-level push/pull wiring for a deployment. Serialized * lowercase for consistency with `CommandTargetType`. */ export const ResolvedCommandTargetDeliveryMode = { Push: "push", Pull: "pull", } as const; /** * How a command is delivered to its target resource. * * @remarks * * This is a Commands-protocol-specific concept and is intentionally distinct * from `DeploymentModel` (see `stack_settings.rs`), which governs the * infrastructure-level push/pull wiring for a deployment. Serialized * lowercase for consistency with `CommandTargetType`. */ export type ResolvedCommandTargetDeliveryMode = ClosedEnum< typeof ResolvedCommandTargetDeliveryMode >; export type ResolvedCommandTarget = { /** * Identifies the specific resource a command is addressed to. */ target: ResolvedCommandTargetTarget; /** * How a command is delivered to its target resource. * * @remarks * * This is a Commands-protocol-specific concept and is intentionally distinct * from `DeploymentModel` (see `stack_settings.rs`), which governs the * infrastructure-level push/pull wiring for a deployment. Serialized * lowercase for consistency with `CommandTargetType`. */ deliveryMode: ResolvedCommandTargetDeliveryMode; }; /** @internal */ export const ResolvedCommandTargetResourceType$inboundSchema: z.ZodEnum< typeof ResolvedCommandTargetResourceType > = z.enum(ResolvedCommandTargetResourceType); /** @internal */ export const ResolvedCommandTargetTarget$inboundSchema: z.ZodType< ResolvedCommandTargetTarget, unknown > = z.object({ resourceId: z.string(), resourceType: ResolvedCommandTargetResourceType$inboundSchema, }); export function resolvedCommandTargetTargetFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ResolvedCommandTargetTarget$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResolvedCommandTargetTarget' from JSON`, ); } /** @internal */ export const ResolvedCommandTargetDeliveryMode$inboundSchema: z.ZodEnum< typeof ResolvedCommandTargetDeliveryMode > = z.enum(ResolvedCommandTargetDeliveryMode); /** @internal */ export const ResolvedCommandTarget$inboundSchema: z.ZodType< ResolvedCommandTarget, unknown > = z.object({ target: z.lazy(() => ResolvedCommandTargetTarget$inboundSchema), deliveryMode: ResolvedCommandTargetDeliveryMode$inboundSchema, }); export function resolvedCommandTargetFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ResolvedCommandTarget$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResolvedCommandTarget' from JSON`, ); }