/* 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';
import type { ApplicationType } from './ApplicationType';
import {
    ApplicationTypeFromJSON,
    ApplicationTypeFromJSONTyped,
    ApplicationTypeToJSON,
    ApplicationTypeToJSONTyped,
} from './ApplicationType';

/**
 * 
 * @export
 * @interface Application
 */
export interface Application {
    /**
     * 
     * @type {string}
     * @memberof Application
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof Application
     */
    name: string | null;
    /**
     * 
     * @type {string}
     * @memberof Application
     */
    description?: string | null;
    /**
     * 
     * @type {ApplicationType}
     * @memberof Application
     */
    type?: ApplicationType;
    /**
     * 
     * @type {string}
     * @memberof Application
     */
    organizationId?: string | null;
    /**
     * 
     * @type {string}
     * @memberof Application
     */
    iconUrl?: string | null;
    /**
     * 
     * @type {string}
     * @memberof Application
     */
    bannerUrl?: string | null;
    /**
     * 
     * @type {string}
     * @memberof Application
     */
    capsuleImageUrl?: string | null;
    /**
     * 
     * @type {string}
     * @memberof Application
     */
    libraryImageUrl?: string | null;
    /**
     * 
     * @type {string}
     * @memberof Application
     */
    slug?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof Application
     */
    created?: Date;
    /**
     * 
     * @type {Date}
     * @memberof Application
     */
    updated?: Date | null;
}



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

export function ApplicationFromJSON(json: any): Application {
    return ApplicationFromJSONTyped(json, false);
}

export function ApplicationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Application {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'name': json['name'],
        'description': json['description'] == null ? undefined : json['description'],
        'type': json['type'] == null ? undefined : ApplicationTypeFromJSON(json['type']),
        'organizationId': json['organization_id'] == null ? undefined : json['organization_id'],
        'iconUrl': json['icon_url'] == null ? undefined : json['icon_url'],
        'bannerUrl': json['banner_url'] == null ? undefined : json['banner_url'],
        'capsuleImageUrl': json['capsule_image_url'] == null ? undefined : json['capsule_image_url'],
        'libraryImageUrl': json['library_image_url'] == null ? undefined : json['library_image_url'],
        'slug': json['slug'] == null ? undefined : json['slug'],
        'created': json['created'] == null ? undefined : (new Date(json['created'])),
        'updated': json['updated'] == null ? undefined : (new Date(json['updated'])),
    };
}

export function ApplicationToJSON(json: any): Application {
    return ApplicationToJSONTyped(json, false);
}

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

    return {
        
        'id': value['id'],
        'name': value['name'],
        'description': value['description'],
        'type': ApplicationTypeToJSON(value['type']),
        'organization_id': value['organizationId'],
        'icon_url': value['iconUrl'],
        'banner_url': value['bannerUrl'],
        'capsule_image_url': value['capsuleImageUrl'],
        'library_image_url': value['libraryImageUrl'],
        'slug': value['slug'],
        'created': value['created'] == null ? undefined : ((value['created']).toISOString()),
        'updated': value['updated'] == null ? undefined : ((value['updated'] as any).toISOString()),
    };
}

