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

org user apis, sort function utils

This commit is contained in:
Kyle Spearrin
2018-07-06 15:00:55 -04:00
parent e25ad93082
commit 7b23b90054
7 changed files with 87 additions and 37 deletions

View File

@@ -0,0 +1,41 @@
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));
}
}
}