/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdk-validation-error.js"; /** * Production API gateway for public workflow execution. */ export const StopServerComposeApi = "compose-api"; export const StopServerList = { [StopServerComposeApi]: "https://api.compose.market", }; export type StopRequestBody = { threadId?: string | undefined; runId?: string | undefined; }; export type StopRequest = { walletAddress: string; body: StopRequestBody; }; /** * Workflow cancellation accepted. */ export type StopResponse = { success: boolean; runId: string; }; /** @internal */ export type StopRequestBody$Outbound = { threadId?: string | undefined; runId?: string | undefined; }; /** @internal */ export const StopRequestBody$outboundSchema: z.ZodMiniType< StopRequestBody$Outbound, StopRequestBody > = z.object({ threadId: z.optional(z.string()), runId: z.optional(z.string()), }); export function stopRequestBodyToJSON( stopRequestBody: StopRequestBody, ): string { return JSON.stringify(StopRequestBody$outboundSchema.parse(stopRequestBody)); } /** @internal */ export type StopRequest$Outbound = { walletAddress: string; body: StopRequestBody$Outbound; }; /** @internal */ export const StopRequest$outboundSchema: z.ZodMiniType< StopRequest$Outbound, StopRequest > = z.object({ walletAddress: z.string(), body: z.lazy(() => StopRequestBody$outboundSchema), }); export function stopRequestToJSON(stopRequest: StopRequest): string { return JSON.stringify(StopRequest$outboundSchema.parse(stopRequest)); } /** @internal */ export const StopResponse$inboundSchema: z.ZodMiniType = z.object({ success: types.boolean(), runId: types.string(), }); export function stopResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => StopResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StopResponse' from JSON`, ); }