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>

77 lines 3.44 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"; /** @internal */ export const GetEdgeConfigRequest$outboundSchema = z.object({ edgeConfigId: z.string(), teamId: z.string().optional(), slug: z.string().optional(), }); export function getEdgeConfigRequestToJSON(getEdgeConfigRequest) { return JSON.stringify(GetEdgeConfigRequest$outboundSchema.parse(getEdgeConfigRequest)); } /** @internal */ export const GetEdgeConfigPurpose2$inboundSchema = z.object({ type: types.literal("experimentation"), resourceId: types.string(), }); export function getEdgeConfigPurpose2FromJSON(jsonString) { return safeParse(jsonString, (x) => GetEdgeConfigPurpose2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEdgeConfigPurpose2' from JSON`); } /** @internal */ export const GetEdgeConfigPurpose1$inboundSchema = z.object({ type: types.literal("flags"), projectId: types.string(), }); export function getEdgeConfigPurpose1FromJSON(jsonString) { return safeParse(jsonString, (x) => GetEdgeConfigPurpose1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEdgeConfigPurpose1' from JSON`); } /** @internal */ export const GetEdgeConfigPurpose$inboundSchema = z.union([ z.lazy(() => GetEdgeConfigPurpose1$inboundSchema), z.lazy(() => GetEdgeConfigPurpose2$inboundSchema), ]); export function getEdgeConfigPurposeFromJSON(jsonString) { return safeParse(jsonString, (x) => GetEdgeConfigPurpose$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEdgeConfigPurpose' from JSON`); } /** @internal */ export const GetEdgeConfigTransfer$inboundSchema = z.object({ fromAccountId: types.string(), startedAt: types.number(), doneAt: types.nullable(types.number()), }); export function getEdgeConfigTransferFromJSON(jsonString) { return safeParse(jsonString, (x) => GetEdgeConfigTransfer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEdgeConfigTransfer' from JSON`); } /** @internal */ export const GetEdgeConfigSchema$inboundSchema = z.object({}); export function getEdgeConfigSchemaFromJSON(jsonString) { return safeParse(jsonString, (x) => GetEdgeConfigSchema$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEdgeConfigSchema' from JSON`); } /** @internal */ export const GetEdgeConfigResponseBody$inboundSchema = z.object({ id: types.string(), createdAt: types.number(), createdBy: types.optional(types.string()), ownerId: types.string(), slug: types.string(), updatedAt: types.number(), digest: types.string(), purpose: types.optional(z.union([ z.lazy(() => GetEdgeConfigPurpose1$inboundSchema), z.lazy(() => GetEdgeConfigPurpose2$inboundSchema), ])), deletedAt: z.nullable(types.number()).optional(), transfer: types.optional(z.lazy(() => GetEdgeConfigTransfer$inboundSchema)), schema: types.optional(z.lazy(() => GetEdgeConfigSchema$inboundSchema)), syncedToDynamoAt: types.optional(types.number()), sizeInBytes: types.number(), itemCount: types.number(), }); export function getEdgeConfigResponseBodyFromJSON(jsonString) { return safeParse(jsonString, (x) => GetEdgeConfigResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEdgeConfigResponseBody' from JSON`); } //# sourceMappingURL=getedgeconfigop.js.map