/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { HTTPMetadata, HTTPMetadata$inboundSchema, } from "../components/httpmetadata.js"; import { SalaryEstimate, SalaryEstimate$inboundSchema, } from "../components/salaryestimate.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. */ export const PostV1EmployeesEmployeeIdSalaryEstimatesHeaderXGustoAPIVersion = { TwoThousandAndTwentyFiveMinus06Minus15: "2025-06-15", } as const; /** * Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. */ export type PostV1EmployeesEmployeeIdSalaryEstimatesHeaderXGustoAPIVersion = ClosedEnum< typeof PostV1EmployeesEmployeeIdSalaryEstimatesHeaderXGustoAPIVersion >; /** * Experience level for this occupation */ export const ExperienceLevel = { Novice: "novice", Intermediate: "intermediate", Average: "average", Skilled: "skilled", Expert: "expert", } as const; /** * Experience level for this occupation */ export type ExperienceLevel = ClosedEnum; export type Occupations = { /** * Bureau of Labor Statistics (BLS) occupation code */ code: string; /** * Experience level for this occupation */ experienceLevel: ExperienceLevel; /** * Percentage of time spent in this occupation (as decimal, e.g., 1.0 = 100%) */ timePercentage: string; /** * Whether this is the primary occupation */ primary?: boolean | undefined; }; export type PostV1EmployeesEmployeeIdSalaryEstimatesRequestBody = { /** * The annual net revenue of the business (must be greater than 0) */ annualNetRevenue?: number | null | undefined; /** * The ZIP code for location-based salary calculations */ zipCode: string; /** * Array of occupations. Time percentages must sum to 100%. */ occupations: Array; }; export type PostV1EmployeesEmployeeIdSalaryEstimatesRequest = { /** * Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. */ xGustoAPIVersion?: | PostV1EmployeesEmployeeIdSalaryEstimatesHeaderXGustoAPIVersion | undefined; /** * The UUID of the employee */ employeeId: string; requestBody: PostV1EmployeesEmployeeIdSalaryEstimatesRequestBody; }; export type PostV1EmployeesEmployeeIdSalaryEstimatesResponse = { httpMeta: HTTPMetadata; /** * successfully created */ salaryEstimate?: SalaryEstimate | undefined; }; /** @internal */ export const PostV1EmployeesEmployeeIdSalaryEstimatesHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof PostV1EmployeesEmployeeIdSalaryEstimatesHeaderXGustoAPIVersion > = z.nativeEnum( PostV1EmployeesEmployeeIdSalaryEstimatesHeaderXGustoAPIVersion, ); /** @internal */ export const ExperienceLevel$outboundSchema: z.ZodNativeEnum< typeof ExperienceLevel > = z.nativeEnum(ExperienceLevel); /** @internal */ export type Occupations$Outbound = { code: string; experience_level: string; time_percentage: string; primary?: boolean | undefined; }; /** @internal */ export const Occupations$outboundSchema: z.ZodType< Occupations$Outbound, z.ZodTypeDef, Occupations > = z.object({ code: z.string(), experienceLevel: ExperienceLevel$outboundSchema, timePercentage: z.string(), primary: z.boolean().optional(), }).transform((v) => { return remap$(v, { experienceLevel: "experience_level", timePercentage: "time_percentage", }); }); export function occupationsToJSON(occupations: Occupations): string { return JSON.stringify(Occupations$outboundSchema.parse(occupations)); } /** @internal */ export type PostV1EmployeesEmployeeIdSalaryEstimatesRequestBody$Outbound = { annual_net_revenue?: number | null | undefined; zip_code: string; occupations: Array; }; /** @internal */ export const PostV1EmployeesEmployeeIdSalaryEstimatesRequestBody$outboundSchema: z.ZodType< PostV1EmployeesEmployeeIdSalaryEstimatesRequestBody$Outbound, z.ZodTypeDef, PostV1EmployeesEmployeeIdSalaryEstimatesRequestBody > = z.object({ annualNetRevenue: z.nullable(z.number()).optional(), zipCode: z.string(), occupations: z.array(z.lazy(() => Occupations$outboundSchema)), }).transform((v) => { return remap$(v, { annualNetRevenue: "annual_net_revenue", zipCode: "zip_code", }); }); export function postV1EmployeesEmployeeIdSalaryEstimatesRequestBodyToJSON( postV1EmployeesEmployeeIdSalaryEstimatesRequestBody: PostV1EmployeesEmployeeIdSalaryEstimatesRequestBody, ): string { return JSON.stringify( PostV1EmployeesEmployeeIdSalaryEstimatesRequestBody$outboundSchema.parse( postV1EmployeesEmployeeIdSalaryEstimatesRequestBody, ), ); } /** @internal */ export type PostV1EmployeesEmployeeIdSalaryEstimatesRequest$Outbound = { "X-Gusto-API-Version": string; employee_id: string; RequestBody: PostV1EmployeesEmployeeIdSalaryEstimatesRequestBody$Outbound; }; /** @internal */ export const PostV1EmployeesEmployeeIdSalaryEstimatesRequest$outboundSchema: z.ZodType< PostV1EmployeesEmployeeIdSalaryEstimatesRequest$Outbound, z.ZodTypeDef, PostV1EmployeesEmployeeIdSalaryEstimatesRequest > = z.object({ xGustoAPIVersion: PostV1EmployeesEmployeeIdSalaryEstimatesHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), employeeId: z.string(), requestBody: z.lazy(() => PostV1EmployeesEmployeeIdSalaryEstimatesRequestBody$outboundSchema ), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", employeeId: "employee_id", requestBody: "RequestBody", }); }); export function postV1EmployeesEmployeeIdSalaryEstimatesRequestToJSON( postV1EmployeesEmployeeIdSalaryEstimatesRequest: PostV1EmployeesEmployeeIdSalaryEstimatesRequest, ): string { return JSON.stringify( PostV1EmployeesEmployeeIdSalaryEstimatesRequest$outboundSchema.parse( postV1EmployeesEmployeeIdSalaryEstimatesRequest, ), ); } /** @internal */ export const PostV1EmployeesEmployeeIdSalaryEstimatesResponse$inboundSchema: z.ZodType< PostV1EmployeesEmployeeIdSalaryEstimatesResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Salary-Estimate": SalaryEstimate$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Salary-Estimate": "salaryEstimate", }); }); export function postV1EmployeesEmployeeIdSalaryEstimatesResponseFromJSON( jsonString: string, ): SafeParseResult< PostV1EmployeesEmployeeIdSalaryEstimatesResponse, SDKValidationError > { return safeParse( jsonString, (x) => PostV1EmployeesEmployeeIdSalaryEstimatesResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PostV1EmployeesEmployeeIdSalaryEstimatesResponse' from JSON`, ); }