/* * 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 { EmbeddedTimeOffRequest, EmbeddedTimeOffRequest$inboundSchema, } from "../components/embeddedtimeoffrequest.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 GetV1CompaniesCompanyUuidTimeOffRequestsHeaderXGustoAPIVersion = { 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 GetV1CompaniesCompanyUuidTimeOffRequestsHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1CompaniesCompanyUuidTimeOffRequestsHeaderXGustoAPIVersion >; export type GetV1CompaniesCompanyUuidTimeOffRequestsRequest = { /** * 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?: | GetV1CompaniesCompanyUuidTimeOffRequestsHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyUuid: string; /** * Filter by employee UUIDs. Comma-separated for multiple values. */ employeeUuids?: string | undefined; /** * Filter by request status. Comma-separated for multiple values (e.g. pending,approved,declined,consumed). */ status?: string | undefined; /** * Filter requests that overlap with this start date */ startDate?: string | undefined; /** * Filter requests that overlap with this end date */ endDate?: string | undefined; /** * Sort order by start_date (asc or desc, defaults to desc) */ sortOrder?: string | undefined; /** * The page that is requested */ page?: number | undefined; /** * Number of objects per page */ per?: number | undefined; }; export type GetV1CompaniesCompanyUuidTimeOffRequestsResponse = { httpMeta: HTTPMetadata; /** * successful */ embeddedTimeOffRequests?: Array | undefined; }; /** @internal */ export const GetV1CompaniesCompanyUuidTimeOffRequestsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof GetV1CompaniesCompanyUuidTimeOffRequestsHeaderXGustoAPIVersion > = z.nativeEnum( GetV1CompaniesCompanyUuidTimeOffRequestsHeaderXGustoAPIVersion, ); /** @internal */ export type GetV1CompaniesCompanyUuidTimeOffRequestsRequest$Outbound = { "X-Gusto-API-Version": string; company_uuid: string; employee_uuids?: string | undefined; status?: string | undefined; start_date?: string | undefined; end_date?: string | undefined; sort_order?: string | undefined; page?: number | undefined; per?: number | undefined; }; /** @internal */ export const GetV1CompaniesCompanyUuidTimeOffRequestsRequest$outboundSchema: z.ZodType< GetV1CompaniesCompanyUuidTimeOffRequestsRequest$Outbound, z.ZodTypeDef, GetV1CompaniesCompanyUuidTimeOffRequestsRequest > = z.object({ xGustoAPIVersion: GetV1CompaniesCompanyUuidTimeOffRequestsHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), companyUuid: z.string(), employeeUuids: z.string().optional(), status: z.string().optional(), startDate: z.string().optional(), endDate: z.string().optional(), sortOrder: z.string().optional(), page: z.number().int().optional(), per: z.number().int().optional(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyUuid: "company_uuid", employeeUuids: "employee_uuids", startDate: "start_date", endDate: "end_date", sortOrder: "sort_order", }); }); export function getV1CompaniesCompanyUuidTimeOffRequestsRequestToJSON( getV1CompaniesCompanyUuidTimeOffRequestsRequest: GetV1CompaniesCompanyUuidTimeOffRequestsRequest, ): string { return JSON.stringify( GetV1CompaniesCompanyUuidTimeOffRequestsRequest$outboundSchema.parse( getV1CompaniesCompanyUuidTimeOffRequestsRequest, ), ); } /** @internal */ export const GetV1CompaniesCompanyUuidTimeOffRequestsResponse$inboundSchema: z.ZodType< GetV1CompaniesCompanyUuidTimeOffRequestsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Embedded-Time-Off-Requests": z.array(EmbeddedTimeOffRequest$inboundSchema) .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Embedded-Time-Off-Requests": "embeddedTimeOffRequests", }); }); export function getV1CompaniesCompanyUuidTimeOffRequestsResponseFromJSON( jsonString: string, ): SafeParseResult< GetV1CompaniesCompanyUuidTimeOffRequestsResponse, SDKValidationError > { return safeParse( jsonString, (x) => GetV1CompaniesCompanyUuidTimeOffRequestsResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetV1CompaniesCompanyUuidTimeOffRequestsResponse' from JSON`, ); }