File
Extends
AbstractEntity
class File extends AbstractEntity
Static
create
static create(json = null): File
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
json | object | Yes | - | |
json.id | null | int | symbol | No | null |
Returns:
Type: File
getName
static getName(): "File"
Returns:
Type: constant ("File": string)
Constructor
constructor
constructor(json = null): File
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
json | null | object | No | null | Used to constructor from a JSON representation. See fromJSON |
Properties
content_hash
Type | Default | Description |
---|---|---|
string | null | null |
Read-Only
context
Type | Default | Description |
---|---|---|
enum(FILE_CONTEXTS) | FILE_CONTEXTS.DEFAULT |
file_type
Type | Default | Description |
---|---|---|
string | null | null |
id
Type | Default | Description |
---|---|---|
null | int | symbol | null | The entity identifier |
metadata
Type | Default | Description |
---|---|---|
Map | new Map() |
name
Type | Default | Description |
---|---|---|
string | null |
reference
Type | Default | Description |
---|---|---|
string | null | null |
site
Type | Default | Description |
---|---|---|
Reference<Site> | new Reference('Site', null) |
uri
Type | Default | Description |
---|---|---|
string | null | null |
Methods
toJSON
toJSON(): object
Returns:
Type: object (see properties bellow)
Name | Type | Description |
---|---|---|
content_hash | string | null | |
context | string | See FILE_CONTEXTS |
file_type | string | null | |
id | int | symbol | null | |
metadata | object | |
name | string | null | |
reference | string | null | |
site | int | symbol | null | |
uri | string | null |
fromJSON
fromJSON(json: object): File
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
json | object | Yes | - | |
json.content_hash | string | null | No | null | |
json.context | string | No | 'default' | See FILE_CONTEXTS |
json.file_type | string | null | No | null | |
json.id | int | symbol | null | No | null | |
json.metadata | object | No | {} | |
json.name | string | null | No | null | |
json.reference | string | null | No | null | |
json.site | int | symbol | null | No | null | |
json.uri | string | null | No | null |
Returns:
Returns this
clone
clone(): File
Returns:
A new deep copy
Type: File