use of com.github.jamesnetherton.zulip.client.api.server.response.GetAllEmojiApiResponse in project zulip-java-client by jamesnetherton.
the class GetAllEmojiApiRequest method execute.
/**
* Executes the Zulip API request for getting all custom emoji.
*
* @return List of all custom {@link CustomEmoji}
* @throws ZulipClientException if the request was not successful
*/
@Override
public List<CustomEmoji> execute() throws ZulipClientException {
GetAllEmojiApiResponse response = client().get(REALM_EMOJI, getParams(), GetAllEmojiApiResponse.class);
List<CustomEmoji> emojis = new ArrayList<>();
Map<String, CustomEmoji> emojiMap = response.getEmoji();
emojiMap.keySet().stream().map(emojiMap::get).forEach(emojis::add);
return emojis;
}
Aggregations