@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>
89 lines (80 loc) • 2.44 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { safeParse } from "../lib/schemas.js";
import { Result as SafeParseResult } from "../types/fp.js";
import { NamedSandbox, NamedSandbox$inboundSchema } from "./namedsandbox.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
export type DeleteSandboxRequest = {
/**
* The sandbox name to delete.
*/
name: string;
/**
* The project ID that owns the named sandbox. When provided, takes precedence over OIDC project context.
*/
projectId?: string | undefined;
/**
* When true, snapshots of the deleted sandbox that are not referenced by any other sandbox are also deleted asynchronously. Defaults to false.
*/
deleteOrphanSnapshots?: boolean | undefined;
/**
* The Team identifier to perform the request on behalf of.
*/
teamId?: string | undefined;
/**
* The Team slug to perform the request on behalf of.
*/
slug?: string | undefined;
};
export type DeleteSandboxResponseBody = {
/**
* This object contains information related to a Vercel NamedSandbox.
*/
sandbox: NamedSandbox;
};
/** @internal */
export type DeleteSandboxRequest$Outbound = {
name: string;
projectId?: string | undefined;
deleteOrphanSnapshots: boolean;
teamId?: string | undefined;
slug?: string | undefined;
};
/** @internal */
export const DeleteSandboxRequest$outboundSchema: z.ZodType<
DeleteSandboxRequest$Outbound,
z.ZodTypeDef,
DeleteSandboxRequest
> = z.object({
name: z.string(),
projectId: z.string().optional(),
deleteOrphanSnapshots: z.boolean().default(false),
teamId: z.string().optional(),
slug: z.string().optional(),
});
export function deleteSandboxRequestToJSON(
deleteSandboxRequest: DeleteSandboxRequest,
): string {
return JSON.stringify(
DeleteSandboxRequest$outboundSchema.parse(deleteSandboxRequest),
);
}
/** @internal */
export const DeleteSandboxResponseBody$inboundSchema: z.ZodType<
DeleteSandboxResponseBody,
z.ZodTypeDef,
unknown
> = z.object({
sandbox: NamedSandbox$inboundSchema,
});
export function deleteSandboxResponseBodyFromJSON(
jsonString: string,
): SafeParseResult<DeleteSandboxResponseBody, SDKValidationError> {
return safeParse(
jsonString,
(x) => DeleteSandboxResponseBody$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'DeleteSandboxResponseBody' from JSON`,
);
}