chargebee-typescript
Version:
A library in typescript for integrating with Chargebee.
245 lines (244 loc) • 8.05 kB
TypeScript
import { ListResult } from '../list_result';
import { RequestWrapper } from "../request_wrapper";
import { Model } from "./model";
import { filter } from "../filter";
export declare class Coupon extends Model {
id: string;
name: string;
invoice_name?: string;
discount_type: string;
discount_percentage?: number;
discount_amount?: number;
discount_quantity?: number;
currency_code?: string;
duration_type: string;
duration_month?: number;
valid_from?: number;
valid_till?: number;
max_redemptions?: number;
status?: string;
apply_discount_on: string;
apply_on: string;
plan_constraint: string;
addon_constraint: string;
created_at: number;
archived_at?: number;
resource_version?: number;
updated_at?: number;
included_in_mrr?: boolean;
period?: number;
period_unit?: string;
plan_ids?: Array<string>;
addon_ids?: Array<string>;
item_constraints?: Array<ItemConstraint>;
item_constraint_criteria?: Array<ItemConstraintCriteria>;
redemptions?: number;
invoice_notes?: string;
meta_data?: any;
coupon_constraints?: Array<CouponConstraint>;
deleted: boolean;
static create(params?: _coupon.create_params): RequestWrapper;
static create_for_items(params?: _coupon.create_for_items_params): RequestWrapper;
static update_for_items(coupon_id: string, params?: _coupon.update_for_items_params): RequestWrapper;
static list(params?: _coupon.coupon_list_params): RequestWrapper<ListResult>;
static retrieve(coupon_id: string, params?: any): RequestWrapper;
static update(coupon_id: string, params?: _coupon.update_params): RequestWrapper;
static delete(coupon_id: string, params?: any): RequestWrapper;
static copy(params?: _coupon.copy_params): RequestWrapper;
static unarchive(coupon_id: string, params?: any): RequestWrapper;
}
export declare class ItemConstraint extends Model {
item_type: string;
constraint: string;
item_price_ids?: any;
}
export declare class ItemConstraintCriteria extends Model {
item_type: string;
currencies?: any;
item_family_ids?: any;
item_price_periods?: any;
}
export declare class CouponConstraint extends Model {
entity_type: string;
type: string;
value?: string;
}
export declare namespace _coupon {
interface create_params {
id: string;
name: string;
invoice_name?: string;
discount_type?: string;
discount_amount?: number;
currency_code?: string;
discount_percentage?: number;
discount_quantity?: number;
apply_on: string;
duration_type?: string;
duration_month?: number;
valid_till?: number;
max_redemptions?: number;
invoice_notes?: string;
meta_data?: any;
included_in_mrr?: boolean;
period?: number;
period_unit?: string;
plan_constraint?: string;
addon_constraint?: string;
plan_ids?: Array<string>;
addon_ids?: Array<string>;
status?: string;
}
interface create_for_items_params {
id: string;
name: string;
invoice_name?: string;
discount_type?: string;
discount_amount?: number;
currency_code?: string;
discount_percentage?: number;
discount_quantity?: number;
apply_on: string;
duration_type?: string;
duration_month?: number;
valid_from?: number;
valid_till?: number;
max_redemptions?: number;
invoice_notes?: string;
meta_data?: any;
included_in_mrr?: boolean;
period?: number;
period_unit?: string;
status?: string;
item_constraints?: Array<item_constraints_create_for_items_params>;
item_constraint_criteria?: Array<item_constraint_criteria_create_for_items_params>;
coupon_constraints?: Array<coupon_constraints_create_for_items_params>;
}
interface update_for_items_params {
name?: string;
invoice_name?: string;
discount_type?: string;
discount_amount?: number;
currency_code?: string;
discount_percentage?: number;
discount_quantity?: number;
apply_on?: string;
duration_type?: string;
duration_month?: number;
valid_from?: number;
valid_till?: number;
max_redemptions?: number;
invoice_notes?: string;
meta_data?: any;
included_in_mrr?: boolean;
period?: number;
period_unit?: string;
item_constraints?: Array<item_constraints_update_for_items_params>;
item_constraint_criteria?: Array<item_constraint_criteria_update_for_items_params>;
coupon_constraints?: Array<coupon_constraints_update_for_items_params>;
}
interface coupon_list_params {
limit?: number;
offset?: string;
id?: filter._string;
name?: filter._string;
discount_type?: filter._enum;
duration_type?: filter._enum;
status?: filter._enum;
apply_on?: filter._enum;
created_at?: filter._timestamp;
updated_at?: filter._timestamp;
currency_code?: filter._string;
"sort_by[asc]"?: string;
"sort_by[desc]"?: string;
}
interface update_params {
name?: string;
invoice_name?: string;
discount_type?: string;
discount_amount?: number;
currency_code?: string;
discount_percentage?: number;
discount_quantity?: number;
apply_on?: string;
duration_type?: string;
duration_month?: number;
valid_till?: number;
max_redemptions?: number;
invoice_notes?: string;
meta_data?: any;
included_in_mrr?: boolean;
period?: number;
period_unit?: string;
plan_constraint?: string;
addon_constraint?: string;
plan_ids?: Array<string>;
addon_ids?: Array<string>;
}
interface copy_params {
from_site: string;
id_at_from_site: string;
id?: string;
for_site_merging?: boolean;
}
interface item_constraints_create_for_items_params {
constraint: string;
}
interface item_constraints_create_for_items_params {
item_type: string;
}
interface item_constraints_create_for_items_params {
item_price_ids?: any;
}
interface item_constraint_criteria_create_for_items_params {
item_type?: string;
}
interface item_constraint_criteria_create_for_items_params {
item_family_ids?: any;
}
interface item_constraint_criteria_create_for_items_params {
currencies?: any;
}
interface item_constraint_criteria_create_for_items_params {
item_price_periods?: any;
}
interface coupon_constraints_create_for_items_params {
entity_type: string;
}
interface coupon_constraints_create_for_items_params {
type: string;
}
interface coupon_constraints_create_for_items_params {
value?: string;
}
interface item_constraints_update_for_items_params {
constraint: string;
}
interface item_constraints_update_for_items_params {
item_type: string;
}
interface item_constraints_update_for_items_params {
item_price_ids?: any;
}
interface item_constraint_criteria_update_for_items_params {
item_type?: string;
}
interface item_constraint_criteria_update_for_items_params {
item_family_ids?: any;
}
interface item_constraint_criteria_update_for_items_params {
currencies?: any;
}
interface item_constraint_criteria_update_for_items_params {
item_price_periods?: any;
}
interface coupon_constraints_update_for_items_params {
entity_type: string;
}
interface coupon_constraints_update_for_items_params {
type: string;
}
interface coupon_constraints_update_for_items_params {
value?: string;
}
}