@vercel/sdk
Version:
<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>
43 lines • 1.94 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { safeParse } from "../lib/schemas.js";
import { smartUnion } from "../types/smartUnion.js";
import { NamedSandbox$inboundSchema } from "./namedsandbox.js";
import { Session$inboundSchema } from "./session.js";
import { Snapshot$inboundSchema } from "./snapshot.js";
/** @internal */
export const StopSessionRequest$outboundSchema = z.object({
sessionId: z.string(),
teamId: z.string().optional(),
slug: z.string().optional(),
});
export function stopSessionRequestToJSON(stopSessionRequest) {
return JSON.stringify(StopSessionRequest$outboundSchema.parse(stopSessionRequest));
}
/** @internal */
export const StopSessionResponseBody2$inboundSchema = z.object({
snapshot: Snapshot$inboundSchema,
sandbox: NamedSandbox$inboundSchema,
session: Session$inboundSchema,
});
export function stopSessionResponseBody2FromJSON(jsonString) {
return safeParse(jsonString, (x) => StopSessionResponseBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StopSessionResponseBody2' from JSON`);
}
/** @internal */
export const StopSessionResponseBody1$inboundSchema = z.object({
session: Session$inboundSchema,
});
export function stopSessionResponseBody1FromJSON(jsonString) {
return safeParse(jsonString, (x) => StopSessionResponseBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StopSessionResponseBody1' from JSON`);
}
/** @internal */
export const StopSessionResponseBody$inboundSchema = smartUnion([
z.lazy(() => StopSessionResponseBody2$inboundSchema),
z.lazy(() => StopSessionResponseBody1$inboundSchema),
]);
export function stopSessionResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => StopSessionResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StopSessionResponseBody' from JSON`);
}
//# sourceMappingURL=stopsessionop.js.map