/* * 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 ReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest = { sessionId: string; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; gitHubReadCloneRequest: components.GitHubReadCloneRequest; }; /** @internal */ export const ReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest$inboundSchema: z.ZodType< ReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest, z.ZodTypeDef, unknown > = z.object({ session_id: z.string(), "X-On-Behalf-Of": z.string().optional(), GitHubReadCloneRequest: components.GitHubReadCloneRequest$inboundSchema, }).transform((v) => { return remap$(v, { "session_id": "sessionId", "X-On-Behalf-Of": "xOnBehalfOf", "GitHubReadCloneRequest": "gitHubReadCloneRequest", }); }); /** @internal */ export type ReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest$Outbound = { session_id: string; "X-On-Behalf-Of"?: string | undefined; GitHubReadCloneRequest: components.GitHubReadCloneRequest$Outbound; }; /** @internal */ export const ReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest$outboundSchema: z.ZodType< ReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest$Outbound, z.ZodTypeDef, ReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest > = z.object({ sessionId: z.string(), xOnBehalfOf: z.string().optional(), gitHubReadCloneRequest: components.GitHubReadCloneRequest$outboundSchema, }).transform((v) => { return remap$(v, { sessionId: "session_id", xOnBehalfOf: "X-On-Behalf-Of", gitHubReadCloneRequest: "GitHubReadCloneRequest", }); }); export function readCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequestToJSON( readCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest: ReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest, ): string { return JSON.stringify( ReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest$outboundSchema .parse(readCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest), ); } export function readCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequestFromJSON( jsonString: string, ): SafeParseResult< ReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest, SDKValidationError > { return safeParse( jsonString, (x) => ReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'ReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePostRequest' from JSON`, ); }