@staticmethod
def list_to_headers(headers=None, key=None, type_of_key='str', key_index=
    None, types=None):
    """
        Transform list item to the object we need send to Devo for headers

        :param list headers: list of headers names
        :param str key: key name (Must be in headers)
        :param str type_of_key: type of the key field
        :result str:
        """
    if key is not None:
        out = '[{"%s":{"type":"%s","key":true}}' % (key, types[key_index] if
            types else type_of_key)
    elif key_index is not None:
        key = headers[key_index]
        out = '[{"%s":{"type":"%s","key":true}}' % (key, types[key_index] if
            types else type_of_key)
    else:
        raise Exception('Not key identified')
    if headers is None:
        return out + ']'
    aux = -1
    for item in headers:
        aux += 1
        if item == key:
            continue
        field_type = 'str' if not isinstance(types, dict) else types[aux]
        out += ',{"%s":{"type":"%s"}}' % (item, field_type)
    out += ']'
    return out
