/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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 UserRegistration = { firstName: string; lastName: string; companyName: string; emailAddress: string; }; /** @internal */ export const UserRegistration$inboundSchema: z.ZodType< UserRegistration, z.ZodTypeDef, unknown > = z.object({ first_name: z.string(), last_name: z.string(), company_name: z.string(), email_address: z.string(), }).transform((v) => { return remap$(v, { "first_name": "firstName", "last_name": "lastName", "company_name": "companyName", "email_address": "emailAddress", }); }); /** @internal */ export type UserRegistration$Outbound = { first_name: string; last_name: string; company_name: string; email_address: string; }; /** @internal */ export const UserRegistration$outboundSchema: z.ZodType< UserRegistration$Outbound, z.ZodTypeDef, UserRegistration > = z.object({ firstName: z.string(), lastName: z.string(), companyName: z.string(), emailAddress: z.string(), }).transform((v) => { return remap$(v, { firstName: "first_name", lastName: "last_name", companyName: "company_name", emailAddress: "email_address", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UserRegistration$ { /** @deprecated use `UserRegistration$inboundSchema` instead. */ export const inboundSchema = UserRegistration$inboundSchema; /** @deprecated use `UserRegistration$outboundSchema` instead. */ export const outboundSchema = UserRegistration$outboundSchema; /** @deprecated use `UserRegistration$Outbound` instead. */ export type Outbound = UserRegistration$Outbound; } export function userRegistrationToJSON( userRegistration: UserRegistration, ): string { return JSON.stringify( UserRegistration$outboundSchema.parse(userRegistration), ); } export function userRegistrationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UserRegistration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UserRegistration' from JSON`, ); }