@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>
57 lines • 2.18 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 * as types from "../types/primitives.js";
import { Drive$inboundSchema } from "./drive.js";
/**
* Field to sort drives by.
*/
export const ListDrivesQueryParamSortBy = {
CreatedAt: "createdAt",
UpdatedAt: "updatedAt",
Name: "name",
};
/**
* Sort direction for results.
*/
export const ListDrivesQueryParamSortOrder = {
Asc: "asc",
Desc: "desc",
};
/** @internal */
export const ListDrivesQueryParamSortBy$outboundSchema = z.nativeEnum(ListDrivesQueryParamSortBy);
/** @internal */
export const ListDrivesQueryParamSortOrder$outboundSchema = z.nativeEnum(ListDrivesQueryParamSortOrder);
/** @internal */
export const ListDrivesRequest$outboundSchema = z.object({
projectId: z.string().optional(),
limit: z.number().default(20),
cursor: z.string().optional(),
sortBy: ListDrivesQueryParamSortBy$outboundSchema.default("createdAt"),
namePrefix: z.string().optional(),
sortOrder: ListDrivesQueryParamSortOrder$outboundSchema.default("desc"),
teamId: z.string().optional(),
slug: z.string().optional(),
});
export function listDrivesRequestToJSON(listDrivesRequest) {
return JSON.stringify(ListDrivesRequest$outboundSchema.parse(listDrivesRequest));
}
/** @internal */
export const ListDrivesPagination$inboundSchema = z.object({
count: types.number(),
next: types.nullable(types.string()),
});
export function listDrivesPaginationFromJSON(jsonString) {
return safeParse(jsonString, (x) => ListDrivesPagination$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListDrivesPagination' from JSON`);
}
/** @internal */
export const ListDrivesResponseBody$inboundSchema = z.object({
drives: z.array(Drive$inboundSchema),
pagination: z.lazy(() => ListDrivesPagination$inboundSchema),
});
export function listDrivesResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => ListDrivesResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListDrivesResponseBody' from JSON`);
}
//# sourceMappingURL=listdrivesop.js.map