/* tslint:disable */
/* eslint-disable */
/**
 * Tribufu API
 * API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.3.0
 * Contact: contact@tribufu.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { mapValues } from '../runtime';
/**
 * 
 * @export
 * @interface StorageFile
 */
export interface StorageFile {
    /**
     * 
     * @type {string}
     * @memberof StorageFile
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof StorageFile
     */
    name: string | null;
    /**
     * 
     * @type {string}
     * @memberof StorageFile
     */
    contentType: string | null;
    /**
     * 
     * @type {string}
     * @memberof StorageFile
     */
    url: string | null;
    /**
     * 
     * @type {number}
     * @memberof StorageFile
     */
    size?: number;
    /**
     * 
     * @type {string}
     * @memberof StorageFile
     */
    hash?: string | null;
    /**
     * 
     * @type {string}
     * @memberof StorageFile
     */
    etag?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof StorageFile
     */
    created?: Date;
    /**
     * 
     * @type {Date}
     * @memberof StorageFile
     */
    updated?: Date | null;
}

/**
 * Check if a given object implements the StorageFile interface.
 */
export function instanceOfStorageFile(value: object): value is StorageFile {
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('contentType' in value) || value['contentType'] === undefined) return false;
    if (!('url' in value) || value['url'] === undefined) return false;
    return true;
}

export function StorageFileFromJSON(json: any): StorageFile {
    return StorageFileFromJSONTyped(json, false);
}

export function StorageFileFromJSONTyped(json: any, ignoreDiscriminator: boolean): StorageFile {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'name': json['name'],
        'contentType': json['content_type'],
        'url': json['url'],
        'size': json['size'] == null ? undefined : json['size'],
        'hash': json['hash'] == null ? undefined : json['hash'],
        'etag': json['etag'] == null ? undefined : json['etag'],
        'created': json['created'] == null ? undefined : (new Date(json['created'])),
        'updated': json['updated'] == null ? undefined : (new Date(json['updated'])),
    };
}

export function StorageFileToJSON(json: any): StorageFile {
    return StorageFileToJSONTyped(json, false);
}

export function StorageFileToJSONTyped(value?: StorageFile | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'id': value['id'],
        'name': value['name'],
        'content_type': value['contentType'],
        'url': value['url'],
        'size': value['size'],
        'hash': value['hash'],
        'etag': value['etag'],
        'created': value['created'] == null ? undefined : ((value['created']).toISOString()),
        'updated': value['updated'] == null ? undefined : ((value['updated'] as any).toISOString()),
    };
}

