use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class HashTagManager method getHashTagList.
public static String getHashTagList(RequestGetHashTagList request, String uniqueId) {
long threadId = request.getThreadId();
JsonObject criteriaVO = new JsonObject();
long count = request.getCount() > 0 ? request.getCount() : 50;
criteriaVO.addProperty("count", count);
criteriaVO.addProperty("offset", request.getOffset());
criteriaVO.addProperty("hashtag", request.getHashtag());
AsyncMessage message = new AsyncMessage();
message.setContent(criteriaVO.toString());
message.setType(ChatMessageType.Constants.GET_HISTORY);
message.setToken(CoreConfig.token);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
message.setSubjectId(threadId);
message.setTypeCode(request.getTypeCode() != null ? request.getTypeCode() : CoreConfig.typeCode);
return App.getGson().toJson(message);
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class AssistantManager method createGetBlockedAssistantsRequest.
public static String createGetBlockedAssistantsRequest(GetBlockedAssistantsRequest request, String uniqueId) {
JsonObject content = new JsonObject();
content.addProperty("contactType", request.getTypeCode());
if ((Long) request.getOffset() != null) {
content.addProperty("offset", request.getOffset());
}
if ((Long) request.getCount() != null) {
content.addProperty("count", request.getCount());
} else {
content.addProperty("count", 50);
}
AsyncMessage message = new ChatMessage();
message.setType(ChatMessageType.Constants.GET_BLOCKED_ASSISTANTS);
message.setToken(CoreConfig.token);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setTypeCode(request.getTypeCode() != null ? request.getTypeCode() : CoreConfig.typeCode);
message.setContent(App.getGson().toJson(content));
message.setUniqueId(uniqueId);
return App.getGson().toJson(message);
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class AssistantManager method createBlockAssistantsRequest.
public static String createBlockAssistantsRequest(BlockUnblockAssistantRequest request, String uniqueId) {
String content = App.getGson().toJson(request.getAssistantVos());
AsyncMessage message = new ChatMessage();
message.setType(ChatMessageType.Constants.BLOCK_ASSISTANT);
message.setToken(CoreConfig.token);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setTypeCode(request.getTypeCode() != null ? request.getTypeCode() : CoreConfig.typeCode);
message.setContent(content);
message.setUniqueId(uniqueId);
return App.getGson().toJson(message);
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class AssistantManager method createGetAssistantHistoryRequest.
public static String createGetAssistantHistoryRequest(GetAssistantHistoryRequest request, String uniqueId) {
JsonObject content = new JsonObject();
AsyncMessage message = new ChatMessage();
message.setType(ChatMessageType.Constants.GET_ASSISTANT_HISTORY);
message.setToken(CoreConfig.token);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setTypeCode(request.getTypeCode() != null ? request.getTypeCode() : CoreConfig.typeCode);
message.setContent(App.getGson().toJson(content));
message.setUniqueId(uniqueId);
return App.getGson().toJson(message);
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class BotManager method createDefineBotCommandRequest.
public static String createDefineBotCommandRequest(DefineBotCommandRequest request, String uniqueId) throws PodChatException {
validateCommands(request.getCommandList());
AsyncMessage message = new AsyncMessage();
message.setContent(App.getGson().toJson(request));
message.setToken(CoreConfig.token);
message.setType(ChatMessageType.Constants.DEFINE_BOT_COMMAND);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
message.setTypeCode(request.getTypeCode() != null ? request.getTypeCode() : CoreConfig.typeCode);
return App.getGson().toJson(message);
}
Aggregations