/* * 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 { AchTransaction, AchTransaction$inboundSchema, } from "../components/achtransaction.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 GetAchTransactionsHeaderXGustoAPIVersion = { 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 GetAchTransactionsHeaderXGustoAPIVersion = ClosedEnum< typeof GetAchTransactionsHeaderXGustoAPIVersion >; export type GetAchTransactionsRequest = { /** * 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?: GetAchTransactionsHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyUuid: string; /** * The UUID of the contractor payment */ contractorPaymentUuid?: string | undefined; /** * The UUID of the payroll */ payrollUuid?: string | undefined; /** * Used to filter the ACH transactions to only include those with a specific transaction type, such as "Credit employee pay". */ transactionType?: string | undefined; /** * Used to filter the ACH transactions to only include those with a specific payment direction, either "credit" or "debit". */ paymentDirection?: string | 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 GetAchTransactionsResponse = { httpMeta: HTTPMetadata; /** * Example response */ achTransactionList?: Array | undefined; }; /** @internal */ export const GetAchTransactionsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z .nativeEnum(GetAchTransactionsHeaderXGustoAPIVersion); /** @internal */ export type GetAchTransactionsRequest$Outbound = { "X-Gusto-API-Version": string; company_uuid: string; contractor_payment_uuid?: string | undefined; payroll_uuid?: string | undefined; transaction_type?: string | undefined; payment_direction?: string | undefined; page?: number | undefined; per?: number | undefined; }; /** @internal */ export const GetAchTransactionsRequest$outboundSchema: z.ZodType< GetAchTransactionsRequest$Outbound, z.ZodTypeDef, GetAchTransactionsRequest > = z.object({ xGustoAPIVersion: GetAchTransactionsHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), companyUuid: z.string(), contractorPaymentUuid: z.string().optional(), payrollUuid: z.string().optional(), transactionType: z.string().optional(), paymentDirection: 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", contractorPaymentUuid: "contractor_payment_uuid", payrollUuid: "payroll_uuid", transactionType: "transaction_type", paymentDirection: "payment_direction", }); }); export function getAchTransactionsRequestToJSON( getAchTransactionsRequest: GetAchTransactionsRequest, ): string { return JSON.stringify( GetAchTransactionsRequest$outboundSchema.parse(getAchTransactionsRequest), ); } /** @internal */ export const GetAchTransactionsResponse$inboundSchema: z.ZodType< GetAchTransactionsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Ach-Transaction-List": z.array(AchTransaction$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Ach-Transaction-List": "achTransactionList", }); }); export function getAchTransactionsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetAchTransactionsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAchTransactionsResponse' from JSON`, ); }