/* tslint:disable */
/* eslint-disable */
/**
 * Tribufu API
 * REST API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.1.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 Subscription
 */
export interface Subscription {
    /**
     * 
     * @type {string}
     * @memberof Subscription
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof Subscription
     */
    name?: string | null;
    /**
     * 
     * @type {string}
     * @memberof Subscription
     */
    description?: string | null;
    /**
     * 
     * @type {string}
     * @memberof Subscription
     */
    imageUrl?: string | null;
    /**
     * 
     * @type {{ [key: string]: number; }}
     * @memberof Subscription
     */
    readonly prices?: { [key: string]: number; } | null;
    /**
     * 
     * @type {Date}
     * @memberof Subscription
     */
    created?: Date;
    /**
     * 
     * @type {Date}
     * @memberof Subscription
     */
    updated?: Date | null;
}

/**
 * Check if a given object implements the Subscription interface.
 */
export function instanceOfSubscription(value: object): value is Subscription {
    return true;
}

export function SubscriptionFromJSON(json: any): Subscription {
    return SubscriptionFromJSONTyped(json, false);
}

export function SubscriptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Subscription {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'name': json['name'] == null ? undefined : json['name'],
        'description': json['description'] == null ? undefined : json['description'],
        'imageUrl': json['image_url'] == null ? undefined : json['image_url'],
        'prices': json['prices'] == null ? undefined : json['prices'],
        'created': json['created'] == null ? undefined : (new Date(json['created'])),
        'updated': json['updated'] == null ? undefined : (new Date(json['updated'])),
    };
}

export function SubscriptionToJSON(json: any): Subscription {
    return SubscriptionToJSONTyped(json, false);
}

export function SubscriptionToJSONTyped(value?: Omit<Subscription, 'prices'> | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'id': value['id'],
        'name': value['name'],
        'description': value['description'],
        'image_url': value['imageUrl'],
        'created': value['created'] == null ? undefined : ((value['created']).toISOString()),
        'updated': value['updated'] == null ? undefined : ((value['updated'] as any).toISOString()),
    };
}

