public async Task<GetQuotesResponse> GetQuotes(GetQuotesRequest request) { var command = new GetQuotesCommand(request.Symbols, Gateway.AccesToken); //Send command to API await MakeApiCall(command); //Some handling of the response var response = new GetQuotesResponse(command.RawResponse, command.MessageFormat); return response; }
private async void btnGo_Click(object sender, EventArgs e) { if (!ValidateInput()) return; string responseText = ""; if (ApiCall.CompareTo("Market/Get Quotes") == 0) { var request = new GetQuotesRequest(txtSymbols.Text, ","); var response = await ApiGateway.MarketData.GetQuotes(request); responseText = response.RawResponse.Content; } else if (ApiCall.CompareTo("Market/Get Option Expirations") == 0) { var request = new GetOptionExpirationRequest(txtSymbols.Text); var response = await ApiGateway.MarketData.GetOptionExpirations(request); responseText = response.RawResponse.Content; } txtResponse.Text = responseText; }