forked from UoEMainLibrary/dspace-datashare-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbitstream.model.ts
More file actions
91 lines (80 loc) · 2.49 KB
/
Copy pathbitstream.model.ts
File metadata and controls
91 lines (80 loc) · 2.49 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import {
autoserialize,
deserialize,
inheritSerialization,
} from 'cerialize';
import { Observable } from 'rxjs';
import { AccessStatusObject } from '../../shared/object-collection/shared/badges/access-status-badge/access-status.model';
import { ACCESS_STATUS } from '../../shared/object-collection/shared/badges/access-status-badge/access-status.resource-type';
import {
link,
typedObject,
} from '../cache/builders/build-decorators';
import { RemoteData } from '../data/remote-data';
import { BITSTREAM } from './bitstream.resource-type';
import { BitstreamFormat } from './bitstream-format.model';
import { BITSTREAM_FORMAT } from './bitstream-format.resource-type';
import { Bundle } from './bundle.model';
import { BUNDLE } from './bundle.resource-type';
import { ChildHALResource } from './child-hal-resource.model';
import { DSpaceObject } from './dspace-object.model';
import { HALLink } from './hal-link.model';
@typedObject
@inheritSerialization(DSpaceObject)
export class Bitstream extends DSpaceObject implements ChildHALResource {
static type = BITSTREAM;
/**
* The size of this bitstream in bytes
*/
@autoserialize
sizeBytes: number;
/**
* The description of this Bitstream
*/
@autoserialize
description: string;
/**
* The name of the Bundle this Bitstream is part of
*/
@autoserialize
bundleName: string;
/**
* The {@link HALLink}s for this Bitstream
*/
@deserialize
_links: {
self: HALLink;
bundle: HALLink;
format: HALLink;
content: HALLink;
thumbnail: HALLink;
accessStatus: HALLink;
};
/**
* The thumbnail for this Bitstream
* Will be undefined unless the thumbnail {@link HALLink} has been resolved.
*/
@link(BITSTREAM, false, 'thumbnail')
thumbnail?: Observable<RemoteData<Bitstream>>;
/**
* The BitstreamFormat of this Bitstream
* Will be undefined unless the format {@link HALLink} has been resolved.
*/
@link(BITSTREAM_FORMAT, false, 'format')
format?: Observable<RemoteData<BitstreamFormat>>;
/**
* The owning bundle for this Bitstream
* Will be undefined unless the bundle{@link HALLink} has been resolved.
*/
@link(BUNDLE)
bundle?: Observable<RemoteData<Bundle>>;
/**
* The access status for this Bitstream
* Will be undefined unless the accessStatus {@link HALLink} has been resolved.
*/
@link(ACCESS_STATUS, false, 'accessStatus')
accessStatus?: Observable<RemoteData<AccessStatusObject>>;
getParentLinkKey(): keyof this['_links'] {
return 'format';
}
}