UNPKG

@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>

104 lines 4.28 kB
/* * 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 { smartUnion } from "../types/smartUnion.js"; /** * Role of this user in the project. */ export const ResponseBodyRole = { Admin: "ADMIN", ProjectDeveloper: "PROJECT_DEVELOPER", ProjectGuest: "PROJECT_GUEST", ProjectViewer: "PROJECT_VIEWER", }; /** * Role of this user in the project. */ export const ComputedProjectRole = { Admin: "ADMIN", ProjectDeveloper: "PROJECT_DEVELOPER", ProjectGuest: "PROJECT_GUEST", ProjectViewer: "PROJECT_VIEWER", }; /** * The role of this user in the team. */ export const ResponseBodyTeamRole = { Billing: "BILLING", Contributor: "CONTRIBUTOR", Developer: "DEVELOPER", Member: "MEMBER", Owner: "OWNER", Security: "SECURITY", Viewer: "VIEWER", ViewerForPlus: "VIEWER_FOR_PLUS", }; /** @internal */ export const GetProjectMembersRequest$outboundSchema = z.object({ idOrName: z.string(), limit: z.number().int().optional(), since: z.number().int().optional(), until: z.number().int().optional(), search: z.string().optional(), teamId: z.string().optional(), slug: z.string().optional(), }); export function getProjectMembersRequestToJSON(getProjectMembersRequest) { return JSON.stringify(GetProjectMembersRequest$outboundSchema.parse(getProjectMembersRequest)); } /** @internal */ export const ResponseBodyRole$inboundSchema = z.nativeEnum(ResponseBodyRole); /** @internal */ export const ComputedProjectRole$inboundSchema = z.nativeEnum(ComputedProjectRole); /** @internal */ export const ResponseBodyTeamRole$inboundSchema = z.nativeEnum(ResponseBodyTeamRole); /** @internal */ export const ResponseBodyMembers$inboundSchema = z.object({ avatar: types.optional(types.string()), email: types.string(), role: ResponseBodyRole$inboundSchema, computedProjectRole: ComputedProjectRole$inboundSchema, uid: types.string(), username: types.string(), name: types.optional(types.string()), createdAt: types.number(), teamRole: ResponseBodyTeamRole$inboundSchema, }); export function responseBodyMembersFromJSON(jsonString) { return safeParse(jsonString, (x) => ResponseBodyMembers$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseBodyMembers' from JSON`); } /** @internal */ export const GetProjectMembersResponseBodyPagination$inboundSchema = z.object({ hasNext: types.boolean(), count: types.number(), next: types.nullable(types.number()), prev: types.nullable(types.number()), }); export function getProjectMembersResponseBodyPaginationFromJSON(jsonString) { return safeParse(jsonString, (x) => GetProjectMembersResponseBodyPagination$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectMembersResponseBodyPagination' from JSON`); } /** @internal */ export const GetProjectMembersResponseBody2$inboundSchema = z.object({ members: z.array(z.lazy(() => ResponseBodyMembers$inboundSchema)), pagination: z.lazy(() => GetProjectMembersResponseBodyPagination$inboundSchema), }); export function getProjectMembersResponseBody2FromJSON(jsonString) { return safeParse(jsonString, (x) => GetProjectMembersResponseBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectMembersResponseBody2' from JSON`); } /** @internal */ export const GetProjectMembersResponseBody1$inboundSchema = z.object({}); export function getProjectMembersResponseBody1FromJSON(jsonString) { return safeParse(jsonString, (x) => GetProjectMembersResponseBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectMembersResponseBody1' from JSON`); } /** @internal */ export const GetProjectMembersResponseBody$inboundSchema = smartUnion([ z.lazy(() => GetProjectMembersResponseBody2$inboundSchema), z.lazy(() => GetProjectMembersResponseBody1$inboundSchema), ]); export function getProjectMembersResponseBodyFromJSON(jsonString) { return safeParse(jsonString, (x) => GetProjectMembersResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectMembersResponseBody' from JSON`); } //# sourceMappingURL=getprojectmembersop.js.map