public async Task <WebhookResponse> GetIndicesValuesAsync() { var tickers = new List <string> { "^DJI", "^IXIC", "^INX" }; var tmpStr = new StringBuilder(); tmpStr.AppendJoin(',', tickers); QuotesFromWorldTrading indexData = await _envHandler.ObtainFromWorldTrading(tmpStr.ToString()); WebhookResponse returnValue = BuildOutputMessage(indexData); return(returnValue); }
public async Task <WebhookResponse> GetMarketData(GoogleCloudDialogflowV2WebhookRequest stockQuoteParameter) { _log.LogTrace("Starting to obtain quotes"); var companyNameToResolve = stockQuoteParameter.QueryResult.Parameters[companyName].ToString(); var tickersToUse = await _obtainCompanyDetails.ResolveCompanyNameOrTicker(companyNameToResolve); if (string.IsNullOrWhiteSpace(tickersToUse)) { return(new WebhookResponse { FulfillmentText = $"Could not resolve {companyNameToResolve}" }); } var quotes = await _envHandler.ObtainFromWorldTrading(tickersToUse); string returnValueMsg = BuildOutputMsg(quotes); var returnValue = new WebhookResponse { FulfillmentText = returnValueMsg }; return(returnValue); }