/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { Status, Status$inboundSchema } from "./status.js"; import { TaxRateEntityType, TaxRateEntityType$inboundSchema, } from "./tax-rate-entity-type.js"; import { TaxRateResponse, TaxRateResponse$inboundSchema, } from "./tax-rate-response.js"; export type TaxAppliedResponse = { appliedAt?: Date | undefined; createdAt?: Date | undefined; createdBy?: string | undefined; currency?: string | undefined; entityId?: string | undefined; entityType?: TaxRateEntityType | undefined; environmentId?: string | undefined; id?: string | undefined; idempotencyKey?: string | undefined; metadata?: { [k: string]: string } | undefined; status?: Status | undefined; taxAmount?: string | undefined; taxAssociationId?: string | undefined; taxRate?: TaxRateResponse | undefined; taxRateId?: string | undefined; taxableAmount?: string | undefined; tenantId?: string | undefined; updatedAt?: Date | undefined; updatedBy?: string | undefined; }; /** @internal */ export const TaxAppliedResponse$inboundSchema: z.ZodMiniType< TaxAppliedResponse, unknown > = z.pipe( z.object({ applied_at: types.optional(types.date()), created_at: types.optional(types.date()), created_by: types.optional(types.string()), currency: types.optional(types.string()), entity_id: types.optional(types.string()), entity_type: types.optional(TaxRateEntityType$inboundSchema), environment_id: types.optional(types.string()), id: types.optional(types.string()), idempotency_key: types.optional(types.string()), metadata: types.optional(z.record(z.string(), types.string())), status: types.optional(Status$inboundSchema), tax_amount: types.optional(types.string()), tax_association_id: types.optional(types.string()), tax_rate: types.optional(TaxRateResponse$inboundSchema), tax_rate_id: types.optional(types.string()), taxable_amount: types.optional(types.string()), tenant_id: types.optional(types.string()), updated_at: types.optional(types.date()), updated_by: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "applied_at": "appliedAt", "created_at": "createdAt", "created_by": "createdBy", "entity_id": "entityId", "entity_type": "entityType", "environment_id": "environmentId", "idempotency_key": "idempotencyKey", "tax_amount": "taxAmount", "tax_association_id": "taxAssociationId", "tax_rate": "taxRate", "tax_rate_id": "taxRateId", "taxable_amount": "taxableAmount", "tenant_id": "tenantId", "updated_at": "updatedAt", "updated_by": "updatedBy", }); }), ); export function taxAppliedResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TaxAppliedResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaxAppliedResponse' from JSON`, ); }