/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Type of tax identification. * * @remarks * * `EIN` - Employer Identification Number, also known as a Federal Tax Identification Number. * * `VAT` - Value Added Tax identification number. * * `IOSS` - Import One-Stop Shop * * `ARN` - Australian Taxation Office Reference Number */ export const CustomsTaxIdentificationType = { Ein: "EIN", Vat: "VAT", Ioss: "IOSS", Arn: "ARN", } as const; /** * Type of tax identification. * * @remarks * * `EIN` - Employer Identification Number, also known as a Federal Tax Identification Number. * * `VAT` - Value Added Tax identification number. * * `IOSS` - Import One-Stop Shop * * `ARN` - Australian Taxation Office Reference Number */ export type CustomsTaxIdentificationType = ClosedEnum< typeof CustomsTaxIdentificationType >; /** * Tax identification that may be required to ship in certain countries. Typically used to assess duties on * * @remarks * goods that are crossing a border. */ export type CustomsTaxIdentification = { /** * Tax identification number. */ number?: string | undefined; /** * Type of tax identification. * * @remarks * * `EIN` - Employer Identification Number, also known as a Federal Tax Identification Number. * * `VAT` - Value Added Tax identification number. * * `IOSS` - Import One-Stop Shop * * `ARN` - Australian Taxation Office Reference Number */ type?: CustomsTaxIdentificationType | undefined; }; /** @internal */ export const CustomsTaxIdentificationType$inboundSchema: z.ZodMiniEnum< typeof CustomsTaxIdentificationType > = z.enum(CustomsTaxIdentificationType); /** @internal */ export const CustomsTaxIdentificationType$outboundSchema: z.ZodMiniEnum< typeof CustomsTaxIdentificationType > = CustomsTaxIdentificationType$inboundSchema; /** @internal */ export const CustomsTaxIdentification$inboundSchema: z.ZodMiniType< CustomsTaxIdentification, unknown > = z.object({ number: z.optional(z.string()), type: z.optional(CustomsTaxIdentificationType$inboundSchema), }); /** @internal */ export type CustomsTaxIdentification$Outbound = { number?: string | undefined; type?: string | undefined; }; /** @internal */ export const CustomsTaxIdentification$outboundSchema: z.ZodMiniType< CustomsTaxIdentification$Outbound, CustomsTaxIdentification > = z.object({ number: z.optional(z.string()), type: z.optional(CustomsTaxIdentificationType$outboundSchema), }); export function customsTaxIdentificationToJSON( customsTaxIdentification: CustomsTaxIdentification, ): string { return JSON.stringify( CustomsTaxIdentification$outboundSchema.parse(customsTaxIdentification), ); } export function customsTaxIdentificationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomsTaxIdentification$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomsTaxIdentification' from JSON`, ); }