/* 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 * as runtime from '../runtime';
import type {
  BaseItemKind,
  QueryFilters,
  QueryFiltersLegacy,
} from '../models';
import {
    BaseItemKindFromJSON,
    BaseItemKindToJSON,
    QueryFiltersFromJSON,
    QueryFiltersToJSON,
    QueryFiltersLegacyFromJSON,
    QueryFiltersLegacyToJSON,
} from '../models';

export interface GetQueryFiltersRequest {
    userId?: string;
    parentId?: string;
    includeItemTypes?: Array<BaseItemKind>;
    isAiring?: boolean;
    isMovie?: boolean;
    isSports?: boolean;
    isKids?: boolean;
    isNews?: boolean;
    isSeries?: boolean;
    recursive?: boolean;
}

export interface GetQueryFiltersLegacyRequest {
    userId?: string;
    parentId?: string;
    includeItemTypes?: Array<BaseItemKind>;
    mediaTypes?: Array<string>;
}

/**
 * 
 */
export class FilterApi extends runtime.BaseAPI {

    /**
     * Gets query filters.
     */
    async getQueryFiltersRaw(requestParameters: GetQueryFiltersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<QueryFilters>> {
        const queryParameters: any = {};

        if (requestParameters.userId !== undefined) {
            queryParameters['userId'] = requestParameters.userId;
        }

        if (requestParameters.parentId !== undefined) {
            queryParameters['parentId'] = requestParameters.parentId;
        }

        if (requestParameters.includeItemTypes) {
            queryParameters['includeItemTypes'] = requestParameters.includeItemTypes;
        }

        if (requestParameters.isAiring !== undefined) {
            queryParameters['isAiring'] = requestParameters.isAiring;
        }

        if (requestParameters.isMovie !== undefined) {
            queryParameters['isMovie'] = requestParameters.isMovie;
        }

        if (requestParameters.isSports !== undefined) {
            queryParameters['isSports'] = requestParameters.isSports;
        }

        if (requestParameters.isKids !== undefined) {
            queryParameters['isKids'] = requestParameters.isKids;
        }

        if (requestParameters.isNews !== undefined) {
            queryParameters['isNews'] = requestParameters.isNews;
        }

        if (requestParameters.isSeries !== undefined) {
            queryParameters['isSeries'] = requestParameters.isSeries;
        }

        if (requestParameters.recursive !== undefined) {
            queryParameters['recursive'] = requestParameters.recursive;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Items/Filters2`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => QueryFiltersFromJSON(jsonValue));
    }

    /**
     * Gets query filters.
     */
    async getQueryFilters(requestParameters: GetQueryFiltersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<QueryFilters> {
        const response = await this.getQueryFiltersRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Gets legacy query filters.
     */
    async getQueryFiltersLegacyRaw(requestParameters: GetQueryFiltersLegacyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<QueryFiltersLegacy>> {
        const queryParameters: any = {};

        if (requestParameters.userId !== undefined) {
            queryParameters['userId'] = requestParameters.userId;
        }

        if (requestParameters.parentId !== undefined) {
            queryParameters['parentId'] = requestParameters.parentId;
        }

        if (requestParameters.includeItemTypes) {
            queryParameters['includeItemTypes'] = requestParameters.includeItemTypes;
        }

        if (requestParameters.mediaTypes) {
            queryParameters['mediaTypes'] = requestParameters.mediaTypes;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // CustomAuthentication authentication
        }

        const response = await this.request({
            path: `/Items/Filters`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => QueryFiltersLegacyFromJSON(jsonValue));
    }

    /**
     * Gets legacy query filters.
     */
    async getQueryFiltersLegacy(requestParameters: GetQueryFiltersLegacyRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<QueryFiltersLegacy> {
        const response = await this.getQueryFiltersLegacyRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
