@classmethod
def _flatten_param(cls, params):
    """
        Flatten the query params to be compatible with the API.
        :param params: The params object to process.
        :return: Nested dict/list values are flatten into single level dict.
        """
    flatten = params
    if type(params) in [dict, list]:
        flatten = {}
        for k, v in (params.items() if type(params) is dict else enumerate(
            params)):
            f = cls._flatten_param(v)
            if type(f) is dict:
                for kk, vv in f.items():
                    flatten[u'%s.%s' % (k, kk)] = vv
            else:
                flatten[k] = v
    return flatten
