/* * 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 { ProrationBehavior, ProrationBehavior$outboundSchema, } from "./proration-behavior.js"; export type RemoveAddonRequest = { addonAssociationId: string; /** * EffectiveDate defaults to period end when nil; mid-period with create_prorations issues a wallet credit. */ effectiveDate?: Date | undefined; prorationBehavior?: ProrationBehavior | undefined; reason?: string | undefined; }; /** @internal */ export type RemoveAddonRequest$Outbound = { addon_association_id: string; effective_date?: string | undefined; proration_behavior?: string | undefined; reason?: string | undefined; }; /** @internal */ export const RemoveAddonRequest$outboundSchema: z.ZodMiniType< RemoveAddonRequest$Outbound, RemoveAddonRequest > = z.pipe( z.object({ addonAssociationId: z.string(), effectiveDate: z.optional( z.pipe(z.date(), z.transform(v => v.toISOString())), ), prorationBehavior: z.optional(ProrationBehavior$outboundSchema), reason: z.optional(z.string()), }), z.transform((v) => { return remap$(v, { addonAssociationId: "addon_association_id", effectiveDate: "effective_date", prorationBehavior: "proration_behavior", }); }), ); export function removeAddonRequestToJSON( removeAddonRequest: RemoveAddonRequest, ): string { return JSON.stringify( RemoveAddonRequest$outboundSchema.parse(removeAddonRequest), ); }