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>

122 lines 5.55 kB
/* * 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 * as types from "../types/primitives.js"; /** * Type of matcher. One of "equals", "startsWith", or "endsWith". */ export const CreateCustomEnvironmentType = { Equals: "equals", StartsWith: "startsWith", EndsWith: "endsWith", }; /** * The type of environment (production, preview, or development) */ export const CreateCustomEnvironmentEnvironmentType = { Development: "development", Preview: "preview", Production: "production", }; /** * The type of matching to perform */ export const CreateCustomEnvironmentEnvironmentResponseType = { EndsWith: "endsWith", Equals: "equals", StartsWith: "startsWith", }; /** @internal */ export const CreateCustomEnvironmentType$outboundSchema = z.nativeEnum(CreateCustomEnvironmentType); /** @internal */ export const CreateCustomEnvironmentBranchMatcher$outboundSchema = z.object({ type: CreateCustomEnvironmentType$outboundSchema, pattern: z.string(), }); export function createCustomEnvironmentBranchMatcherToJSON(createCustomEnvironmentBranchMatcher) { return JSON.stringify(CreateCustomEnvironmentBranchMatcher$outboundSchema.parse(createCustomEnvironmentBranchMatcher)); } /** @internal */ export const CreateCustomEnvironmentRequestBody$outboundSchema = z.object({ slug: z.string().optional(), description: z.string().optional(), branchMatcher: z.lazy(() => CreateCustomEnvironmentBranchMatcher$outboundSchema).optional(), copyEnvVarsFrom: z.string().optional(), }); export function createCustomEnvironmentRequestBodyToJSON(createCustomEnvironmentRequestBody) { return JSON.stringify(CreateCustomEnvironmentRequestBody$outboundSchema.parse(createCustomEnvironmentRequestBody)); } /** @internal */ export const CreateCustomEnvironmentRequest$outboundSchema = z.object({ idOrName: z.string(), teamId: z.string().optional(), slug: z.string().optional(), requestBody: z.lazy(() => CreateCustomEnvironmentRequestBody$outboundSchema) .optional(), }).transform((v) => { return remap$(v, { requestBody: "RequestBody", }); }); export function createCustomEnvironmentRequestToJSON(createCustomEnvironmentRequest) { return JSON.stringify(CreateCustomEnvironmentRequest$outboundSchema.parse(createCustomEnvironmentRequest)); } /** @internal */ export const CreateCustomEnvironmentEnvironmentType$inboundSchema = z.nativeEnum(CreateCustomEnvironmentEnvironmentType); /** @internal */ export const CreateCustomEnvironmentEnvironmentResponseType$inboundSchema = z .nativeEnum(CreateCustomEnvironmentEnvironmentResponseType); /** @internal */ export const CreateCustomEnvironmentEnvironmentBranchMatcher$inboundSchema = z.object({ type: CreateCustomEnvironmentEnvironmentResponseType$inboundSchema, pattern: types.string(), }); export function createCustomEnvironmentEnvironmentBranchMatcherFromJSON(jsonString) { return safeParse(jsonString, (x) => CreateCustomEnvironmentEnvironmentBranchMatcher$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateCustomEnvironmentEnvironmentBranchMatcher' from JSON`); } /** @internal */ export const CreateCustomEnvironmentVerification$inboundSchema = z.object({ type: types.string(), domain: types.string(), value: types.string(), reason: types.string(), }); export function createCustomEnvironmentVerificationFromJSON(jsonString) { return safeParse(jsonString, (x) => CreateCustomEnvironmentVerification$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateCustomEnvironmentVerification' from JSON`); } /** @internal */ export const CreateCustomEnvironmentDomains$inboundSchema = z.object({ name: types.string(), apexName: types.string(), projectId: types.string(), redirect: z.nullable(types.string()).optional(), redirectStatusCode: z.nullable(types.number()).optional(), gitBranch: z.nullable(types.string()).optional(), customEnvironmentId: z.nullable(types.string()).optional(), updatedAt: types.optional(types.number()), createdAt: types.optional(types.number()), verified: types.boolean(), verification: types.optional(z.array(z.lazy(() => CreateCustomEnvironmentVerification$inboundSchema))), }); export function createCustomEnvironmentDomainsFromJSON(jsonString) { return safeParse(jsonString, (x) => CreateCustomEnvironmentDomains$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateCustomEnvironmentDomains' from JSON`); } /** @internal */ export const CreateCustomEnvironmentResponseBody$inboundSchema = z.object({ id: types.string(), slug: types.string(), type: CreateCustomEnvironmentEnvironmentType$inboundSchema, description: types.optional(types.string()), branchMatcher: types.optional(z.lazy(() => CreateCustomEnvironmentEnvironmentBranchMatcher$inboundSchema)), domains: types.optional(z.array(z.lazy(() => CreateCustomEnvironmentDomains$inboundSchema))), currentDeploymentAliases: types.optional(z.array(types.string())), createdAt: types.number(), updatedAt: types.number(), }); export function createCustomEnvironmentResponseBodyFromJSON(jsonString) { return safeParse(jsonString, (x) => CreateCustomEnvironmentResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateCustomEnvironmentResponseBody' from JSON`); } //# sourceMappingURL=createcustomenvironmentop.js.map