# coding: utf-8

"""
    

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 1.11.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from oxford_dictionaries_api.api_client import ApiClient


class WordlistApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

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

    def wordlist_source_lang_filters_advanced_get(self, source_lang, filters_advanced, app_id, app_key, **kwargs):  # noqa: E501
        """Retrieve list of words for category with advanced options  # noqa: E501

        Use this to apply more complex filters to the [list of words](documentation/glossary?term=wordlist). For example, you may only want to filter out words for which all [senses](documentation/glossary?term=sense) match the filter, or only its 'prime sense'. You can also filter by word length or match by substring (prefix).     <div id=\"wordlist_advanced\"></div>   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.wordlist_source_lang_filters_advanced_get(source_lang, filters_advanced, app_id, app_key, async=True)
        >>> result = thread.get()

        :param async bool
        :param str source_lang: IANA language code (required)
        :param str filters_advanced: Semicolon separated list of wordlist parameters, presented as value pairs: LexicalCategory, domains, regions, registers. Parameters can take comma separated list of values. E.g., lexicalCategory=noun,adjective;domains=sport. Number of values limited to 5. (required)
        :param str app_id: App ID Authentication Parameter (required)
        :param str app_key: App Key Authentication Parameter (required)
        :param str exclude: Semicolon separated list of parameters-value pairs (same as filters). Excludes headwords that have any senses in specified exclusion attributes (lexical categories, domains, etc.) from results.
        :param str exclude_senses: Semicolon separated list of parameters-value pairs (same as filters). Excludes only those senses of a particular headword that match specified exclusion attributes (lexical categories, domains, etc.) from results but includes the headword if it has other permitted senses.
        :param str exclude_prime_senses: Semicolon separated list of parameters-value pairs (same as filters). Excludes a headword only if the primary sense matches the specified exclusion attributes (registers, domains only).
        :param str word_length: Parameter to speficy the minimum (>), exact or maximum (<) length of the words required. E.g., >5 - more than 5 chars; <4 - less than 4 chars; >5<10 - from 5 to 10 chars; 3 - exactly 3 chars.
        :param str prefix: Filter words that start with prefix parameter
        :param bool exact: If exact=true wordlist returns a list of entries that exactly matches the search string. Otherwise wordlist lists entries that start with prefix string.
        :param str limit: Limit the number of results per response. Default and maximum limit is 5000.
        :param str offset: Offset the start number of the result.
        :return: Wordlist
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.wordlist_source_lang_filters_advanced_get_with_http_info(source_lang, filters_advanced, app_id, app_key, **kwargs)  # noqa: E501
        else:
            (data) = self.wordlist_source_lang_filters_advanced_get_with_http_info(source_lang, filters_advanced, app_id, app_key, **kwargs)  # noqa: E501
            return data

    def wordlist_source_lang_filters_advanced_get_with_http_info(self, source_lang, filters_advanced, app_id, app_key, **kwargs):  # noqa: E501
        """Retrieve list of words for category with advanced options  # noqa: E501

        Use this to apply more complex filters to the [list of words](documentation/glossary?term=wordlist). For example, you may only want to filter out words for which all [senses](documentation/glossary?term=sense) match the filter, or only its 'prime sense'. You can also filter by word length or match by substring (prefix).     <div id=\"wordlist_advanced\"></div>   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.wordlist_source_lang_filters_advanced_get_with_http_info(source_lang, filters_advanced, app_id, app_key, async=True)
        >>> result = thread.get()

        :param async bool
        :param str source_lang: IANA language code (required)
        :param str filters_advanced: Semicolon separated list of wordlist parameters, presented as value pairs: LexicalCategory, domains, regions, registers. Parameters can take comma separated list of values. E.g., lexicalCategory=noun,adjective;domains=sport. Number of values limited to 5. (required)
        :param str app_id: App ID Authentication Parameter (required)
        :param str app_key: App Key Authentication Parameter (required)
        :param str exclude: Semicolon separated list of parameters-value pairs (same as filters). Excludes headwords that have any senses in specified exclusion attributes (lexical categories, domains, etc.) from results.
        :param str exclude_senses: Semicolon separated list of parameters-value pairs (same as filters). Excludes only those senses of a particular headword that match specified exclusion attributes (lexical categories, domains, etc.) from results but includes the headword if it has other permitted senses.
        :param str exclude_prime_senses: Semicolon separated list of parameters-value pairs (same as filters). Excludes a headword only if the primary sense matches the specified exclusion attributes (registers, domains only).
        :param str word_length: Parameter to speficy the minimum (>), exact or maximum (<) length of the words required. E.g., >5 - more than 5 chars; <4 - less than 4 chars; >5<10 - from 5 to 10 chars; 3 - exactly 3 chars.
        :param str prefix: Filter words that start with prefix parameter
        :param bool exact: If exact=true wordlist returns a list of entries that exactly matches the search string. Otherwise wordlist lists entries that start with prefix string.
        :param str limit: Limit the number of results per response. Default and maximum limit is 5000.
        :param str offset: Offset the start number of the result.
        :return: Wordlist
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['source_lang', 'filters_advanced', 'app_id', 'app_key', 'exclude', 'exclude_senses', 'exclude_prime_senses', 'word_length', 'prefix', 'exact', 'limit', 'offset']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method wordlist_source_lang_filters_advanced_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'source_lang' is set
        if ('source_lang' not in params or
                params['source_lang'] is None):
            raise ValueError("Missing the required parameter `source_lang` when calling `wordlist_source_lang_filters_advanced_get`")  # noqa: E501
        # verify the required parameter 'filters_advanced' is set
        if ('filters_advanced' not in params or
                params['filters_advanced'] is None):
            raise ValueError("Missing the required parameter `filters_advanced` when calling `wordlist_source_lang_filters_advanced_get`")  # noqa: E501
        # verify the required parameter 'app_id' is set
        if ('app_id' not in params or
                params['app_id'] is None):
            raise ValueError("Missing the required parameter `app_id` when calling `wordlist_source_lang_filters_advanced_get`")  # noqa: E501
        # verify the required parameter 'app_key' is set
        if ('app_key' not in params or
                params['app_key'] is None):
            raise ValueError("Missing the required parameter `app_key` when calling `wordlist_source_lang_filters_advanced_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'source_lang' in params:
            path_params['source_lang'] = params['source_lang']  # noqa: E501
        if 'filters_advanced' in params:
            path_params['filters_advanced'] = params['filters_advanced']  # noqa: E501

        query_params = []
        if 'exclude' in params:
            query_params.append(('exclude', params['exclude']))  # noqa: E501
        if 'exclude_senses' in params:
            query_params.append(('exclude_senses', params['exclude_senses']))  # noqa: E501
        if 'exclude_prime_senses' in params:
            query_params.append(('exclude_prime_senses', params['exclude_prime_senses']))  # noqa: E501
        if 'word_length' in params:
            query_params.append(('word_length', params['word_length']))  # noqa: E501
        if 'prefix' in params:
            query_params.append(('prefix', params['prefix']))  # noqa: E501
        if 'exact' in params:
            query_params.append(('exact', params['exact']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501

        header_params = {}
        if 'app_id' in params:
            header_params['app_id'] = params['app_id']  # noqa: E501
        if 'app_key' in params:
            header_params['app_key'] = params['app_key']  # noqa: E501

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/wordlist/{source_lang}/{filters_advanced}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Wordlist',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def wordlist_source_lang_filters_basic_get(self, source_lang, filters_basic, app_id, app_key, **kwargs):  # noqa: E501
        """Retrieve a list of words in a category  # noqa: E501

         Use this to retrieve a [list of words](documentation/glossary?term=wordlist) for particular [domain](documentation/glossary?term=domain), [lexical category](documentation/glossary?term=lexicalcategory), [register](documentation/glossary?term=registers) and/or [region](documentation/glossary?term=regions). View the full list of possible filters using the filters Utility endpoint.  The response only includes [headwords](documentation/glossary?term=headword), not all their possible [inflections](documentation/glossary?term=inflection). If you require a full [wordlist](documentation/glossary?term=wordlist) including [inflected forms](documentation/glossary?term=inflection), contact us and we can help.    <div id=\"wordlist\"></div>   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.wordlist_source_lang_filters_basic_get(source_lang, filters_basic, app_id, app_key, async=True)
        >>> result = thread.get()

        :param async bool
        :param str source_lang: IANA language code (required)
        :param str filters_basic: Semicolon separated list of wordlist parameters, presented as value pairs: LexicalCategory, domains, regions, registers. Parameters can take comma separated list of values. E.g., lexicalCategory=noun,adjective;domains=sport. Number of values limited to 5. (required)
        :param str app_id: App ID Authentication Parameter (required)
        :param str app_key: App Key Authentication Parameter (required)
        :param str limit: Limit the number of results per response. Default and maximum limit is 5000.
        :param str offset: Offset the start number of the result
        :return: Wordlist
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.wordlist_source_lang_filters_basic_get_with_http_info(source_lang, filters_basic, app_id, app_key, **kwargs)  # noqa: E501
        else:
            (data) = self.wordlist_source_lang_filters_basic_get_with_http_info(source_lang, filters_basic, app_id, app_key, **kwargs)  # noqa: E501
            return data

    def wordlist_source_lang_filters_basic_get_with_http_info(self, source_lang, filters_basic, app_id, app_key, **kwargs):  # noqa: E501
        """Retrieve a list of words in a category  # noqa: E501

         Use this to retrieve a [list of words](documentation/glossary?term=wordlist) for particular [domain](documentation/glossary?term=domain), [lexical category](documentation/glossary?term=lexicalcategory), [register](documentation/glossary?term=registers) and/or [region](documentation/glossary?term=regions). View the full list of possible filters using the filters Utility endpoint.  The response only includes [headwords](documentation/glossary?term=headword), not all their possible [inflections](documentation/glossary?term=inflection). If you require a full [wordlist](documentation/glossary?term=wordlist) including [inflected forms](documentation/glossary?term=inflection), contact us and we can help.    <div id=\"wordlist\"></div>   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.wordlist_source_lang_filters_basic_get_with_http_info(source_lang, filters_basic, app_id, app_key, async=True)
        >>> result = thread.get()

        :param async bool
        :param str source_lang: IANA language code (required)
        :param str filters_basic: Semicolon separated list of wordlist parameters, presented as value pairs: LexicalCategory, domains, regions, registers. Parameters can take comma separated list of values. E.g., lexicalCategory=noun,adjective;domains=sport. Number of values limited to 5. (required)
        :param str app_id: App ID Authentication Parameter (required)
        :param str app_key: App Key Authentication Parameter (required)
        :param str limit: Limit the number of results per response. Default and maximum limit is 5000.
        :param str offset: Offset the start number of the result
        :return: Wordlist
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['source_lang', 'filters_basic', 'app_id', 'app_key', 'limit', 'offset']  # noqa: E501
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method wordlist_source_lang_filters_basic_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'source_lang' is set
        if ('source_lang' not in params or
                params['source_lang'] is None):
            raise ValueError("Missing the required parameter `source_lang` when calling `wordlist_source_lang_filters_basic_get`")  # noqa: E501
        # verify the required parameter 'filters_basic' is set
        if ('filters_basic' not in params or
                params['filters_basic'] is None):
            raise ValueError("Missing the required parameter `filters_basic` when calling `wordlist_source_lang_filters_basic_get`")  # noqa: E501
        # verify the required parameter 'app_id' is set
        if ('app_id' not in params or
                params['app_id'] is None):
            raise ValueError("Missing the required parameter `app_id` when calling `wordlist_source_lang_filters_basic_get`")  # noqa: E501
        # verify the required parameter 'app_key' is set
        if ('app_key' not in params or
                params['app_key'] is None):
            raise ValueError("Missing the required parameter `app_key` when calling `wordlist_source_lang_filters_basic_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'source_lang' in params:
            path_params['source_lang'] = params['source_lang']  # noqa: E501
        if 'filters_basic' in params:
            path_params['filters_basic'] = params['filters_basic']  # noqa: E501

        query_params = []
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501

        header_params = {}
        if 'app_id' in params:
            header_params['app_id'] = params['app_id']  # noqa: E501
        if 'app_key' in params:
            header_params['app_key'] = params['app_key']  # noqa: E501

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/wordlist/{source_lang}/{filters_basic}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Wordlist',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
