public override IMovilwayApiResponse PerformUtibaOperation(IMovilwayApiRequest requestObject, UMarketSCClient utibaClientProxy, String sessionID) { GetAgentGroupsRequestBody request = requestObject as GetAgentGroupsRequestBody; GetAgentGroupsResponseBody response = null; GetAgentInfoResponseBody agentInfo = new ServiceExecutionDelegator <GetAgentInfoResponseBody, GetAgentInfoRequestBody>().ResolveRequest( new GetAgentInfoRequestBody() { AuthenticationData = new AuthenticationData() { SessionID = sessionID }, Agent = request.Agent, DeviceType = request.DeviceType }, ApiTargetPlatform.Utiba, ApiServiceName.GetAgentInfo); AgentGroupsResponse utibaAgentGroupsResponse = utibaClientProxy.getAgentGroupByAgentID(new getAgentGroupByAgentID() { getAgentGroupByAgentIDRequest = new getAgentGroupByAgentIDRequest() { sessionid = sessionID, device_type = request.DeviceType, agentID = agentInfo.AgentInfo.AgentID } }); if (utibaAgentGroupsResponse != null) { response = new GetAgentGroupsResponseBody() { ResponseCode = Utils.BuildResponseCode(utibaAgentGroupsResponse.AgentGroupsReturn.result, utibaAgentGroupsResponse.AgentGroupsReturn.result_namespace), ResponseMessage = utibaAgentGroupsResponse.AgentGroupsReturn.result_namespace, TransactionID = utibaAgentGroupsResponse.AgentGroupsReturn.transid }; if (utibaAgentGroupsResponse.AgentGroupsReturn.agentGroups != null && utibaAgentGroupsResponse.AgentGroupsReturn.agentGroups.Length > 0) { response.GroupList = new GroupList(); foreach (AgentGroup agentGroup in utibaAgentGroupsResponse.AgentGroupsReturn.agentGroups) { response.GroupList.Add(new GroupInfo() { GroupID = agentGroup.ID, Name = agentGroup.name, Category = agentGroup.category, Type = agentGroup.type }); } } } return(response); }
public override IMovilwayApiResponse PerformUtibaOperation(IMovilwayApiRequest requestObject, UMarketSCClient utibaClientProxy, String sessionID) { GetGroupListRequestBody request = requestObject as GetGroupListRequestBody; GetGroupListResponseBody response = null; AgentGroupsResponse utibaGetAllAgentGroupsResponse = utibaClientProxy.getAllAgentGroups(new getAllAgentGroups() { getAllAgentGroupsRequest = new getAllGroupsRequestType() { sessionid = sessionID, device_type = request.DeviceType, filter = new getAllGroupsRequestTypeFilter() { category = "agent", includeUncategorised = true } } }); if (utibaGetAllAgentGroupsResponse != null) { response = new GetGroupListResponseBody() { ResponseCode = Utils.BuildResponseCode(utibaGetAllAgentGroupsResponse.AgentGroupsReturn.result, utibaGetAllAgentGroupsResponse.AgentGroupsReturn.result_namespace), ResponseMessage = utibaGetAllAgentGroupsResponse.AgentGroupsReturn.result_namespace, TransactionID = utibaGetAllAgentGroupsResponse.AgentGroupsReturn.transid }; if (utibaGetAllAgentGroupsResponse.AgentGroupsReturn.agentGroups != null && utibaGetAllAgentGroupsResponse.AgentGroupsReturn.agentGroups.Length > 0) { response.GroupList = new GroupList(); foreach (AgentGroup agentGroup in utibaGetAllAgentGroupsResponse.AgentGroupsReturn.agentGroups) { response.GroupList.Add(new GroupInfo() { GroupID = agentGroup.ID, Name = agentGroup.name, Category = agentGroup.category, Type = agentGroup.type }); } } } return(response); }