/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: d68b5999c673 */ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { GitHubProvider, GitHubProvider$inboundSchema, GitHubProvider$Outbound, GitHubProvider$outboundSchema, } from "./githubprovider.js"; import { GitLabProvider, GitLabProvider$inboundSchema, GitLabProvider$Outbound, GitLabProvider$outboundSchema, } from "./gitlabprovider.js"; /** * Provider-specific repository information, resolved server-side from remoteUrl */ export type GitProvider = GitHubProvider | GitLabProvider | any; /** @internal */ export const GitProvider$inboundSchema: z.ZodType = z .union([GitHubProvider$inboundSchema, GitLabProvider$inboundSchema, z.any()]); /** @internal */ export type GitProvider$Outbound = | GitHubProvider$Outbound | GitLabProvider$Outbound | any; /** @internal */ export const GitProvider$outboundSchema: z.ZodType< GitProvider$Outbound, GitProvider > = z.union([ GitHubProvider$outboundSchema, GitLabProvider$outboundSchema, z.any(), ]); export function gitProviderToJSON(gitProvider: GitProvider): string { return JSON.stringify(GitProvider$outboundSchema.parse(gitProvider)); } export function gitProviderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GitProvider$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GitProvider' from JSON`, ); }