@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>
60 lines • 2.67 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 { smartUnion } from "../types/smartUnion.js";
export const QueryParamProvider = {
Github: "github",
GithubLimited: "github-limited",
GithubCustomHost: "github-custom-host",
Gitlab: "gitlab",
Bitbucket: "bitbucket",
};
/** @internal */
export const QueryParamProvider$outboundSchema = z.nativeEnum(QueryParamProvider);
/** @internal */
export const GitNamespacesRequest$outboundSchema = z.object({
host: z.string().optional(),
provider: QueryParamProvider$outboundSchema.optional(),
viewerMetadata: z.boolean().optional(),
});
export function gitNamespacesRequestToJSON(gitNamespacesRequest) {
return JSON.stringify(GitNamespacesRequest$outboundSchema.parse(gitNamespacesRequest));
}
/** @internal */
export const GitNamespacesId$inboundSchema = smartUnion([types.string(), types.number()]);
export function gitNamespacesIdFromJSON(jsonString) {
return safeParse(jsonString, (x) => GitNamespacesId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GitNamespacesId' from JSON`);
}
/** @internal */
export const GitNamespacesRole$inboundSchema = smartUnion([types.string(), types.number()]);
export function gitNamespacesRoleFromJSON(jsonString) {
return safeParse(jsonString, (x) => GitNamespacesRole$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GitNamespacesRole' from JSON`);
}
/** @internal */
export const Viewer$inboundSchema = z
.object({
canCreateApp: types.optional(types.boolean()),
role: types.optional(smartUnion([types.string(), types.number()])),
});
export function viewerFromJSON(jsonString) {
return safeParse(jsonString, (x) => Viewer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Viewer' from JSON`);
}
/** @internal */
export const GitNamespacesResponseBody$inboundSchema = z.object({
provider: types.string(),
slug: types.string(),
id: smartUnion([types.string(), types.number()]),
ownerType: types.string(),
name: types.optional(types.string()),
isAccessRestricted: types.optional(types.boolean()),
installationId: types.optional(types.number()),
requireReauth: types.optional(types.boolean()),
viewer: types.optional(z.lazy(() => Viewer$inboundSchema)),
});
export function gitNamespacesResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => GitNamespacesResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GitNamespacesResponseBody' from JSON`);
}
//# sourceMappingURL=gitnamespacesop.js.map