sclass YouTubeChannelInfo { S id, title, description, publishedAt; } static YouTubeChannelInfo youTubeChannelInfo(S channel) { channel = assertNempty(parseYouTubeChannel(channel)); S url ="https://www.googleapis.com/youtube/v3/channels?part=snippet&id=\*channel*/&key=" + youTubeDataAPIKey(); Map map = cast loadJSONPage(url); printStruct(map); new YouTubeChannelInfo info; //mapToObject(map, info); L items = cast map.get("items"); Map item = cast first(items); mapToObject(item, info); Map snippet = cast item.get('snippet); mapToObject(snippet, info); ret info; }