1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

support camel or pascal case in API responses

This commit is contained in:
Kyle Spearrin
2019-03-01 00:13:37 -05:00
parent 62e9c75357
commit 48164a31d9
43 changed files with 637 additions and 449 deletions

View File

@@ -1,4 +1,6 @@
export class CardApi {
import { BaseResponse } from '../response/baseResponse';
export class CardApi extends BaseResponse {
cardholderName: string;
brand: string;
number: string;
@@ -6,12 +8,16 @@ export class CardApi {
expYear: string;
code: string;
constructor(data: any) {
this.cardholderName = data.CardholderName;
this.brand = data.Brand;
this.number = data.Number;
this.expMonth = data.ExpMonth;
this.expYear = data.ExpYear;
this.code = data.Code;
constructor(data: any = null) {
super(data);
if (data == null) {
return;
}
this.cardholderName = this.getResponseProperty('CardholderName');
this.brand = this.getResponseProperty('Brand');
this.number = this.getResponseProperty('Number');
this.expMonth = this.getResponseProperty('ExpMonth');
this.expYear = this.getResponseProperty('ExpYear');
this.code = this.getResponseProperty('Code');
}
}