/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { SubModifyTaxAction, SubModifyTaxAction$outboundSchema, } from "./sub-modify-tax-action.js"; export type SubModifyTaxParams = { action: SubModifyTaxAction; /** * Optional. When to apply the change; defaults to now if omitted. */ effectiveDate?: Date | undefined; /** * Required when action="remove". ID of the TaxAssociation to soft-delete. */ taxAssociationId?: string | undefined; /** * Required when action="add". ID of the active tax rate to attach. */ taxRateId?: string | undefined; }; /** @internal */ export type SubModifyTaxParams$Outbound = { action: string; effective_date?: string | undefined; tax_association_id?: string | undefined; tax_rate_id?: string | undefined; }; /** @internal */ export const SubModifyTaxParams$outboundSchema: z.ZodMiniType< SubModifyTaxParams$Outbound, SubModifyTaxParams > = z.pipe( z.object({ action: SubModifyTaxAction$outboundSchema, effectiveDate: z.optional( z.pipe(z.date(), z.transform(v => v.toISOString())), ), taxAssociationId: z.optional(z.string()), taxRateId: z.optional(z.string()), }), z.transform((v) => { return remap$(v, { effectiveDate: "effective_date", taxAssociationId: "tax_association_id", taxRateId: "tax_rate_id", }); }), ); export function subModifyTaxParamsToJSON( subModifyTaxParams: SubModifyTaxParams, ): string { return JSON.stringify( SubModifyTaxParams$outboundSchema.parse(subModifyTaxParams), ); }