/* * 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 { TaxRateScope, TaxRateScope$outboundSchema } from "./tax-rate-scope.js"; import { TaxRateType, TaxRateType$outboundSchema } from "./tax-rate-type.js"; export type CreateTaxRateRequest = { /** * code is the unique alphanumeric case sensitive identifier for the tax rate (required) */ code: string; /** * description is an optional text description providing details about the tax rate */ description?: string | undefined; /** * fixed_value is the fixed monetary amount when tax_rate_type is "fixed" */ fixedValue?: string | undefined; /** * metadata contains additional key-value pairs for storing extra information */ metadata?: { [k: string]: string } | undefined; /** * name is the human-readable name for the tax rate (required) */ name: string; /** * percentage_value is the percentage value (0-100) when tax_rate_type is "percentage" */ percentageValue?: string | undefined; scope?: TaxRateScope | undefined; taxRateType?: TaxRateType | undefined; }; /** @internal */ export type CreateTaxRateRequest$Outbound = { code: string; description?: string | undefined; fixed_value?: string | undefined; metadata?: { [k: string]: string } | undefined; name: string; percentage_value?: string | undefined; scope?: string | undefined; tax_rate_type?: string | undefined; }; /** @internal */ export const CreateTaxRateRequest$outboundSchema: z.ZodMiniType< CreateTaxRateRequest$Outbound, CreateTaxRateRequest > = z.pipe( z.object({ code: z.string(), description: z.optional(z.string()), fixedValue: z.optional(z.string()), metadata: z.optional(z.record(z.string(), z.string())), name: z.string(), percentageValue: z.optional(z.string()), scope: z.optional(TaxRateScope$outboundSchema), taxRateType: z.optional(TaxRateType$outboundSchema), }), z.transform((v) => { return remap$(v, { fixedValue: "fixed_value", percentageValue: "percentage_value", taxRateType: "tax_rate_type", }); }), ); export function createTaxRateRequestToJSON( createTaxRateRequest: CreateTaxRateRequest, ): string { return JSON.stringify( CreateTaxRateRequest$outboundSchema.parse(createTaxRateRequest), ); }