bitwarden-estensione-browser/common/src/models/view/collectionView.ts

30 lines
838 B
TypeScript
Raw Normal View History

2018-01-25 20:57:42 +01:00
import { View } from './view';
import { Collection } from '../domain/collection';
import { ITreeNodeObject } from '../domain/treeNode';
2018-01-25 20:57:42 +01:00
2019-09-25 23:12:13 +02:00
import { CollectionGroupDetailsResponse } from '../response/collectionResponse';
export class CollectionView implements View, ITreeNodeObject {
2019-01-25 15:30:21 +01:00
id: string = null;
organizationId: string = null;
name: string = null;
2019-03-07 21:17:58 +01:00
externalId: string = null;
2019-01-25 15:30:21 +01:00
readOnly: boolean = null;
hidePasswords: boolean = null;
2018-01-25 20:57:42 +01:00
2019-09-25 23:12:13 +02:00
constructor(c?: Collection | CollectionGroupDetailsResponse) {
2018-01-25 20:57:42 +01:00
if (!c) {
return;
}
this.id = c.id;
this.organizationId = c.organizationId;
2019-03-07 21:17:58 +01:00
this.externalId = c.externalId;
2019-09-25 23:12:13 +02:00
if (c instanceof Collection) {
this.readOnly = c.readOnly;
this.hidePasswords = c.hidePasswords;
2019-09-25 23:12:13 +02:00
}
2018-01-25 20:57:42 +01:00
}
}