/* tslint:disable */
/* eslint-disable */
/**
 * zrok
 * zrok client access
 *
 * The version of the OpenAPI document: 0.3.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';
import type { SparkDataSample } from './SparkDataSample';
import {
    SparkDataSampleFromJSON,
    SparkDataSampleFromJSONTyped,
    SparkDataSampleToJSON,
} from './SparkDataSample';

/**
 * 
 * @export
 * @interface Share
 */
export interface Share {
    /**
     * 
     * @type {string}
     * @memberof Share
     */
    token?: string;
    /**
     * 
     * @type {string}
     * @memberof Share
     */
    zId?: string;
    /**
     * 
     * @type {string}
     * @memberof Share
     */
    shareMode?: string;
    /**
     * 
     * @type {string}
     * @memberof Share
     */
    backendMode?: string;
    /**
     * 
     * @type {string}
     * @memberof Share
     */
    frontendSelection?: string;
    /**
     * 
     * @type {string}
     * @memberof Share
     */
    frontendEndpoint?: string;
    /**
     * 
     * @type {string}
     * @memberof Share
     */
    backendProxyEndpoint?: string;
    /**
     * 
     * @type {boolean}
     * @memberof Share
     */
    reserved?: boolean;
    /**
     * 
     * @type {Array<SparkDataSample>}
     * @memberof Share
     */
    activity?: Array<SparkDataSample>;
    /**
     * 
     * @type {boolean}
     * @memberof Share
     */
    limited?: boolean;
    /**
     * 
     * @type {number}
     * @memberof Share
     */
    createdAt?: number;
    /**
     * 
     * @type {number}
     * @memberof Share
     */
    updatedAt?: number;
}

/**
 * Check if a given object implements the Share interface.
 */
export function instanceOfShare(value: object): boolean {
    let isInstance = true;

    return isInstance;
}

export function ShareFromJSON(json: any): Share {
    return ShareFromJSONTyped(json, false);
}

export function ShareFromJSONTyped(json: any, ignoreDiscriminator: boolean): Share {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'token': !exists(json, 'token') ? undefined : json['token'],
        'zId': !exists(json, 'zId') ? undefined : json['zId'],
        'shareMode': !exists(json, 'shareMode') ? undefined : json['shareMode'],
        'backendMode': !exists(json, 'backendMode') ? undefined : json['backendMode'],
        'frontendSelection': !exists(json, 'frontendSelection') ? undefined : json['frontendSelection'],
        'frontendEndpoint': !exists(json, 'frontendEndpoint') ? undefined : json['frontendEndpoint'],
        'backendProxyEndpoint': !exists(json, 'backendProxyEndpoint') ? undefined : json['backendProxyEndpoint'],
        'reserved': !exists(json, 'reserved') ? undefined : json['reserved'],
        'activity': !exists(json, 'activity') ? undefined : ((json['activity'] as Array<any>).map(SparkDataSampleFromJSON)),
        'limited': !exists(json, 'limited') ? undefined : json['limited'],
        'createdAt': !exists(json, 'createdAt') ? undefined : json['createdAt'],
        'updatedAt': !exists(json, 'updatedAt') ? undefined : json['updatedAt'],
    };
}

export function ShareToJSON(value?: Share | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'token': value.token,
        'zId': value.zId,
        'shareMode': value.shareMode,
        'backendMode': value.backendMode,
        'frontendSelection': value.frontendSelection,
        'frontendEndpoint': value.frontendEndpoint,
        'backendProxyEndpoint': value.backendProxyEndpoint,
        'reserved': value.reserved,
        'activity': value.activity === undefined ? undefined : ((value.activity as Array<any>).map(SparkDataSampleToJSON)),
        'limited': value.limited,
        'createdAt': value.createdAt,
        'updatedAt': value.updatedAt,
    };
}

