/* * 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 { BillingCycle, BillingCycle$outboundSchema } from "./billing-cycle.js"; import { BillingPeriod, BillingPeriod$outboundSchema, } from "./billing-period.js"; export type BillingPeriodConfig = { billingAnchor?: Date | undefined; billingCycle?: BillingCycle | undefined; billingPeriodCount?: number | undefined; billingPeriodUnit?: BillingPeriod | undefined; }; /** @internal */ export type BillingPeriodConfig$Outbound = { billing_anchor?: string | undefined; billing_cycle?: string | undefined; billing_period_count?: number | undefined; billing_period_unit?: string | undefined; }; /** @internal */ export const BillingPeriodConfig$outboundSchema: z.ZodMiniType< BillingPeriodConfig$Outbound, BillingPeriodConfig > = z.pipe( z.object({ billingAnchor: z.optional( z.pipe(z.date(), z.transform(v => v.toISOString())), ), billingCycle: z.optional(BillingCycle$outboundSchema), billingPeriodCount: z.optional(z.int()), billingPeriodUnit: z.optional(BillingPeriod$outboundSchema), }), z.transform((v) => { return remap$(v, { billingAnchor: "billing_anchor", billingCycle: "billing_cycle", billingPeriodCount: "billing_period_count", billingPeriodUnit: "billing_period_unit", }); }), ); export function billingPeriodConfigToJSON( billingPeriodConfig: BillingPeriodConfig, ): string { return JSON.stringify( BillingPeriodConfig$outboundSchema.parse(billingPeriodConfig), ); }