/* * 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 { RecurringReimbursement, RecurringReimbursement$inboundSchema, } from "../components/recurringreimbursement.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 PutV1RecurringReimbursementsHeaderXGustoAPIVersion = { 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 PutV1RecurringReimbursementsHeaderXGustoAPIVersion = ClosedEnum< typeof PutV1RecurringReimbursementsHeaderXGustoAPIVersion >; export type PutV1RecurringReimbursementsRequestBody = { /** * The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field. */ version: string; /** * The description of the reimbursement */ description?: string | undefined; /** * The dollar amount of the reimbursement */ amount?: number | undefined; }; export type PutV1RecurringReimbursementsRequest = { /** * 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?: | PutV1RecurringReimbursementsHeaderXGustoAPIVersion | undefined; /** * The UUID of the reimbursement */ id: string; requestBody: PutV1RecurringReimbursementsRequestBody; }; export type PutV1RecurringReimbursementsResponse = { httpMeta: HTTPMetadata; /** * successful */ recurringReimbursement?: RecurringReimbursement | undefined; }; /** @internal */ export const PutV1RecurringReimbursementsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z .nativeEnum(PutV1RecurringReimbursementsHeaderXGustoAPIVersion); /** @internal */ export type PutV1RecurringReimbursementsRequestBody$Outbound = { version: string; description?: string | undefined; amount?: number | undefined; }; /** @internal */ export const PutV1RecurringReimbursementsRequestBody$outboundSchema: z.ZodType< PutV1RecurringReimbursementsRequestBody$Outbound, z.ZodTypeDef, PutV1RecurringReimbursementsRequestBody > = z.object({ version: z.string(), description: z.string().optional(), amount: z.number().optional(), }); export function putV1RecurringReimbursementsRequestBodyToJSON( putV1RecurringReimbursementsRequestBody: PutV1RecurringReimbursementsRequestBody, ): string { return JSON.stringify( PutV1RecurringReimbursementsRequestBody$outboundSchema.parse( putV1RecurringReimbursementsRequestBody, ), ); } /** @internal */ export type PutV1RecurringReimbursementsRequest$Outbound = { "X-Gusto-API-Version": string; id: string; RequestBody: PutV1RecurringReimbursementsRequestBody$Outbound; }; /** @internal */ export const PutV1RecurringReimbursementsRequest$outboundSchema: z.ZodType< PutV1RecurringReimbursementsRequest$Outbound, z.ZodTypeDef, PutV1RecurringReimbursementsRequest > = z.object({ xGustoAPIVersion: PutV1RecurringReimbursementsHeaderXGustoAPIVersion$outboundSchema.default( "2025-06-15", ), id: z.string(), requestBody: z.lazy(() => PutV1RecurringReimbursementsRequestBody$outboundSchema ), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", requestBody: "RequestBody", }); }); export function putV1RecurringReimbursementsRequestToJSON( putV1RecurringReimbursementsRequest: PutV1RecurringReimbursementsRequest, ): string { return JSON.stringify( PutV1RecurringReimbursementsRequest$outboundSchema.parse( putV1RecurringReimbursementsRequest, ), ); } /** @internal */ export const PutV1RecurringReimbursementsResponse$inboundSchema: z.ZodType< PutV1RecurringReimbursementsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Recurring-Reimbursement": RecurringReimbursement$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Recurring-Reimbursement": "recurringReimbursement", }); }); export function putV1RecurringReimbursementsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PutV1RecurringReimbursementsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutV1RecurringReimbursementsResponse' from JSON`, ); }