/* 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 { DlnaProfileType } from './DlnaProfileType';
import {
    DlnaProfileTypeFromJSON,
    DlnaProfileTypeFromJSONTyped,
    DlnaProfileTypeToJSON,
} from './DlnaProfileType';
import type { EncodingContext } from './EncodingContext';
import {
    EncodingContextFromJSON,
    EncodingContextFromJSONTyped,
    EncodingContextToJSON,
} from './EncodingContext';
import type { ProfileCondition } from './ProfileCondition';
import {
    ProfileConditionFromJSON,
    ProfileConditionFromJSONTyped,
    ProfileConditionToJSON,
} from './ProfileCondition';
import type { TranscodeSeekInfo } from './TranscodeSeekInfo';
import {
    TranscodeSeekInfoFromJSON,
    TranscodeSeekInfoFromJSONTyped,
    TranscodeSeekInfoToJSON,
} from './TranscodeSeekInfo';

/**
 * 
 * @export
 * @interface TranscodingProfile
 */
export interface TranscodingProfile {
    /**
     * 
     * @type {string}
     * @memberof TranscodingProfile
     */
    container?: string;
    /**
     * 
     * @type {DlnaProfileType}
     * @memberof TranscodingProfile
     */
    type?: DlnaProfileType;
    /**
     * 
     * @type {string}
     * @memberof TranscodingProfile
     */
    videoCodec?: string;
    /**
     * 
     * @type {string}
     * @memberof TranscodingProfile
     */
    audioCodec?: string;
    /**
     * 
     * @type {string}
     * @memberof TranscodingProfile
     */
    protocol?: string;
    /**
     * 
     * @type {boolean}
     * @memberof TranscodingProfile
     */
    estimateContentLength?: boolean;
    /**
     * 
     * @type {boolean}
     * @memberof TranscodingProfile
     */
    enableMpegtsM2TsMode?: boolean;
    /**
     * 
     * @type {TranscodeSeekInfo}
     * @memberof TranscodingProfile
     */
    transcodeSeekInfo?: TranscodeSeekInfo;
    /**
     * 
     * @type {boolean}
     * @memberof TranscodingProfile
     */
    copyTimestamps?: boolean;
    /**
     * 
     * @type {EncodingContext}
     * @memberof TranscodingProfile
     */
    context?: EncodingContext;
    /**
     * 
     * @type {boolean}
     * @memberof TranscodingProfile
     */
    enableSubtitlesInManifest?: boolean;
    /**
     * 
     * @type {string}
     * @memberof TranscodingProfile
     */
    maxAudioChannels?: string | null;
    /**
     * 
     * @type {number}
     * @memberof TranscodingProfile
     */
    minSegments?: number;
    /**
     * 
     * @type {number}
     * @memberof TranscodingProfile
     */
    segmentLength?: number;
    /**
     * 
     * @type {boolean}
     * @memberof TranscodingProfile
     */
    breakOnNonKeyFrames?: boolean;
    /**
     * 
     * @type {Array<ProfileCondition>}
     * @memberof TranscodingProfile
     */
    conditions?: Array<ProfileCondition>;
}

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

    return isInstance;
}

export function TranscodingProfileFromJSON(json: any): TranscodingProfile {
    return TranscodingProfileFromJSONTyped(json, false);
}

export function TranscodingProfileFromJSONTyped(json: any, ignoreDiscriminator: boolean): TranscodingProfile {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'container': !exists(json, 'Container') ? undefined : json['Container'],
        'type': !exists(json, 'Type') ? undefined : DlnaProfileTypeFromJSON(json['Type']),
        'videoCodec': !exists(json, 'VideoCodec') ? undefined : json['VideoCodec'],
        'audioCodec': !exists(json, 'AudioCodec') ? undefined : json['AudioCodec'],
        'protocol': !exists(json, 'Protocol') ? undefined : json['Protocol'],
        'estimateContentLength': !exists(json, 'EstimateContentLength') ? undefined : json['EstimateContentLength'],
        'enableMpegtsM2TsMode': !exists(json, 'EnableMpegtsM2TsMode') ? undefined : json['EnableMpegtsM2TsMode'],
        'transcodeSeekInfo': !exists(json, 'TranscodeSeekInfo') ? undefined : TranscodeSeekInfoFromJSON(json['TranscodeSeekInfo']),
        'copyTimestamps': !exists(json, 'CopyTimestamps') ? undefined : json['CopyTimestamps'],
        'context': !exists(json, 'Context') ? undefined : EncodingContextFromJSON(json['Context']),
        'enableSubtitlesInManifest': !exists(json, 'EnableSubtitlesInManifest') ? undefined : json['EnableSubtitlesInManifest'],
        'maxAudioChannels': !exists(json, 'MaxAudioChannels') ? undefined : json['MaxAudioChannels'],
        'minSegments': !exists(json, 'MinSegments') ? undefined : json['MinSegments'],
        'segmentLength': !exists(json, 'SegmentLength') ? undefined : json['SegmentLength'],
        'breakOnNonKeyFrames': !exists(json, 'BreakOnNonKeyFrames') ? undefined : json['BreakOnNonKeyFrames'],
        'conditions': !exists(json, 'Conditions') ? undefined : ((json['Conditions'] as Array<any>).map(ProfileConditionFromJSON)),
    };
}

export function TranscodingProfileToJSON(value?: TranscodingProfile | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'Container': value.container,
        'Type': DlnaProfileTypeToJSON(value.type),
        'VideoCodec': value.videoCodec,
        'AudioCodec': value.audioCodec,
        'Protocol': value.protocol,
        'EstimateContentLength': value.estimateContentLength,
        'EnableMpegtsM2TsMode': value.enableMpegtsM2TsMode,
        'TranscodeSeekInfo': TranscodeSeekInfoToJSON(value.transcodeSeekInfo),
        'CopyTimestamps': value.copyTimestamps,
        'Context': EncodingContextToJSON(value.context),
        'EnableSubtitlesInManifest': value.enableSubtitlesInManifest,
        'MaxAudioChannels': value.maxAudioChannels,
        'MinSegments': value.minSegments,
        'SegmentLength': value.segmentLength,
        'BreakOnNonKeyFrames': value.breakOnNonKeyFrames,
        'Conditions': value.conditions === undefined ? undefined : ((value.conditions as Array<any>).map(ProfileConditionToJSON)),
    };
}

