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