/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CreateRepoRequest = { description?: string | undefined; /** * The repository name. Must start with an alphanumeric character and * * @remarks * be ≤100 characters of `[A-Za-z0-9._-]`. */ name: string; }; /** @internal */ export const CreateRepoRequest$inboundSchema: z.ZodType< CreateRepoRequest, z.ZodTypeDef, unknown > = z.object({ description: z.string().optional(), name: z.string(), }); /** @internal */ export type CreateRepoRequest$Outbound = { description?: string | undefined; name: string; }; /** @internal */ export const CreateRepoRequest$outboundSchema: z.ZodType< CreateRepoRequest$Outbound, z.ZodTypeDef, CreateRepoRequest > = z.object({ description: z.string().optional(), name: z.string(), }); export function createRepoRequestToJSON( createRepoRequest: CreateRepoRequest, ): string { return JSON.stringify( CreateRepoRequest$outboundSchema.parse(createRepoRequest), ); } export function createRepoRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateRepoRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateRepoRequest' from JSON`, ); }