/* tslint:disable */
/* eslint-disable */
/**
 * Montelo
 * Documentation for the Montelo API.
 *
 * The version of the OpenAPI document: 1.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { exists, mapValues } from '../runtime';
/**
 * 
 * @export
 * @interface SubscriptionDto
 */
export interface SubscriptionDto {
    /**
     * 
     * @type {string}
     * @memberof SubscriptionDto
     */
    id: string;
    /**
     * 
     * @type {string}
     * @memberof SubscriptionDto
     */
    userId?: string;
    /**
     * 
     * @type {string}
     * @memberof SubscriptionDto
     */
    orgId?: string;
    /**
     * 
     * @type {string}
     * @memberof SubscriptionDto
     */
    stripeCustomerId: string;
    /**
     * 
     * @type {string}
     * @memberof SubscriptionDto
     */
    plan: string;
    /**
     * 
     * @type {string}
     * @memberof SubscriptionDto
     */
    stripeSubscriptionId?: string;
    /**
     * 
     * @type {object}
     * @memberof SubscriptionDto
     */
    details?: object;
    /**
     * 
     * @type {string}
     * @memberof SubscriptionDto
     */
    createdAt: string;
    /**
     * 
     * @type {string}
     * @memberof SubscriptionDto
     */
    updatedAt: string;
}

/**
 * Check if a given object implements the SubscriptionDto interface.
 */
export function instanceOfSubscriptionDto(value: object): boolean {
    let isInstance = true;
    isInstance = isInstance && "id" in value;
    isInstance = isInstance && "stripeCustomerId" in value;
    isInstance = isInstance && "plan" in value;
    isInstance = isInstance && "createdAt" in value;
    isInstance = isInstance && "updatedAt" in value;

    return isInstance;
}

export function SubscriptionDtoFromJSON(json: any): SubscriptionDto {
    return SubscriptionDtoFromJSONTyped(json, false);
}

export function SubscriptionDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionDto {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'id': json['id'],
        'userId': !exists(json, 'userId') ? undefined : json['userId'],
        'orgId': !exists(json, 'orgId') ? undefined : json['orgId'],
        'stripeCustomerId': json['stripeCustomerId'],
        'plan': json['plan'],
        'stripeSubscriptionId': !exists(json, 'stripeSubscriptionId') ? undefined : json['stripeSubscriptionId'],
        'details': !exists(json, 'details') ? undefined : json['details'],
        'createdAt': json['createdAt'],
        'updatedAt': json['updatedAt'],
    };
}

export function SubscriptionDtoToJSON(value?: SubscriptionDto | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'id': value.id,
        'userId': value.userId,
        'orgId': value.orgId,
        'stripeCustomerId': value.stripeCustomerId,
        'plan': value.plan,
        'stripeSubscriptionId': value.stripeSubscriptionId,
        'details': value.details,
        'createdAt': value.createdAt,
        'updatedAt': value.updatedAt,
    };
}

