/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetRepoRequest = { /** * The organization URL slug. */ org: string; /** * The repository name (URL label). */ name: string; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** @internal */ export const GetRepoRequest$inboundSchema: z.ZodType< GetRepoRequest, z.ZodTypeDef, unknown > = z.object({ org: z.string(), name: z.string(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type GetRepoRequest$Outbound = { org: string; name: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const GetRepoRequest$outboundSchema: z.ZodType< GetRepoRequest$Outbound, z.ZodTypeDef, GetRepoRequest > = z.object({ org: z.string(), name: z.string(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", }); }); export function getRepoRequestToJSON(getRepoRequest: GetRepoRequest): string { return JSON.stringify(GetRepoRequest$outboundSchema.parse(getRepoRequest)); } export function getRepoRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetRepoRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetRepoRequest' from JSON`, ); }