@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>
110 lines • 4.61 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";
export const GetProjectCheckRequires = {
BuildReady: "build-ready",
DeploymentUrl: "deployment-url",
None: "none",
};
export const GetProjectCheckSourceProvider = {
Bitbucket: "bitbucket",
Github: "github",
Gitlab: "gitlab",
};
export const GetProjectCheckBlocks = {
BuildStart: "build-start",
DeploymentAlias: "deployment-alias",
DeploymentPromotion: "deployment-promotion",
DeploymentStart: "deployment-start",
None: "none",
};
export const GetProjectCheckSourceKind = {
GitProvider: "git-provider",
Integration: "integration",
Vercel: "vercel",
Webhook: "webhook",
};
/** @internal */
export const GetProjectCheckRequest$outboundSchema = z.object({
projectIdOrName: z.string(),
checkId: z.string(),
teamId: z.string().optional(),
slug: z.string().optional(),
});
export function getProjectCheckRequestToJSON(getProjectCheckRequest) {
return JSON.stringify(GetProjectCheckRequest$outboundSchema.parse(getProjectCheckRequest));
}
/** @internal */
export const GetProjectCheckRequires$inboundSchema = z.nativeEnum(GetProjectCheckRequires);
/** @internal */
export const GetProjectCheckSourceProvider$inboundSchema = z.nativeEnum(GetProjectCheckSourceProvider);
/** @internal */
export const GetProjectCheckSource3$inboundSchema = z.object({
kind: types.literal("git-provider"),
provider: GetProjectCheckSourceProvider$inboundSchema,
externalCheckName: types.string(),
});
export function getProjectCheckSource3FromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectCheckSource3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectCheckSource3' from JSON`);
}
/** @internal */
export const GetProjectCheckSource2$inboundSchema = z.object({
kind: types.literal("webhook"),
webhookId: types.optional(types.string()),
});
export function getProjectCheckSource2FromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectCheckSource2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectCheckSource2' from JSON`);
}
/** @internal */
export const GetProjectCheckSource1$inboundSchema = z.object({
kind: types.literal("integration"),
integrationId: types.string(),
integrationConfigurationId: types.string(),
resourceId: types.optional(types.string()),
externalResourceId: types.optional(types.string()),
});
export function getProjectCheckSource1FromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectCheckSource1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectCheckSource1' from JSON`);
}
/** @internal */
export const GetProjectCheckSource$inboundSchema = z.union([
z.lazy(() => GetProjectCheckSource1$inboundSchema),
z.lazy(() => GetProjectCheckSource2$inboundSchema),
z.lazy(() => GetProjectCheckSource3$inboundSchema),
]);
export function getProjectCheckSourceFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectCheckSource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectCheckSource' from JSON`);
}
/** @internal */
export const GetProjectCheckBlocks$inboundSchema = z.nativeEnum(GetProjectCheckBlocks);
/** @internal */
export const GetProjectCheckSourceKind$inboundSchema = z.nativeEnum(GetProjectCheckSourceKind);
/** @internal */
export const GetProjectCheckResponseBody$inboundSchema = z.object({
id: types.string(),
name: types.string(),
ownerId: types.string(),
projectId: types.string(),
isRerequestable: types.boolean(),
requires: GetProjectCheckRequires$inboundSchema,
source: z.union([
z.lazy(() => GetProjectCheckSource1$inboundSchema),
z.lazy(() => GetProjectCheckSource2$inboundSchema),
z.lazy(() => GetProjectCheckSource3$inboundSchema),
]),
blocks: GetProjectCheckBlocks$inboundSchema,
targets: z.array(types.string()),
sourceKind: GetProjectCheckSourceKind$inboundSchema,
sourceIntegrationConfigurationId: types.optional(types.string()),
timeout: types.number(),
createdAt: types.number(),
updatedAt: types.number(),
deletedAt: types.optional(types.number()),
});
export function getProjectCheckResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectCheckResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectCheckResponseBody' from JSON`);
}
//# sourceMappingURL=getprojectcheckop.js.map