use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class BotManager method createStopBotRequest.
public static String createStopBotRequest(StartAndStopBotRequest request, String uniqueId) throws PodChatException {
validateThreadId(request.getThreadId());
validateBotName(request.getBotName());
JsonObject content = new JsonObject();
content.addProperty("botName", request.getBotName());
AsyncMessage message = new AsyncMessage();
message.setContent(content.toString());
message.setToken(CoreConfig.token);
message.setType(ChatMessageType.Constants.STOP_BOT);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
message.setSubjectId(request.getThreadId());
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 BotManager method createGetUserBotsRequest.
public static String createGetUserBotsRequest(GetUserBotsRequest request, String uniqueId) throws PodChatException {
AsyncMessage message = new AsyncMessage();
message.setToken(CoreConfig.token);
message.setType(ChatMessageType.Constants.GET_USER_BOTS);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
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 createDeActiveAssistantRequest.
public static String createDeActiveAssistantRequest(DeActiveAssistantRequest request, String uniqueId) {
String content = App.getGson().toJson(request.getAssistantVos());
AsyncMessage message = new ChatMessage();
message.setType(ChatMessageType.Constants.DEACTIVE_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 createGetAssistantsRequest.
public static String createGetAssistantsRequest(GetAssistantRequest request, String uniqueId) {
JsonObject content = new JsonObject();
content.addProperty("contactType", request.getTypeCode() != null ? request.getTypeCode() : CoreConfig.typeCode);
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_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 createUnBlockAssistantRequest.
public static String createUnBlockAssistantRequest(BlockUnblockAssistantRequest request, String uniqueId) {
String content = App.getGson().toJson(request.getAssistantVos());
AsyncMessage message = new ChatMessage();
message.setType(ChatMessageType.Constants.UNBLOCK_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);
}
Aggregations