/* * 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 { EarningTypeList, EarningTypeList$inboundSchema, } from "../components/earningtypelist.js"; import { HTTPMetadata, HTTPMetadata$inboundSchema, } from "../components/httpmetadata.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 GetV1CompaniesCompanyIdEarningTypesHeaderXGustoAPIVersion = { 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 GetV1CompaniesCompanyIdEarningTypesHeaderXGustoAPIVersion = ClosedEnum; export type GetV1CompaniesCompanyIdEarningTypesRequest = { /** * 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?: | GetV1CompaniesCompanyIdEarningTypesHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyId: string; }; export type GetV1CompaniesCompanyIdEarningTypesResponse = { httpMeta: HTTPMetadata; /** * Success */ earningTypeList?: EarningTypeList | undefined; }; /** @internal */ export const GetV1CompaniesCompanyIdEarningTypesHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof GetV1CompaniesCompanyIdEarningTypesHeaderXGustoAPIVersion > = z.nativeEnum(GetV1CompaniesCompanyIdEarningTypesHeaderXGustoAPIVersion); /** @internal */ export type GetV1CompaniesCompanyIdEarningTypesRequest$Outbound = { "X-Gusto-API-Version": string; company_id: string; }; /** @internal */ export const GetV1CompaniesCompanyIdEarningTypesRequest$outboundSchema: z.ZodType< GetV1CompaniesCompanyIdEarningTypesRequest$Outbound, z.ZodTypeDef, GetV1CompaniesCompanyIdEarningTypesRequest > = z.object({ xGustoAPIVersion: GetV1CompaniesCompanyIdEarningTypesHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), companyId: z.string(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyId: "company_id", }); }); export function getV1CompaniesCompanyIdEarningTypesRequestToJSON( getV1CompaniesCompanyIdEarningTypesRequest: GetV1CompaniesCompanyIdEarningTypesRequest, ): string { return JSON.stringify( GetV1CompaniesCompanyIdEarningTypesRequest$outboundSchema.parse( getV1CompaniesCompanyIdEarningTypesRequest, ), ); } /** @internal */ export const GetV1CompaniesCompanyIdEarningTypesResponse$inboundSchema: z.ZodType< GetV1CompaniesCompanyIdEarningTypesResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Earning-Type-List": EarningTypeList$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Earning-Type-List": "earningTypeList", }); }); export function getV1CompaniesCompanyIdEarningTypesResponseFromJSON( jsonString: string, ): SafeParseResult< GetV1CompaniesCompanyIdEarningTypesResponse, SDKValidationError > { return safeParse( jsonString, (x) => GetV1CompaniesCompanyIdEarningTypesResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetV1CompaniesCompanyIdEarningTypesResponse' from JSON`, ); }