UNPKG

@paritydeals/node-sdk

Version:

Node.js SDK for interacting with the ParityDeals API.

42 lines 2.33 kB
import type { ParityDeals } from './client'; import { CancelSubscriptionPayload, // Interface defines the structure for 'params' in cancel CancelSubscriptionResponse, UpdateSubscriptionPayload, // Interface defines the structure for 'params' in update UpdateSubscriptionResponse } from './models'; /** * Handles 'subscription' related API operations. * This class is instantiated by the ParityDeals client and accessed * via `client.subscription`. All methods are asynchronous. */ export declare class SubscriptionOperations { private client; constructor(client: ParityDeals); /** * Cancels an active subscription. * @param params - Parameters for cancelling a subscription, matching CancelSubscriptionPayload. * - subscriptionId: string - The ID of the subscription to cancel (used in URL path). * - cancellationType: CancellationType - When the cancellation should take effect. * - cancellationDate?: string | null - Required if cancellationType is "SPECIFIC_DATE" (YYYY-MM-DD). * @returns A Promise resolving to CancelSubscriptionResponse. */ cancel(params: { subscriptionId: string; } & CancelSubscriptionPayload): Promise<CancelSubscriptionResponse>; /** * Updates an existing subscription. * @param params - Parameters for updating a subscription, matching UpdateSubscriptionPayload plus subscriptionId. * - subscriptionId: string - The ID of the subscription to update (used in URL path). * - planIdentifier: string - Identifier of the new plan. * - chargePeriod: ChargePeriod - The new charging period. * - probationBehaviour?: ProbationBehaviour | null - Optional probation behaviour. * - offeringId?: string | null - Optional ID of the new offering. * - pricingTableId?: string | null - Optional ID of the new pricingTable. * - ruleId?: string | null - Optional ID of the new pricing rule. * - features?: FeatureListItem[] | null - Optional list of features and their quantities. * - ipAddress?: string | null - Optional IP address of the customer. * @returns A Promise resolving to UpdateSubscriptionResponse. */ update(params: { subscriptionId: string; } & UpdateSubscriptionPayload): Promise<UpdateSubscriptionResponse>; } //# sourceMappingURL=subscription.d.ts.map