/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { TaxRequirement, TaxRequirement$inboundSchema, } from "./taxrequirement.js"; export type TaxRequirementSet = { /** * One of the two-letter state abbreviations for the fifty United States and the District of Columbia (DC) */ state?: string | undefined; /** * 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 | undefined; /** * Customer facing label for the requirement set, e.g. "Registrations" */ label?: string | undefined; /** * 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 const TaxRequirementSet$inboundSchema: z.ZodType< TaxRequirementSet, z.ZodTypeDef, unknown > = z.object({ state: z.string().optional(), key: z.string().optional(), label: z.string().optional(), effective_from: z.nullable(z.string()).optional(), requirements: z.array(TaxRequirement$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "effective_from": "effectiveFrom", }); }); export function taxRequirementSetFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TaxRequirementSet$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaxRequirementSet' from JSON`, ); }