/* * 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 { TaxRequirementsValue, TaxRequirementsValue$Outbound, TaxRequirementsValue$outboundSchema, } from "./taxrequirementsvalue.js"; export type Requirements = { /** * An identifier for an individual requirement. Uniqueness is guaranteed within a requirement set. */ key: string; /** * The value or "answer" for a tax requirement. Type depends on the requirement metadata type (e.g. string for text/account_number, boolean for radio/checkbox, number for percent/currency/tax_rate). Null when the requirement has not been answered. */ value?: TaxRequirementsValue | null | undefined; }; export type TaxRequirementSetUpdate = { /** * An identifier for a set of requirements. A list of requirement sets can contain multiple sets with the same `key` and different `effective_from` values. */ key: string; /** * One of the two-letter state abbreviations for the fifty United States and the District of Columbia (DC) */ state: string; /** * An ISO 8601 formatted date representing the date values became effective. Some requirement sets are effective dated, while others are not. Multiple requirement sets for the same state/key can/will exist with unique effective dates. If a requirement set is has an `effective_from` value, all requirement sets with the same key will also have an `effective_from` value. */ effectiveFrom?: string | null | undefined; requirements?: Array | undefined; }; /** @internal */ export type Requirements$Outbound = { key: string; value?: TaxRequirementsValue$Outbound | null | undefined; }; /** @internal */ export const Requirements$outboundSchema: z.ZodType< Requirements$Outbound, z.ZodTypeDef, Requirements > = z.object({ key: z.string(), value: z.nullable(TaxRequirementsValue$outboundSchema).optional(), }); export function requirementsToJSON(requirements: Requirements): string { return JSON.stringify(Requirements$outboundSchema.parse(requirements)); } /** @internal */ export type TaxRequirementSetUpdate$Outbound = { key: string; state: string; effective_from?: string | null | undefined; requirements?: Array | undefined; }; /** @internal */ export const TaxRequirementSetUpdate$outboundSchema: z.ZodType< TaxRequirementSetUpdate$Outbound, z.ZodTypeDef, TaxRequirementSetUpdate > = z.object({ key: z.string(), state: z.string(), effectiveFrom: z.nullable(z.string()).optional(), requirements: z.array(z.lazy(() => Requirements$outboundSchema)).optional(), }).transform((v) => { return remap$(v, { effectiveFrom: "effective_from", }); }); export function taxRequirementSetUpdateToJSON( taxRequirementSetUpdate: TaxRequirementSetUpdate, ): string { return JSON.stringify( TaxRequirementSetUpdate$outboundSchema.parse(taxRequirementSetUpdate), ); }