1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00:00
Files
browser/src/models/response/organizationUserResponse.ts
Kyle Spearrin a6a0673af8 fix model bug
2018-07-10 14:43:59 -04:00

42 lines
1.2 KiB
TypeScript

import { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';
import { OrganizationUserType } from '../../enums/organizationUserType';
import { SelectionReadOnlyResponse } from './selectionReadOnlyResponse';
export class OrganizationUserResponse {
id: string;
userId: string;
type: OrganizationUserType;
status: OrganizationUserStatusType;
accessAll: boolean;
constructor(response: any) {
this.id = response.Id;
this.userId = response.UserId;
this.type = response.Type;
this.status = response.Status;
this.accessAll = response.AccessAll;
}
}
export class OrganizationUserUserDetailsResponse extends OrganizationUserResponse {
name: string;
email: string;
constructor(response: any) {
super(response);
this.name = response.Name;
this.email = response.Email;
}
}
export class OrganizationUserDetailsResponse extends OrganizationUserResponse {
collections: SelectionReadOnlyResponse[] = [];
constructor(response: any) {
super(response);
if (response.Collections != null) {
this.collections = response.Collections.map((c: any) => new SelectionReadOnlyResponse(c));
}
}
}