import requests
import json


def folder0_content(folder0_id, host, token):
    """
    Modules
    -------
    request, json
    ----------
    Parameters
    ----------
    folder0_id : Onedata folder level 0 id containing the data to publish.
    host : OneData provider (e.g., ceta-ciemat-02.datahub.egi.eu).
    token : OneData personal access token.
    -------
    Returns
    -------
    all_level0: "name" and "id" of the folders contained in the folder defined by "folder0_id"
    """

    OneData_urlchildren = "https://" + host + '/api/v3/oneprovider/data/' + folder0_id + "/children"
    request_param = {'X-Auth-Token': token}
    r_level0 = requests.get(OneData_urlchildren, headers=request_param)
    all_level0 = json.loads(r_level0.text)

    return (all_level0)