1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

api adjustments and org additions

This commit is contained in:
Kyle Spearrin
2018-07-16 17:16:15 -04:00
parent b2c700ad28
commit 6b4ae1b8d5
3 changed files with 56 additions and 6 deletions

View File

@@ -0,0 +1,32 @@
import {
BillingChargeResponse,
BillingInvoiceResponse,
BillingSourceResponse,
BillingSubscriptionResponse,
} from './billingResponse';
import { OrganizationResponse } from './organizationResponse';
export class OrganizationBillingResponse extends OrganizationResponse {
storageName: string;
storageGb: number;
paymentSource: BillingSourceResponse;
subscription: BillingSubscriptionResponse;
upcomingInvoice: BillingInvoiceResponse;
charges: BillingChargeResponse[] = [];
expiration: Date;
constructor(response: any) {
super(response);
this.storageName = response.StorageName;
this.storageGb = response.StorageGb;
this.paymentSource = response.PaymentSource == null ? null : new BillingSourceResponse(response.PaymentSource);
this.subscription = response.Subscription == null ?
null : new BillingSubscriptionResponse(response.Subscription);
this.upcomingInvoice = response.UpcomingInvoice == null ?
null : new BillingInvoiceResponse(response.UpcomingInvoice);
if (response.Charges != null) {
this.charges = response.Charges.map((c: any) => new BillingChargeResponse(c));
}
this.expiration = response.Expiration;
}
}