1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-31 23:53:37 +00:00
Files
browser/common/src/models/response/groupResponse.ts
Oscar Hinton 1016bbfb9e Split jslib into multiple modules (#363)
* Split jslib into multiple modules
2021-06-03 18:58:57 +02:00

32 lines
1.0 KiB
TypeScript

import { BaseResponse } from './baseResponse';
import { SelectionReadOnlyResponse } from './selectionReadOnlyResponse';
export class GroupResponse extends BaseResponse {
id: string;
organizationId: string;
name: string;
accessAll: boolean;
externalId: string;
constructor(response: any) {
super(response);
this.id = this.getResponseProperty('Id');
this.organizationId = this.getResponseProperty('OrganizationId');
this.name = this.getResponseProperty('Name');
this.accessAll = this.getResponseProperty('AccessAll');
this.externalId = this.getResponseProperty('ExternalId');
}
}
export class GroupDetailsResponse extends GroupResponse {
collections: SelectionReadOnlyResponse[] = [];
constructor(response: any) {
super(response);
const collections = this.getResponseProperty('Collections');
if (collections != null) {
this.collections = collections.map((c: any) => new SelectionReadOnlyResponse(c));
}
}
}