import { Resource } from "../resource"; import { SavedStoreUserSubscription, StoreUserSubscription, APIUserSubscriptionRequest, APIUserSubscriptionResponse, SubscriptionType, SubscriptionStatus, StorePeriod, SavedStorePeriod } from "./interfaces"; import { Response } from "src/server"; export declare class UserSubscription extends Resource { /** * Status of the user subscription. */ status: SubscriptionStatus; /** * The discount applied to the user subscription. */ discount?: string | null; /** * Period of the user subscription. */ period?: StorePeriod | SavedStorePeriod; /** * The user subscription's type. */ subscriptionType: SubscriptionType; /** * An indicator on whether the user subscription is expired or not. */ isExpired?: boolean; /** * Interval in months for the user subscription. */ subscriptionInterval?: number; /** * Price of the user subscription at checkout. */ price?: number; /** * User id for the user subscription. */ userId: string; /** * Last time the user subscription was renewed. */ lastRenewal?: string | null; /** * Product id containing the subscription details. */ subscription: string; constructor(userId: string, subscriptionType: SubscriptionType, subscription: string, status: SubscriptionStatus, discount?: string | null, period?: StorePeriod | SavedStorePeriod, isExpired?: boolean, subscriptionInterval?: number, price?: number, lastRenewal?: string | null); /** * The name of the UserSubscription resource on the API server. */ static get resourceName(): string; /** * The name of the service containing the UserSubscription resource. */ static get serviceName(): string; /** * Convert the UserSubscription into a JSON serializable object for the API server. */ serializeAPI(): APIUserSubscriptionRequest; /** * Deserialize the data from the API server. * * @param data The UserSubscription data from the API server. */ deserializeAPI(data: APIUserSubscriptionResponse): void; /** * Serialize the userSubscription into a format for storing in the Redux store. */ serializeRedux(): SavedStoreUserSubscription; /** * Handle any http errors. * * @param response The response. * * @returns `null`. */ protected static handleError(response: Response): null; /** * Create a userSubscription from the API server data. * * @param data Data from the api server. * * @returns The userSubscription object. */ static apiFactory(data: APIUserSubscriptionResponse): UserSubscription; /** * Create a userSubscription from the Redux store data. * * @param data Data from the api server. * * @returns The UserSubscription object. */ static reduxFactory(data: StoreUserSubscription): UserSubscription; /** * Convert the Period to camel case. */ private static convertPeriodToCamelCase; }