/* 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 { RemoteSearchResult } from './RemoteSearchResult';
import {
    RemoteSearchResultFromJSON,
    RemoteSearchResultFromJSONTyped,
    RemoteSearchResultToJSON,
} from './RemoteSearchResult';

/**
 * 
 * @export
 * @interface ApplySearchCriteriaRequest
 */
export interface ApplySearchCriteriaRequest {
    /**
     * Gets or sets the name.
     * @type {string}
     * @memberof ApplySearchCriteriaRequest
     */
    name?: string | null;
    /**
     * Gets or sets the provider ids.
     * @type {{ [key: string]: string; }}
     * @memberof ApplySearchCriteriaRequest
     */
    providerIds?: { [key: string]: string; } | null;
    /**
     * Gets or sets the year.
     * @type {number}
     * @memberof ApplySearchCriteriaRequest
     */
    productionYear?: number | null;
    /**
     * 
     * @type {number}
     * @memberof ApplySearchCriteriaRequest
     */
    indexNumber?: number | null;
    /**
     * 
     * @type {number}
     * @memberof ApplySearchCriteriaRequest
     */
    indexNumberEnd?: number | null;
    /**
     * 
     * @type {number}
     * @memberof ApplySearchCriteriaRequest
     */
    parentIndexNumber?: number | null;
    /**
     * 
     * @type {Date}
     * @memberof ApplySearchCriteriaRequest
     */
    premiereDate?: Date | null;
    /**
     * 
     * @type {string}
     * @memberof ApplySearchCriteriaRequest
     */
    imageUrl?: string | null;
    /**
     * 
     * @type {string}
     * @memberof ApplySearchCriteriaRequest
     */
    searchProviderName?: string | null;
    /**
     * 
     * @type {string}
     * @memberof ApplySearchCriteriaRequest
     */
    overview?: string | null;
    /**
     * 
     * @type {RemoteSearchResult}
     * @memberof ApplySearchCriteriaRequest
     */
    albumArtist?: RemoteSearchResult | null;
    /**
     * 
     * @type {Array<RemoteSearchResult>}
     * @memberof ApplySearchCriteriaRequest
     */
    artists?: Array<RemoteSearchResult> | null;
}

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

    return isInstance;
}

export function ApplySearchCriteriaRequestFromJSON(json: any): ApplySearchCriteriaRequest {
    return ApplySearchCriteriaRequestFromJSONTyped(json, false);
}

export function ApplySearchCriteriaRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApplySearchCriteriaRequest {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'name': !exists(json, 'Name') ? undefined : json['Name'],
        'providerIds': !exists(json, 'ProviderIds') ? undefined : json['ProviderIds'],
        'productionYear': !exists(json, 'ProductionYear') ? undefined : json['ProductionYear'],
        'indexNumber': !exists(json, 'IndexNumber') ? undefined : json['IndexNumber'],
        'indexNumberEnd': !exists(json, 'IndexNumberEnd') ? undefined : json['IndexNumberEnd'],
        'parentIndexNumber': !exists(json, 'ParentIndexNumber') ? undefined : json['ParentIndexNumber'],
        'premiereDate': !exists(json, 'PremiereDate') ? undefined : (json['PremiereDate'] === null ? null : new Date(json['PremiereDate'])),
        'imageUrl': !exists(json, 'ImageUrl') ? undefined : json['ImageUrl'],
        'searchProviderName': !exists(json, 'SearchProviderName') ? undefined : json['SearchProviderName'],
        'overview': !exists(json, 'Overview') ? undefined : json['Overview'],
        'albumArtist': !exists(json, 'AlbumArtist') ? undefined : RemoteSearchResultFromJSON(json['AlbumArtist']),
        'artists': !exists(json, 'Artists') ? undefined : (json['Artists'] === null ? null : (json['Artists'] as Array<any>).map(RemoteSearchResultFromJSON)),
    };
}

export function ApplySearchCriteriaRequestToJSON(value?: ApplySearchCriteriaRequest | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'Name': value.name,
        'ProviderIds': value.providerIds,
        'ProductionYear': value.productionYear,
        'IndexNumber': value.indexNumber,
        'IndexNumberEnd': value.indexNumberEnd,
        'ParentIndexNumber': value.parentIndexNumber,
        'PremiereDate': value.premiereDate === undefined ? undefined : (value.premiereDate === null ? null : value.premiereDate.toISOString()),
        'ImageUrl': value.imageUrl,
        'SearchProviderName': value.searchProviderName,
        'Overview': value.overview,
        'AlbumArtist': RemoteSearchResultToJSON(value.albumArtist),
        'Artists': value.artists === undefined ? undefined : (value.artists === null ? null : (value.artists as Array<any>).map(RemoteSearchResultToJSON)),
    };
}

