/* * 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 { ShowEmployees, ShowEmployees$inboundSchema, } from "../components/showemployees.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 GetV1CompaniesCompanyIdEmployeesHeaderXGustoAPIVersion = { 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 GetV1CompaniesCompanyIdEmployeesHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1CompaniesCompanyIdEmployeesHeaderXGustoAPIVersion >; export const Include = { AllCompensations: "all_compensations", AllHomeAddresses: "all_home_addresses", CompanyName: "company_name", CurrentHomeAddress: "current_home_address", CustomFields: "custom_fields", PortalInvitations: "portal_invitations", } as const; export type Include = ClosedEnum; export type GetV1CompaniesCompanyIdEmployeesRequest = { /** * 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?: | GetV1CompaniesCompanyIdEmployeesHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyId: string; /** * Filter employees by a specific primary work location */ locationUuid?: string | undefined; /** * Filter employees by a specific payroll */ payrollUuid?: string | undefined; /** * A string to search for in the object's names */ searchTerm?: string | undefined; /** * Sort employees by a given field. Cannot be used with search_term. Append `:asc` or `:desc` to specify direction (e.g., `name:desc`). Defaults to ascending. */ sortBy?: string | undefined; /** * Include the requested attribute(s) in each employee response. Multiple options are comma separated. */ include?: Array | undefined; /** * Filters employees by those who have completed onboarding */ onboarded?: boolean | undefined; /** * Filters employees who are ready to work (onboarded AND active today) */ onboardedActive?: boolean | undefined; /** * Filters employees by those who have been or are scheduled to be terminated */ terminated?: boolean | undefined; /** * Filters employees by those who have been terminated and whose termination is in effect today (excludes active and scheduled to be terminated) */ terminatedToday?: boolean | undefined; /** * Optional subset of employees to fetch. */ uuids?: Array | undefined; /** * The page that is requested. When unspecified, will load all objects unless endpoint forces pagination. */ page?: number | undefined; /** * Number of objects per page. For majority of endpoints will default to 25 */ per?: number | undefined; }; export type GetV1CompaniesCompanyIdEmployeesResponse = { httpMeta: HTTPMetadata; /** * successful */ showEmployees?: Array | undefined; }; /** @internal */ export const GetV1CompaniesCompanyIdEmployeesHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof GetV1CompaniesCompanyIdEmployeesHeaderXGustoAPIVersion > = z.nativeEnum(GetV1CompaniesCompanyIdEmployeesHeaderXGustoAPIVersion); /** @internal */ export const Include$outboundSchema: z.ZodNativeEnum = z .nativeEnum(Include); /** @internal */ export type GetV1CompaniesCompanyIdEmployeesRequest$Outbound = { "X-Gusto-API-Version": string; company_id: string; location_uuid?: string | undefined; payroll_uuid?: string | undefined; search_term?: string | undefined; sort_by?: string | undefined; include?: Array | undefined; onboarded?: boolean | undefined; onboarded_active?: boolean | undefined; terminated?: boolean | undefined; terminated_today?: boolean | undefined; uuids?: Array | undefined; page?: number | undefined; per?: number | undefined; }; /** @internal */ export const GetV1CompaniesCompanyIdEmployeesRequest$outboundSchema: z.ZodType< GetV1CompaniesCompanyIdEmployeesRequest$Outbound, z.ZodTypeDef, GetV1CompaniesCompanyIdEmployeesRequest > = z.object({ xGustoAPIVersion: GetV1CompaniesCompanyIdEmployeesHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), companyId: z.string(), locationUuid: z.string().optional(), payrollUuid: z.string().optional(), searchTerm: z.string().optional(), sortBy: z.string().optional(), include: z.array(Include$outboundSchema).optional(), onboarded: z.boolean().optional(), onboardedActive: z.boolean().optional(), terminated: z.boolean().optional(), terminatedToday: z.boolean().optional(), uuids: z.array(z.string()).optional(), page: z.number().int().optional(), per: z.number().int().optional(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyId: "company_id", locationUuid: "location_uuid", payrollUuid: "payroll_uuid", searchTerm: "search_term", sortBy: "sort_by", onboardedActive: "onboarded_active", terminatedToday: "terminated_today", }); }); export function getV1CompaniesCompanyIdEmployeesRequestToJSON( getV1CompaniesCompanyIdEmployeesRequest: GetV1CompaniesCompanyIdEmployeesRequest, ): string { return JSON.stringify( GetV1CompaniesCompanyIdEmployeesRequest$outboundSchema.parse( getV1CompaniesCompanyIdEmployeesRequest, ), ); } /** @internal */ export const GetV1CompaniesCompanyIdEmployeesResponse$inboundSchema: z.ZodType< GetV1CompaniesCompanyIdEmployeesResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Show-Employees": z.array(ShowEmployees$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Show-Employees": "showEmployees", }); }); export function getV1CompaniesCompanyIdEmployeesResponseFromJSON( jsonString: string, ): SafeParseResult< GetV1CompaniesCompanyIdEmployeesResponse, SDKValidationError > { return safeParse( jsonString, (x) => GetV1CompaniesCompanyIdEmployeesResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetV1CompaniesCompanyIdEmployeesResponse' from JSON`, ); }