/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 4acc828c6da3 */ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export const GitHubProviderType = { Github: "github", } as const; export type GitHubProviderType = ClosedEnum; export type GitHubProvider = { type: GitHubProviderType; /** * Repository owner (user or organization) */ org: string; /** * Repository name */ repo: string; }; /** @internal */ export const GitHubProviderType$inboundSchema: z.ZodEnum< typeof GitHubProviderType > = z.enum(GitHubProviderType); /** @internal */ export const GitHubProviderType$outboundSchema: z.ZodEnum< typeof GitHubProviderType > = GitHubProviderType$inboundSchema; /** @internal */ export const GitHubProvider$inboundSchema: z.ZodType = z.object({ type: GitHubProviderType$inboundSchema, org: z.string(), repo: z.string(), }); /** @internal */ export type GitHubProvider$Outbound = { type: string; org: string; repo: string; }; /** @internal */ export const GitHubProvider$outboundSchema: z.ZodType< GitHubProvider$Outbound, GitHubProvider > = z.object({ type: GitHubProviderType$outboundSchema, org: z.string(), repo: z.string(), }); export function gitHubProviderToJSON(gitHubProvider: GitHubProvider): string { return JSON.stringify(GitHubProvider$outboundSchema.parse(gitHubProvider)); } export function gitHubProviderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GitHubProvider$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GitHubProvider' from JSON`, ); }