@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>
81 lines • 3.07 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import { smartUnion } from "../types/smartUnion.js";
import { Drive$inboundSchema } from "./drive.js";
/**
* Region where the drive is stored. Defaults to iad1.
*/
export const GetOrCreateDriveRegion = {
Iad1: "iad1",
Sfo1: "sfo1",
Cle1: "cle1",
Cdg1: "cdg1",
Fra1: "fra1",
Arn1: "arn1",
Sin1: "sin1",
Pdx1: "pdx1",
Lhr1: "lhr1",
Icn1: "icn1",
Bom1: "bom1",
Cpt1: "cpt1",
Dub1: "dub1",
Gru1: "gru1",
Hkg1: "hkg1",
Syd1: "syd1",
Yul1: "yul1",
Hnd1: "hnd1",
Kix1: "kix1",
};
/** @internal */
export const GetOrCreateDriveRegion$outboundSchema = z.nativeEnum(GetOrCreateDriveRegion);
/** @internal */
export const GetOrCreateDriveRequestBody$outboundSchema = z.object({
projectId: z.string().optional(),
maxSizeBytes: z.number().int().optional(),
region: GetOrCreateDriveRegion$outboundSchema.default("iad1"),
});
export function getOrCreateDriveRequestBodyToJSON(getOrCreateDriveRequestBody) {
return JSON.stringify(GetOrCreateDriveRequestBody$outboundSchema.parse(getOrCreateDriveRequestBody));
}
/** @internal */
export const GetOrCreateDriveRequest$outboundSchema = z.object({
name: z.string(),
teamId: z.string().optional(),
slug: z.string().optional(),
requestBody: z.lazy(() => GetOrCreateDriveRequestBody$outboundSchema)
.optional(),
}).transform((v) => {
return remap$(v, {
requestBody: "RequestBody",
});
});
export function getOrCreateDriveRequestToJSON(getOrCreateDriveRequest) {
return JSON.stringify(GetOrCreateDriveRequest$outboundSchema.parse(getOrCreateDriveRequest));
}
/** @internal */
export const GetOrCreateDriveSandboxesResponseBody$inboundSchema = z.object({
drive: Drive$inboundSchema,
});
export function getOrCreateDriveSandboxesResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetOrCreateDriveSandboxesResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetOrCreateDriveSandboxesResponseBody' from JSON`);
}
/** @internal */
export const GetOrCreateDriveResponseBody$inboundSchema = z.object({
drive: Drive$inboundSchema,
});
export function getOrCreateDriveResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetOrCreateDriveResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetOrCreateDriveResponseBody' from JSON`);
}
/** @internal */
export const GetOrCreateDriveResponse$inboundSchema = smartUnion([
z.lazy(() => GetOrCreateDriveResponseBody$inboundSchema),
z.lazy(() => GetOrCreateDriveSandboxesResponseBody$inboundSchema),
]);
export function getOrCreateDriveResponseFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetOrCreateDriveResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetOrCreateDriveResponse' from JSON`);
}
//# sourceMappingURL=getorcreatedriveop.js.map