/* * 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 { TaxRateEntityType, TaxRateEntityType$outboundSchema, } from "./tax-rate-entity-type.js"; export type CreateTaxAssociationRequest = { autoApply?: boolean | undefined; currency?: string | undefined; /** * EndDate sets when this association expires. Must be after StartDate when both are provided. */ endDate?: Date | undefined; entityId?: string | undefined; entityType?: TaxRateEntityType | undefined; externalCustomerId?: string | undefined; metadata?: { [k: string]: string } | undefined; priority?: number | undefined; /** * StartDate sets when this association becomes active. Defaults to now if omitted. */ startDate?: Date | undefined; taxRateCode: string; }; /** @internal */ export type CreateTaxAssociationRequest$Outbound = { auto_apply?: boolean | undefined; currency?: string | undefined; end_date?: string | undefined; entity_id?: string | undefined; entity_type?: string | undefined; external_customer_id?: string | undefined; metadata?: { [k: string]: string } | undefined; priority?: number | undefined; start_date?: string | undefined; tax_rate_code: string; }; /** @internal */ export const CreateTaxAssociationRequest$outboundSchema: z.ZodMiniType< CreateTaxAssociationRequest$Outbound, CreateTaxAssociationRequest > = z.pipe( z.object({ autoApply: z.optional(z.boolean()), currency: z.optional(z.string()), endDate: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))), entityId: z.optional(z.string()), entityType: z.optional(TaxRateEntityType$outboundSchema), externalCustomerId: z.optional(z.string()), metadata: z.optional(z.record(z.string(), z.string())), priority: z.optional(z.int()), startDate: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))), taxRateCode: z.string(), }), z.transform((v) => { return remap$(v, { autoApply: "auto_apply", endDate: "end_date", entityId: "entity_id", entityType: "entity_type", externalCustomerId: "external_customer_id", startDate: "start_date", taxRateCode: "tax_rate_code", }); }), ); export function createTaxAssociationRequestToJSON( createTaxAssociationRequest: CreateTaxAssociationRequest, ): string { return JSON.stringify( CreateTaxAssociationRequest$outboundSchema.parse( createTaxAssociationRequest, ), ); }