2018-07-12 14:11:31 +02:00
|
|
|
import { Deserializable } from '../deserializable.model';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The name and the type of a mediaFile.
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
export class File implements Deserializable {
|
2018-08-29 13:21:25 +02:00
|
|
|
public name: string;
|
|
|
|
public type: string;
|
2018-07-12 14:11:31 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Needs to be fully optional, because the 'mediafile'-property in the mediaFile class is optional as well
|
|
|
|
* @param name The name of the file
|
|
|
|
* @param type The tape (jpg, png, pdf)
|
|
|
|
*/
|
2018-08-29 13:21:25 +02:00
|
|
|
public constructor(name?: string, type?: string) {
|
2018-07-12 14:11:31 +02:00
|
|
|
this.name = name;
|
|
|
|
this.type = type;
|
|
|
|
}
|
|
|
|
|
2018-08-29 13:21:25 +02:00
|
|
|
public deserialize(input: any): this {
|
2018-07-12 14:11:31 +02:00
|
|
|
Object.assign(this, input);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|