/* * 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"; export type SubscriptionUpdateBillingPeriod = { /** * Set a new date for the end of the current billing period. The subscription will renew on this date. The new date can be earlier or later than the current period end, as long as it's in the future. * * @remarks * * It is not possible to update the current billing period on a canceled subscription. */ currentBillingPeriodEnd: Date; }; /** @internal */ export type SubscriptionUpdateBillingPeriod$Outbound = { current_billing_period_end: string; }; /** @internal */ export const SubscriptionUpdateBillingPeriod$outboundSchema: z.ZodMiniType< SubscriptionUpdateBillingPeriod$Outbound, SubscriptionUpdateBillingPeriod > = z.pipe( z.object({ currentBillingPeriodEnd: z.pipe( z.date(), z.transform(v => v.toISOString()), ), }), z.transform((v) => { return remap$(v, { currentBillingPeriodEnd: "current_billing_period_end", }); }), ); export function subscriptionUpdateBillingPeriodToJSON( subscriptionUpdateBillingPeriod: SubscriptionUpdateBillingPeriod, ): string { return JSON.stringify( SubscriptionUpdateBillingPeriod$outboundSchema.parse( subscriptionUpdateBillingPeriod, ), ); }