/* tslint:disable */
/* eslint-disable */
/**
 * Jellyfin API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 10.8.9
 * 
 *
 * 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 { ChannelItemSortField } from './ChannelItemSortField';
import {
    ChannelItemSortFieldFromJSON,
    ChannelItemSortFieldFromJSONTyped,
    ChannelItemSortFieldToJSON,
} from './ChannelItemSortField';
import type { ChannelMediaContentType } from './ChannelMediaContentType';
import {
    ChannelMediaContentTypeFromJSON,
    ChannelMediaContentTypeFromJSONTyped,
    ChannelMediaContentTypeToJSON,
} from './ChannelMediaContentType';
import type { ChannelMediaType } from './ChannelMediaType';
import {
    ChannelMediaTypeFromJSON,
    ChannelMediaTypeFromJSONTyped,
    ChannelMediaTypeToJSON,
} from './ChannelMediaType';

/**
 * 
 * @export
 * @interface ChannelFeatures
 */
export interface ChannelFeatures {
    /**
     * Gets or sets the name.
     * @type {string}
     * @memberof ChannelFeatures
     */
    name?: string;
    /**
     * Gets or sets the identifier.
     * @type {string}
     * @memberof ChannelFeatures
     */
    id?: string;
    /**
     * Gets or sets a value indicating whether this instance can search.
     * @type {boolean}
     * @memberof ChannelFeatures
     */
    canSearch?: boolean;
    /**
     * Gets or sets the media types.
     * @type {Array<ChannelMediaType>}
     * @memberof ChannelFeatures
     */
    mediaTypes?: Array<ChannelMediaType>;
    /**
     * Gets or sets the content types.
     * @type {Array<ChannelMediaContentType>}
     * @memberof ChannelFeatures
     */
    contentTypes?: Array<ChannelMediaContentType>;
    /**
     * Gets or sets the maximum number of records the channel allows retrieving at a time.
     * @type {number}
     * @memberof ChannelFeatures
     */
    maxPageSize?: number | null;
    /**
     * Gets or sets the automatic refresh levels.
     * @type {number}
     * @memberof ChannelFeatures
     */
    autoRefreshLevels?: number | null;
    /**
     * Gets or sets the default sort orders.
     * @type {Array<ChannelItemSortField>}
     * @memberof ChannelFeatures
     */
    defaultSortFields?: Array<ChannelItemSortField>;
    /**
     * Gets or sets a value indicating whether a sort ascending/descending toggle is supported.
     * @type {boolean}
     * @memberof ChannelFeatures
     */
    supportsSortOrderToggle?: boolean;
    /**
     * Gets or sets a value indicating whether [supports latest media].
     * @type {boolean}
     * @memberof ChannelFeatures
     */
    supportsLatestMedia?: boolean;
    /**
     * Gets or sets a value indicating whether this instance can filter.
     * @type {boolean}
     * @memberof ChannelFeatures
     */
    canFilter?: boolean;
    /**
     * Gets or sets a value indicating whether [supports content downloading].
     * @type {boolean}
     * @memberof ChannelFeatures
     */
    supportsContentDownloading?: boolean;
}

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

    return isInstance;
}

export function ChannelFeaturesFromJSON(json: any): ChannelFeatures {
    return ChannelFeaturesFromJSONTyped(json, false);
}

export function ChannelFeaturesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChannelFeatures {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'name': !exists(json, 'Name') ? undefined : json['Name'],
        'id': !exists(json, 'Id') ? undefined : json['Id'],
        'canSearch': !exists(json, 'CanSearch') ? undefined : json['CanSearch'],
        'mediaTypes': !exists(json, 'MediaTypes') ? undefined : ((json['MediaTypes'] as Array<any>).map(ChannelMediaTypeFromJSON)),
        'contentTypes': !exists(json, 'ContentTypes') ? undefined : ((json['ContentTypes'] as Array<any>).map(ChannelMediaContentTypeFromJSON)),
        'maxPageSize': !exists(json, 'MaxPageSize') ? undefined : json['MaxPageSize'],
        'autoRefreshLevels': !exists(json, 'AutoRefreshLevels') ? undefined : json['AutoRefreshLevels'],
        'defaultSortFields': !exists(json, 'DefaultSortFields') ? undefined : ((json['DefaultSortFields'] as Array<any>).map(ChannelItemSortFieldFromJSON)),
        'supportsSortOrderToggle': !exists(json, 'SupportsSortOrderToggle') ? undefined : json['SupportsSortOrderToggle'],
        'supportsLatestMedia': !exists(json, 'SupportsLatestMedia') ? undefined : json['SupportsLatestMedia'],
        'canFilter': !exists(json, 'CanFilter') ? undefined : json['CanFilter'],
        'supportsContentDownloading': !exists(json, 'SupportsContentDownloading') ? undefined : json['SupportsContentDownloading'],
    };
}

export function ChannelFeaturesToJSON(value?: ChannelFeatures | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'Name': value.name,
        'Id': value.id,
        'CanSearch': value.canSearch,
        'MediaTypes': value.mediaTypes === undefined ? undefined : ((value.mediaTypes as Array<any>).map(ChannelMediaTypeToJSON)),
        'ContentTypes': value.contentTypes === undefined ? undefined : ((value.contentTypes as Array<any>).map(ChannelMediaContentTypeToJSON)),
        'MaxPageSize': value.maxPageSize,
        'AutoRefreshLevels': value.autoRefreshLevels,
        'DefaultSortFields': value.defaultSortFields === undefined ? undefined : ((value.defaultSortFields as Array<any>).map(ChannelItemSortFieldToJSON)),
        'SupportsSortOrderToggle': value.supportsSortOrderToggle,
        'SupportsLatestMedia': value.supportsLatestMedia,
        'CanFilter': value.canFilter,
        'SupportsContentDownloading': value.supportsContentDownloading,
    };
}

