public GetCountryInfoResponse GetCountryInfo(string location, GetCountryInfoRequest req) { var agent = _agents.GetAgent(location); _agentConnectConfig.DecorateRequest(req); return(_testRunner.AgentConnect.GetCountryInfo(agent, req)); }
public IHttpActionResult GetCountryInfo([FromBody] GetCountryInfoRequest req) { req = req ?? new GetCountryInfoRequest(); var countriesRespVm = _lookupBusiness.GetCountryInfo(req); return(Ok(countriesRespVm)); }
/// <summary> /// Get country info by lookup key /// </summary> /// <param name="agentLocation"></param> /// <param name="lookupKey"></param> /// <param name="cachedVersion"></param> /// <returns></returns> public GetCountryInfoResponse GetCountryInfo(string agentLocation, string lookupKey, string cachedVersion = null) { var request = new GetCountryInfoRequest { CachedVersion = cachedVersion, LookupKey = lookupKey }; return(_acIntegration.GetCountryInfo(agentLocation, request)); }
public AcApiResponse <GetCountryInfoResponse, ApiData> GetCountryInfo(GetCountryInfoRequest req) { var resp = _agentConnectIntegration.GetCountryInfo(req); var apiResp = new AcApiResponse <GetCountryInfoResponse, ApiData> { BusinessMetadata = MapperHelper.SetResponseProperties(resp.Payload?.Flags, DataSource.AgentConnect), ResponseData = resp }; return(apiResp); }
public override GetCountryInfoResponse GetCountryInfo(Agent agent, GetCountryInfoRequest getCountryInfoRequest) { GetCountryInfoResponse countryInfo; var countryInfoKeyFormatted = string.Format(CacheKeys.COUNTRYINFOKEY, agent.Language); var cachedResult = _cacheManager.Contains <CachedObjectResponseContainer <GetCountryInfoResponse> >(countryInfoKeyFormatted, CacheRegion.Global); Func <GetCountryInfoResponse> countryInfoCacheSaveFunction = delegate() { var version = getCountryInfoRequest.CachedVersion; getCountryInfoRequest.CachedVersion = null; countryInfo = base.GetCountryInfo(agent, getCountryInfoRequest); var CachedContainer = CacheAheadHelper.PopulateCacheMetadata <GetCountryInfoResponse>(countryInfo, CachePolicies.FullWeek); _cacheManager.Save(countryInfoKeyFormatted, CachedContainer, CacheRegion.Global, CachePolicies.FullWeek); getCountryInfoRequest.CachedVersion = version; return(countryInfo); }; if (cachedResult.Exists) { CacheAheadHelper.ExecuteCacheAheadProcess <GetCountryInfoResponse>(countryInfoCacheSaveFunction, cachedResult.CachedObj.CacheMetadata); if (getCountryInfoRequest.CachedVersion != cachedResult.CachedObj.DataObject.Payload.Version) { countryInfo = cachedResult.CachedObj.DataObject; } else { countryInfo = new GetCountryInfoResponse { Payload = new GetCountryInfoResponsePayload { Version = getCountryInfoRequest.CachedVersion } }; } } else { countryInfo = countryInfoCacheSaveFunction(); } return(countryInfo); }
public virtual async Task <GetCountryInfoResponse> GetCountryInfoAsync(Agent agent, GetCountryInfoRequest getCountryInfoRequest) { return(await AgentConnect.GetCountryInfoAsync(agent, getCountryInfoRequest)); }
public virtual GetCountryInfoResponse GetCountryInfo(Agent agent, GetCountryInfoRequest getCountryInfoRequest) { return(AgentConnect.GetCountryInfo(agent, getCountryInfoRequest)); }
public GetCountryInfoResponse GetCountryInfo(GetCountryInfoRequest getCountryInfoRequest) { var agent = AuthIntegration.GetAgent(); return(_agentConnect.GetCountryInfo(agent, getCountryInfoRequest)); }