/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; /** * Information for the user who will be the primary payroll administrator for the new company. */ export type User = { /** * The first name of the user who will be the primary payroll admin. */ firstName: string; /** * The last name of the user who will be the primary payroll admin. */ lastName: string; /** * The email of the user who will be the primary payroll admin. */ email: string; /** * The phone number of the user who will be the primary payroll admin. */ phone?: string | undefined; }; export type PartnerManagedCompanyCreateRequestCompany = { /** * The legal name of the company. */ name: string; /** * The name of the company. */ tradeName?: string | undefined; /** * The employer identification number (EIN) of the company. */ ein?: string | undefined; /** * Whether the company only supports contractors. Should be set to true if the company has no W-2 employees. If not passed, will default to false (i.e. the company will support both contractors and employees). */ contractorOnly?: boolean | undefined; }; export type PartnerManagedCompanyCreateRequest = { /** * Information for the user who will be the primary payroll administrator for the new company. */ user: User; company: PartnerManagedCompanyCreateRequestCompany; }; /** @internal */ export type User$Outbound = { first_name: string; last_name: string; email: string; phone?: string | undefined; }; /** @internal */ export const User$outboundSchema: z.ZodType = z.object({ firstName: z.string(), lastName: z.string(), email: z.string(), phone: z.string().optional(), }).transform((v) => { return remap$(v, { firstName: "first_name", lastName: "last_name", }); }); export function userToJSON(user: User): string { return JSON.stringify(User$outboundSchema.parse(user)); } /** @internal */ export type PartnerManagedCompanyCreateRequestCompany$Outbound = { name: string; trade_name?: string | undefined; ein?: string | undefined; contractor_only?: boolean | undefined; }; /** @internal */ export const PartnerManagedCompanyCreateRequestCompany$outboundSchema: z.ZodType< PartnerManagedCompanyCreateRequestCompany$Outbound, z.ZodTypeDef, PartnerManagedCompanyCreateRequestCompany > = z.object({ name: z.string(), tradeName: z.string().optional(), ein: z.string().optional(), contractorOnly: z.boolean().optional(), }).transform((v) => { return remap$(v, { tradeName: "trade_name", contractorOnly: "contractor_only", }); }); export function partnerManagedCompanyCreateRequestCompanyToJSON( partnerManagedCompanyCreateRequestCompany: PartnerManagedCompanyCreateRequestCompany, ): string { return JSON.stringify( PartnerManagedCompanyCreateRequestCompany$outboundSchema.parse( partnerManagedCompanyCreateRequestCompany, ), ); } /** @internal */ export type PartnerManagedCompanyCreateRequest$Outbound = { user: User$Outbound; company: PartnerManagedCompanyCreateRequestCompany$Outbound; }; /** @internal */ export const PartnerManagedCompanyCreateRequest$outboundSchema: z.ZodType< PartnerManagedCompanyCreateRequest$Outbound, z.ZodTypeDef, PartnerManagedCompanyCreateRequest > = z.object({ user: z.lazy(() => User$outboundSchema), company: z.lazy(() => PartnerManagedCompanyCreateRequestCompany$outboundSchema ), }); export function partnerManagedCompanyCreateRequestToJSON( partnerManagedCompanyCreateRequest: PartnerManagedCompanyCreateRequest, ): string { return JSON.stringify( PartnerManagedCompanyCreateRequest$outboundSchema.parse( partnerManagedCompanyCreateRequest, ), ); }