/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CreateRepoRequest = { /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; createRepoRequest: components.CreateRepoRequest; }; /** @internal */ export const CreateRepoRequest$inboundSchema: z.ZodType< CreateRepoRequest, z.ZodTypeDef, unknown > = z.object({ "X-On-Behalf-Of": z.string().optional(), CreateRepoRequest: components.CreateRepoRequest$inboundSchema, }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", "CreateRepoRequest": "createRepoRequest", }); }); /** @internal */ export type CreateRepoRequest$Outbound = { "X-On-Behalf-Of"?: string | undefined; CreateRepoRequest: components.CreateRepoRequest$Outbound; }; /** @internal */ export const CreateRepoRequest$outboundSchema: z.ZodType< CreateRepoRequest$Outbound, z.ZodTypeDef, CreateRepoRequest > = z.object({ xOnBehalfOf: z.string().optional(), createRepoRequest: components.CreateRepoRequest$outboundSchema, }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", createRepoRequest: "CreateRepoRequest", }); }); 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`, ); }