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,7 +1,9 @@
import { BaseResponse } from './baseResponse';
import { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';
import { OrganizationUserType } from '../../enums/organizationUserType';
export class ProfileOrganizationResponse {
export class ProfileOrganizationResponse extends BaseResponse {
id: string;
name: string;
useGroups: boolean;
@@ -20,21 +22,22 @@ export class ProfileOrganizationResponse {
enabled: boolean;
constructor(response: any) {
this.id = response.Id;
this.name = response.Name;
this.useGroups = response.UseGroups;
this.useDirectory = response.UseDirectory;
this.useEvents = response.UseEvents;
this.useTotp = response.UseTotp;
this.use2fa = response.Use2fa;
this.selfHost = response.SelfHost;
this.usersGetPremium = response.UsersGetPremium;
this.seats = response.Seats;
this.maxCollections = response.MaxCollections;
this.maxStorageGb = response.MaxStorageGb;
this.key = response.Key;
this.status = response.Status;
this.type = response.Type;
this.enabled = response.Enabled;
super(response);
this.id = this.getResponseProperty('Id');
this.name = this.getResponseProperty('Name');
this.useGroups = this.getResponseProperty('UseGroups');
this.useDirectory = this.getResponseProperty('UseDirectory');
this.useEvents = this.getResponseProperty('UseEvents');
this.useTotp = this.getResponseProperty('UseTotp');
this.use2fa = this.getResponseProperty('Use2fa');
this.selfHost = this.getResponseProperty('SelfHost');
this.usersGetPremium = this.getResponseProperty('UsersGetPremium');
this.seats = this.getResponseProperty('Seats');
this.maxCollections = this.getResponseProperty('MaxCollections');
this.maxStorageGb = this.getResponseProperty('MaxStorageGb');
this.key = this.getResponseProperty('Key');
this.status = this.getResponseProperty('Status');
this.type = this.getResponseProperty('Type');
this.enabled = this.getResponseProperty('Enabled');
}
}