1
0
mirror of https://github.com/bitwarden/cli synced 2026-01-09 03:33:13 +00:00

org collection create and get template

This commit is contained in:
Kyle Spearrin
2019-09-25 16:08:56 -04:00
parent 3915e43435
commit d2ef504b40
7 changed files with 83 additions and 3 deletions

View File

@@ -0,0 +1,16 @@
import { Collection } from 'jslib/models/export/collection';
import { SelectionReadOnly } from '../selectionReadOnly';
export class OrganizationCollectionRequest extends Collection {
static template(): OrganizationCollectionRequest {
const req = new OrganizationCollectionRequest();
req.organizationId = '00000000-0000-0000-0000-000000000000';
req.name = 'Collection name';
req.externalId = null;
req.groups = [SelectionReadOnly.template(), SelectionReadOnly.template()];
return req;
}
groups: SelectionReadOnly[];
}

View File

@@ -0,0 +1,14 @@
import { CollectionView } from 'jslib/models/view/collectionView';
import { SelectionReadOnly } from '../selectionReadOnly';
import { CollectionResponse } from './collectionResponse';
export class OrganizationCollectionResponse extends CollectionResponse {
groups: SelectionReadOnly[];
constructor(o: CollectionView, groups: SelectionReadOnly[]) {
super(o);
this.groups = groups;
}
}

View File

@@ -0,0 +1,13 @@
export class SelectionReadOnly {
static template(): SelectionReadOnly {
return new SelectionReadOnly('00000000-0000-0000-0000-000000000000', false);
}
id: string;
readOnly: boolean;
constructor(id: string, readOnly: boolean) {
this.id = id;
this.readOnly = readOnly;
}
}