-
Notifications
You must be signed in to change notification settings - Fork 8
/
FileCriteria.ts
75 lines (68 loc) · 1.77 KB
/
FileCriteria.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
export class FileSearchCriteria {
constructor(
public readonly contentType?: string,
public readonly accessStatus?: FileAccessStatus,
public readonly categoryName?: string,
public readonly tabularTagName?: string,
public readonly searchText?: string
) {}
withContentType(contentType: string | undefined): FileSearchCriteria {
return new FileSearchCriteria(
contentType,
this.accessStatus,
this.categoryName,
this.tabularTagName,
this.searchText
)
}
withAccessStatus(accessStatus: FileAccessStatus | undefined): FileSearchCriteria {
return new FileSearchCriteria(
this.contentType,
accessStatus,
this.categoryName,
this.tabularTagName,
this.searchText
)
}
withCategoryName(categoryName: string | undefined): FileSearchCriteria {
return new FileSearchCriteria(
this.contentType,
this.accessStatus,
categoryName,
this.tabularTagName,
this.searchText
)
}
withTabularTagName(tabularTagName: string | undefined): FileSearchCriteria {
return new FileSearchCriteria(
this.contentType,
this.accessStatus,
this.categoryName,
tabularTagName,
this.searchText
)
}
withSearchText(searchText: string | undefined): FileSearchCriteria {
return new FileSearchCriteria(
this.contentType,
this.accessStatus,
this.categoryName,
this.tabularTagName,
searchText
)
}
}
export enum FileOrderCriteria {
NAME_AZ = 'NameAZ',
NAME_ZA = 'NameZA',
NEWEST = 'Newest',
OLDEST = 'Oldest',
SIZE = 'Size',
TYPE = 'Type'
}
export enum FileAccessStatus {
PUBLIC = 'Public',
RESTRICTED = 'Restricted',
EMBARGOED = 'EmbargoedThenPublic',
EMBARGOED_RESTRICTED = 'EmbargoedThenRestricted'
}