/* * 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 { SubscriptionScheduleChangeType, SubscriptionScheduleChangeType$outboundSchema, } from "./subscription-schedule-change-type.js"; /** * Request to cancel a subscription schedule (supports two modes) */ export type CancelScheduleRequest = { /** * schedule_id is the ID of the schedule to cancel (optional if subscription_id and schedule_type are provided) */ scheduleId?: string | undefined; scheduleType?: SubscriptionScheduleChangeType | undefined; /** * subscription_id is the ID of the subscription (required if schedule_id is not provided) */ subscriptionId?: string | undefined; }; /** @internal */ export type CancelScheduleRequest$Outbound = { schedule_id?: string | undefined; schedule_type?: string | undefined; subscription_id?: string | undefined; }; /** @internal */ export const CancelScheduleRequest$outboundSchema: z.ZodMiniType< CancelScheduleRequest$Outbound, CancelScheduleRequest > = z.pipe( z.object({ scheduleId: z.optional(z.string()), scheduleType: z.optional(SubscriptionScheduleChangeType$outboundSchema), subscriptionId: z.optional(z.string()), }), z.transform((v) => { return remap$(v, { scheduleId: "schedule_id", scheduleType: "schedule_type", subscriptionId: "subscription_id", }); }), ); export function cancelScheduleRequestToJSON( cancelScheduleRequest: CancelScheduleRequest, ): string { return JSON.stringify( CancelScheduleRequest$outboundSchema.parse(cancelScheduleRequest), ); }