# coding: utf-8

"""
    Prowlarr

    Prowlarr API docs  # noqa: E501

    The version of the OpenAPI document: 1.0.0
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import re  # noqa: F401

from pydantic import validate_arguments, ValidationError
from typing_extensions import Annotated

from pydantic import StrictInt, StrictStr

from typing import Optional


from prowlarr.api_client import ApiClient
from prowlarr.exceptions import (  # noqa: F401
    ApiTypeError,
    ApiValueError
)


class NewznabApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client

    @validate_arguments
    def get_indexerid_download(self, id : StrictInt, link : Optional[StrictStr] = None, file : Optional[StrictStr] = None, **kwargs) -> None:  # noqa: E501
        """get_indexerid_download  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_indexerid_download(id, link, file, async_req=True)
        >>> result = thread.get()

        :param id: (required)
        :type id: int
        :param link:
        :type link: str
        :param file:
        :type file: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """
        kwargs['_return_http_data_only'] = True
        return self.get_indexerid_download_with_http_info(id, link, file, **kwargs)  # noqa: E501

    @validate_arguments
    def get_indexerid_download_with_http_info(self, id : StrictInt, link : Optional[StrictStr] = None, file : Optional[StrictStr] = None, **kwargs):  # noqa: E501
        """get_indexerid_download  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_indexerid_download_with_http_info(id, link, file, async_req=True)
        >>> result = thread.get()

        :param id: (required)
        :type id: int
        :param link:
        :type link: str
        :param file:
        :type file: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """

        _params = locals()

        _all_params = [
            'id',
            'link',
            'file'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_indexerid_download" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['id']:
            _path_params['id'] = _params['id']

        # process the query parameters
        _query_params = []
        if _params.get('link') is not None:  # noqa: E501
            _query_params.append(('link', _params['link']))
        if _params.get('file') is not None:  # noqa: E501
            _query_params.append(('file', _params['file']))

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))

        # process the form parameters
        _form_params = []
        _files = {}

        # process the body parameter
        _body_params = None

        # authentication setting
        _auth_settings = ['X-Api-Key', 'apikey']  # noqa: E501

        _response_types_map = {}

        return self.api_client.call_api(
            '/api/v1/indexer/{id}/download', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def get_indexerid_newznab(self, id : StrictInt, t : Optional[StrictStr] = None, q : Optional[StrictStr] = None, cat : Optional[StrictStr] = None, imdbid : Optional[StrictStr] = None, tmdbid : Optional[StrictInt] = None, extended : Optional[StrictStr] = None, limit : Optional[StrictInt] = None, offset : Optional[StrictInt] = None, rid : Optional[StrictInt] = None, tvmazeid : Optional[StrictInt] = None, traktid : Optional[StrictInt] = None, tvdbid : Optional[StrictInt] = None, doubanid : Optional[StrictInt] = None, season : Optional[StrictInt] = None, ep : Optional[StrictStr] = None, album : Optional[StrictStr] = None, artist : Optional[StrictStr] = None, label : Optional[StrictStr] = None, track : Optional[StrictStr] = None, year : Optional[StrictInt] = None, genre : Optional[StrictStr] = None, author : Optional[StrictStr] = None, title : Optional[StrictStr] = None, publisher : Optional[StrictStr] = None, configured : Optional[StrictStr] = None, source : Optional[StrictStr] = None, host : Optional[StrictStr] = None, server : Optional[StrictStr] = None, **kwargs) -> None:  # noqa: E501
        """get_indexerid_newznab  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_indexerid_newznab(id, t, q, cat, imdbid, tmdbid, extended, limit, offset, rid, tvmazeid, traktid, tvdbid, doubanid, season, ep, album, artist, label, track, year, genre, author, title, publisher, configured, source, host, server, async_req=True)
        >>> result = thread.get()

        :param id: (required)
        :type id: int
        :param t:
        :type t: str
        :param q:
        :type q: str
        :param cat:
        :type cat: str
        :param imdbid:
        :type imdbid: str
        :param tmdbid:
        :type tmdbid: int
        :param extended:
        :type extended: str
        :param limit:
        :type limit: int
        :param offset:
        :type offset: int
        :param rid:
        :type rid: int
        :param tvmazeid:
        :type tvmazeid: int
        :param traktid:
        :type traktid: int
        :param tvdbid:
        :type tvdbid: int
        :param doubanid:
        :type doubanid: int
        :param season:
        :type season: int
        :param ep:
        :type ep: str
        :param album:
        :type album: str
        :param artist:
        :type artist: str
        :param label:
        :type label: str
        :param track:
        :type track: str
        :param year:
        :type year: int
        :param genre:
        :type genre: str
        :param author:
        :type author: str
        :param title:
        :type title: str
        :param publisher:
        :type publisher: str
        :param configured:
        :type configured: str
        :param source:
        :type source: str
        :param host:
        :type host: str
        :param server:
        :type server: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """
        kwargs['_return_http_data_only'] = True
        return self.get_indexerid_newznab_with_http_info(id, t, q, cat, imdbid, tmdbid, extended, limit, offset, rid, tvmazeid, traktid, tvdbid, doubanid, season, ep, album, artist, label, track, year, genre, author, title, publisher, configured, source, host, server, **kwargs)  # noqa: E501

    @validate_arguments
    def get_indexerid_newznab_with_http_info(self, id : StrictInt, t : Optional[StrictStr] = None, q : Optional[StrictStr] = None, cat : Optional[StrictStr] = None, imdbid : Optional[StrictStr] = None, tmdbid : Optional[StrictInt] = None, extended : Optional[StrictStr] = None, limit : Optional[StrictInt] = None, offset : Optional[StrictInt] = None, rid : Optional[StrictInt] = None, tvmazeid : Optional[StrictInt] = None, traktid : Optional[StrictInt] = None, tvdbid : Optional[StrictInt] = None, doubanid : Optional[StrictInt] = None, season : Optional[StrictInt] = None, ep : Optional[StrictStr] = None, album : Optional[StrictStr] = None, artist : Optional[StrictStr] = None, label : Optional[StrictStr] = None, track : Optional[StrictStr] = None, year : Optional[StrictInt] = None, genre : Optional[StrictStr] = None, author : Optional[StrictStr] = None, title : Optional[StrictStr] = None, publisher : Optional[StrictStr] = None, configured : Optional[StrictStr] = None, source : Optional[StrictStr] = None, host : Optional[StrictStr] = None, server : Optional[StrictStr] = None, **kwargs):  # noqa: E501
        """get_indexerid_newznab  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_indexerid_newznab_with_http_info(id, t, q, cat, imdbid, tmdbid, extended, limit, offset, rid, tvmazeid, traktid, tvdbid, doubanid, season, ep, album, artist, label, track, year, genre, author, title, publisher, configured, source, host, server, async_req=True)
        >>> result = thread.get()

        :param id: (required)
        :type id: int
        :param t:
        :type t: str
        :param q:
        :type q: str
        :param cat:
        :type cat: str
        :param imdbid:
        :type imdbid: str
        :param tmdbid:
        :type tmdbid: int
        :param extended:
        :type extended: str
        :param limit:
        :type limit: int
        :param offset:
        :type offset: int
        :param rid:
        :type rid: int
        :param tvmazeid:
        :type tvmazeid: int
        :param traktid:
        :type traktid: int
        :param tvdbid:
        :type tvdbid: int
        :param doubanid:
        :type doubanid: int
        :param season:
        :type season: int
        :param ep:
        :type ep: str
        :param album:
        :type album: str
        :param artist:
        :type artist: str
        :param label:
        :type label: str
        :param track:
        :type track: str
        :param year:
        :type year: int
        :param genre:
        :type genre: str
        :param author:
        :type author: str
        :param title:
        :type title: str
        :param publisher:
        :type publisher: str
        :param configured:
        :type configured: str
        :param source:
        :type source: str
        :param host:
        :type host: str
        :param server:
        :type server: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """

        _params = locals()

        _all_params = [
            'id',
            't',
            'q',
            'cat',
            'imdbid',
            'tmdbid',
            'extended',
            'limit',
            'offset',
            'rid',
            'tvmazeid',
            'traktid',
            'tvdbid',
            'doubanid',
            'season',
            'ep',
            'album',
            'artist',
            'label',
            'track',
            'year',
            'genre',
            'author',
            'title',
            'publisher',
            'configured',
            'source',
            'host',
            'server'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_indexerid_newznab" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['id']:
            _path_params['id'] = _params['id']

        # process the query parameters
        _query_params = []
        if _params.get('t') is not None:  # noqa: E501
            _query_params.append(('t', _params['t']))
        if _params.get('q') is not None:  # noqa: E501
            _query_params.append(('q', _params['q']))
        if _params.get('cat') is not None:  # noqa: E501
            _query_params.append(('cat', _params['cat']))
        if _params.get('imdbid') is not None:  # noqa: E501
            _query_params.append(('imdbid', _params['imdbid']))
        if _params.get('tmdbid') is not None:  # noqa: E501
            _query_params.append(('tmdbid', _params['tmdbid']))
        if _params.get('extended') is not None:  # noqa: E501
            _query_params.append(('extended', _params['extended']))
        if _params.get('limit') is not None:  # noqa: E501
            _query_params.append(('limit', _params['limit']))
        if _params.get('offset') is not None:  # noqa: E501
            _query_params.append(('offset', _params['offset']))
        if _params.get('rid') is not None:  # noqa: E501
            _query_params.append(('rid', _params['rid']))
        if _params.get('tvmazeid') is not None:  # noqa: E501
            _query_params.append(('tvmazeid', _params['tvmazeid']))
        if _params.get('traktid') is not None:  # noqa: E501
            _query_params.append(('traktid', _params['traktid']))
        if _params.get('tvdbid') is not None:  # noqa: E501
            _query_params.append(('tvdbid', _params['tvdbid']))
        if _params.get('doubanid') is not None:  # noqa: E501
            _query_params.append(('doubanid', _params['doubanid']))
        if _params.get('season') is not None:  # noqa: E501
            _query_params.append(('season', _params['season']))
        if _params.get('ep') is not None:  # noqa: E501
            _query_params.append(('ep', _params['ep']))
        if _params.get('album') is not None:  # noqa: E501
            _query_params.append(('album', _params['album']))
        if _params.get('artist') is not None:  # noqa: E501
            _query_params.append(('artist', _params['artist']))
        if _params.get('label') is not None:  # noqa: E501
            _query_params.append(('label', _params['label']))
        if _params.get('track') is not None:  # noqa: E501
            _query_params.append(('track', _params['track']))
        if _params.get('year') is not None:  # noqa: E501
            _query_params.append(('year', _params['year']))
        if _params.get('genre') is not None:  # noqa: E501
            _query_params.append(('genre', _params['genre']))
        if _params.get('author') is not None:  # noqa: E501
            _query_params.append(('author', _params['author']))
        if _params.get('title') is not None:  # noqa: E501
            _query_params.append(('title', _params['title']))
        if _params.get('publisher') is not None:  # noqa: E501
            _query_params.append(('publisher', _params['publisher']))
        if _params.get('configured') is not None:  # noqa: E501
            _query_params.append(('configured', _params['configured']))
        if _params.get('source') is not None:  # noqa: E501
            _query_params.append(('source', _params['source']))
        if _params.get('host') is not None:  # noqa: E501
            _query_params.append(('host', _params['host']))
        if _params.get('server') is not None:  # noqa: E501
            _query_params.append(('server', _params['server']))

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))

        # process the form parameters
        _form_params = []
        _files = {}

        # process the body parameter
        _body_params = None

        # authentication setting
        _auth_settings = ['X-Api-Key', 'apikey']  # noqa: E501

        _response_types_map = {}

        return self.api_client.call_api(
            '/api/v1/indexer/{id}/newznab', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def getid_api(self, id : StrictInt, t : Optional[StrictStr] = None, q : Optional[StrictStr] = None, cat : Optional[StrictStr] = None, imdbid : Optional[StrictStr] = None, tmdbid : Optional[StrictInt] = None, extended : Optional[StrictStr] = None, limit : Optional[StrictInt] = None, offset : Optional[StrictInt] = None, rid : Optional[StrictInt] = None, tvmazeid : Optional[StrictInt] = None, traktid : Optional[StrictInt] = None, tvdbid : Optional[StrictInt] = None, doubanid : Optional[StrictInt] = None, season : Optional[StrictInt] = None, ep : Optional[StrictStr] = None, album : Optional[StrictStr] = None, artist : Optional[StrictStr] = None, label : Optional[StrictStr] = None, track : Optional[StrictStr] = None, year : Optional[StrictInt] = None, genre : Optional[StrictStr] = None, author : Optional[StrictStr] = None, title : Optional[StrictStr] = None, publisher : Optional[StrictStr] = None, configured : Optional[StrictStr] = None, source : Optional[StrictStr] = None, host : Optional[StrictStr] = None, server : Optional[StrictStr] = None, **kwargs) -> None:  # noqa: E501
        """getid_api  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.getid_api(id, t, q, cat, imdbid, tmdbid, extended, limit, offset, rid, tvmazeid, traktid, tvdbid, doubanid, season, ep, album, artist, label, track, year, genre, author, title, publisher, configured, source, host, server, async_req=True)
        >>> result = thread.get()

        :param id: (required)
        :type id: int
        :param t:
        :type t: str
        :param q:
        :type q: str
        :param cat:
        :type cat: str
        :param imdbid:
        :type imdbid: str
        :param tmdbid:
        :type tmdbid: int
        :param extended:
        :type extended: str
        :param limit:
        :type limit: int
        :param offset:
        :type offset: int
        :param rid:
        :type rid: int
        :param tvmazeid:
        :type tvmazeid: int
        :param traktid:
        :type traktid: int
        :param tvdbid:
        :type tvdbid: int
        :param doubanid:
        :type doubanid: int
        :param season:
        :type season: int
        :param ep:
        :type ep: str
        :param album:
        :type album: str
        :param artist:
        :type artist: str
        :param label:
        :type label: str
        :param track:
        :type track: str
        :param year:
        :type year: int
        :param genre:
        :type genre: str
        :param author:
        :type author: str
        :param title:
        :type title: str
        :param publisher:
        :type publisher: str
        :param configured:
        :type configured: str
        :param source:
        :type source: str
        :param host:
        :type host: str
        :param server:
        :type server: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """
        kwargs['_return_http_data_only'] = True
        return self.getid_api_with_http_info(id, t, q, cat, imdbid, tmdbid, extended, limit, offset, rid, tvmazeid, traktid, tvdbid, doubanid, season, ep, album, artist, label, track, year, genre, author, title, publisher, configured, source, host, server, **kwargs)  # noqa: E501

    @validate_arguments
    def getid_api_with_http_info(self, id : StrictInt, t : Optional[StrictStr] = None, q : Optional[StrictStr] = None, cat : Optional[StrictStr] = None, imdbid : Optional[StrictStr] = None, tmdbid : Optional[StrictInt] = None, extended : Optional[StrictStr] = None, limit : Optional[StrictInt] = None, offset : Optional[StrictInt] = None, rid : Optional[StrictInt] = None, tvmazeid : Optional[StrictInt] = None, traktid : Optional[StrictInt] = None, tvdbid : Optional[StrictInt] = None, doubanid : Optional[StrictInt] = None, season : Optional[StrictInt] = None, ep : Optional[StrictStr] = None, album : Optional[StrictStr] = None, artist : Optional[StrictStr] = None, label : Optional[StrictStr] = None, track : Optional[StrictStr] = None, year : Optional[StrictInt] = None, genre : Optional[StrictStr] = None, author : Optional[StrictStr] = None, title : Optional[StrictStr] = None, publisher : Optional[StrictStr] = None, configured : Optional[StrictStr] = None, source : Optional[StrictStr] = None, host : Optional[StrictStr] = None, server : Optional[StrictStr] = None, **kwargs):  # noqa: E501
        """getid_api  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.getid_api_with_http_info(id, t, q, cat, imdbid, tmdbid, extended, limit, offset, rid, tvmazeid, traktid, tvdbid, doubanid, season, ep, album, artist, label, track, year, genre, author, title, publisher, configured, source, host, server, async_req=True)
        >>> result = thread.get()

        :param id: (required)
        :type id: int
        :param t:
        :type t: str
        :param q:
        :type q: str
        :param cat:
        :type cat: str
        :param imdbid:
        :type imdbid: str
        :param tmdbid:
        :type tmdbid: int
        :param extended:
        :type extended: str
        :param limit:
        :type limit: int
        :param offset:
        :type offset: int
        :param rid:
        :type rid: int
        :param tvmazeid:
        :type tvmazeid: int
        :param traktid:
        :type traktid: int
        :param tvdbid:
        :type tvdbid: int
        :param doubanid:
        :type doubanid: int
        :param season:
        :type season: int
        :param ep:
        :type ep: str
        :param album:
        :type album: str
        :param artist:
        :type artist: str
        :param label:
        :type label: str
        :param track:
        :type track: str
        :param year:
        :type year: int
        :param genre:
        :type genre: str
        :param author:
        :type author: str
        :param title:
        :type title: str
        :param publisher:
        :type publisher: str
        :param configured:
        :type configured: str
        :param source:
        :type source: str
        :param host:
        :type host: str
        :param server:
        :type server: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """

        _params = locals()

        _all_params = [
            'id',
            't',
            'q',
            'cat',
            'imdbid',
            'tmdbid',
            'extended',
            'limit',
            'offset',
            'rid',
            'tvmazeid',
            'traktid',
            'tvdbid',
            'doubanid',
            'season',
            'ep',
            'album',
            'artist',
            'label',
            'track',
            'year',
            'genre',
            'author',
            'title',
            'publisher',
            'configured',
            'source',
            'host',
            'server'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method getid_api" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['id']:
            _path_params['id'] = _params['id']

        # process the query parameters
        _query_params = []
        if _params.get('t') is not None:  # noqa: E501
            _query_params.append(('t', _params['t']))
        if _params.get('q') is not None:  # noqa: E501
            _query_params.append(('q', _params['q']))
        if _params.get('cat') is not None:  # noqa: E501
            _query_params.append(('cat', _params['cat']))
        if _params.get('imdbid') is not None:  # noqa: E501
            _query_params.append(('imdbid', _params['imdbid']))
        if _params.get('tmdbid') is not None:  # noqa: E501
            _query_params.append(('tmdbid', _params['tmdbid']))
        if _params.get('extended') is not None:  # noqa: E501
            _query_params.append(('extended', _params['extended']))
        if _params.get('limit') is not None:  # noqa: E501
            _query_params.append(('limit', _params['limit']))
        if _params.get('offset') is not None:  # noqa: E501
            _query_params.append(('offset', _params['offset']))
        if _params.get('rid') is not None:  # noqa: E501
            _query_params.append(('rid', _params['rid']))
        if _params.get('tvmazeid') is not None:  # noqa: E501
            _query_params.append(('tvmazeid', _params['tvmazeid']))
        if _params.get('traktid') is not None:  # noqa: E501
            _query_params.append(('traktid', _params['traktid']))
        if _params.get('tvdbid') is not None:  # noqa: E501
            _query_params.append(('tvdbid', _params['tvdbid']))
        if _params.get('doubanid') is not None:  # noqa: E501
            _query_params.append(('doubanid', _params['doubanid']))
        if _params.get('season') is not None:  # noqa: E501
            _query_params.append(('season', _params['season']))
        if _params.get('ep') is not None:  # noqa: E501
            _query_params.append(('ep', _params['ep']))
        if _params.get('album') is not None:  # noqa: E501
            _query_params.append(('album', _params['album']))
        if _params.get('artist') is not None:  # noqa: E501
            _query_params.append(('artist', _params['artist']))
        if _params.get('label') is not None:  # noqa: E501
            _query_params.append(('label', _params['label']))
        if _params.get('track') is not None:  # noqa: E501
            _query_params.append(('track', _params['track']))
        if _params.get('year') is not None:  # noqa: E501
            _query_params.append(('year', _params['year']))
        if _params.get('genre') is not None:  # noqa: E501
            _query_params.append(('genre', _params['genre']))
        if _params.get('author') is not None:  # noqa: E501
            _query_params.append(('author', _params['author']))
        if _params.get('title') is not None:  # noqa: E501
            _query_params.append(('title', _params['title']))
        if _params.get('publisher') is not None:  # noqa: E501
            _query_params.append(('publisher', _params['publisher']))
        if _params.get('configured') is not None:  # noqa: E501
            _query_params.append(('configured', _params['configured']))
        if _params.get('source') is not None:  # noqa: E501
            _query_params.append(('source', _params['source']))
        if _params.get('host') is not None:  # noqa: E501
            _query_params.append(('host', _params['host']))
        if _params.get('server') is not None:  # noqa: E501
            _query_params.append(('server', _params['server']))

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))

        # process the form parameters
        _form_params = []
        _files = {}

        # process the body parameter
        _body_params = None

        # authentication setting
        _auth_settings = ['X-Api-Key', 'apikey']  # noqa: E501

        _response_types_map = {}

        return self.api_client.call_api(
            '/{id}/api', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def getid_download(self, id : StrictInt, link : Optional[StrictStr] = None, file : Optional[StrictStr] = None, **kwargs) -> None:  # noqa: E501
        """getid_download  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.getid_download(id, link, file, async_req=True)
        >>> result = thread.get()

        :param id: (required)
        :type id: int
        :param link:
        :type link: str
        :param file:
        :type file: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """
        kwargs['_return_http_data_only'] = True
        return self.getid_download_with_http_info(id, link, file, **kwargs)  # noqa: E501

    @validate_arguments
    def getid_download_with_http_info(self, id : StrictInt, link : Optional[StrictStr] = None, file : Optional[StrictStr] = None, **kwargs):  # noqa: E501
        """getid_download  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.getid_download_with_http_info(id, link, file, async_req=True)
        >>> result = thread.get()

        :param id: (required)
        :type id: int
        :param link:
        :type link: str
        :param file:
        :type file: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _return_http_data_only: response data without head status code
                                       and headers
        :type _return_http_data_only: bool, optional
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :type _preload_content: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """

        _params = locals()

        _all_params = [
            'id',
            'link',
            'file'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method getid_download" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['id']:
            _path_params['id'] = _params['id']

        # process the query parameters
        _query_params = []
        if _params.get('link') is not None:  # noqa: E501
            _query_params.append(('link', _params['link']))
        if _params.get('file') is not None:  # noqa: E501
            _query_params.append(('file', _params['file']))

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))

        # process the form parameters
        _form_params = []
        _files = {}

        # process the body parameter
        _body_params = None

        # authentication setting
        _auth_settings = ['X-Api-Key', 'apikey']  # noqa: E501

        _response_types_map = {}

        return self.api_client.call_api(
            '/{id}/download', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))
