@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>
76 lines (71 loc) • 1.88 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 * as types from "../types/primitives.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
/**
* This object contains information related to a Vercel Sandbox Drive.
*/
export type Drive = {
/**
* The unique drive ID.
*/
id: string;
/**
* The unique drive name within the project.
*/
name: string;
/**
* The project that owns the drive.
*/
projectId: string;
/**
* The maximum drive size in bytes.
*/
maxSizeBytes: number;
/**
* The region where the drive is stored.
*/
region: string;
/**
* Current session ID the drive is attached to, if any.
*/
currentSessionId?: string | undefined;
/**
* Current sandbox name the drive is attached to, if any.
*/
currentSandboxName?: string | undefined;
/**
* The time when the drive was created, in milliseconds since the epoch.
*/
createdAt: number;
/**
* The last time the drive was updated, in milliseconds since the epoch.
*/
updatedAt: number;
};
/** @internal */
export const Drive$inboundSchema: z.ZodType<Drive, z.ZodTypeDef, unknown> = z
.object({
id: types.string(),
name: types.string(),
projectId: types.string(),
maxSizeBytes: types.number(),
region: types.string(),
currentSessionId: types.optional(types.string()),
currentSandboxName: types.optional(types.string()),
createdAt: types.number(),
updatedAt: types.number(),
});
export function driveFromJSON(
jsonString: string,
): SafeParseResult<Drive, SDKValidationError> {
return safeParse(
jsonString,
(x) => Drive$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Drive' from JSON`,
);
}