public async Task <Stock> GetStock(long id, string jwtToken) { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _publicShareOwnerControl.BaseAddress .AppendPathSegments(_publicShareOwnerControl.PublicSharePath.Stock, id) .WithOAuthBearerToken(jwtToken).GetJsonAsync <Stock>())); }
public async Task <ActionResult <ValidationResult> > RemoveBuyRequest(long id, string jwtToken) { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _stockTraderBroker.BaseAddress .AppendPathSegments(_stockTraderBroker.StockTraderBrokerPath.BuyRequest, id) .WithOAuthBearerToken(jwtToken).DeleteAsync().ReceiveJson <ValidationResult>())); }
public async Task <List <BuyRequestModel> > GetBuyRequests(Guid id, string jwtToken) { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _stockTraderBroker.BaseAddress .AppendPathSegment(_stockTraderBroker.StockTraderBrokerPath.BuyRequest).SetQueryParam("ownerId", id) .WithOAuthBearerToken(jwtToken).GetJsonAsync <List <BuyRequestModel> >())); }
public async Task <List <SellRequestModel> > GetSellRequestsForSpecificStock(long stockId, string jwtToken) { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _stockTraderBroker.BaseAddress .AppendPathSegment(_stockTraderBroker.StockTraderBrokerPath.SellRequest).SetQueryParam("stockId", stockId) .WithOAuthBearerToken(jwtToken).GetJsonAsync <List <SellRequestModel> >())); }
public async Task <ValidationResult> PostBuyRequest(BuyRequestInput request, string jwtToken) { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _stockTraderBroker.BaseAddress .AppendPathSegment(_stockTraderBroker.StockTraderBrokerPath.BuyRequest) .WithOAuthBearerToken(jwtToken).PostJsonAsync(request).ReceiveJson <ValidationResult>())); }
public async Task <ReservationResult> Reserve(ReservationRequest reservationRequest, string jwtToken) { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _bankService.BaseAddress.AppendPathSegment(_bankService.BankPath.Reservation) .WithOAuthBearerToken(jwtToken).PostJsonAsync(reservationRequest).ReceiveJson <ReservationResult>())); }
public async Task IssueShares(IssueSharesRequest issueSharesRequest, long id, string jwtToken) { await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _publicShareOwnerControl.BaseAddress.AppendPathSegments(_publicShareOwnerControl.PublicSharePath.Stock, id, "Issue") .PutJsonAsync(issueSharesRequest)); }
public async Task <StockResponse> PostStock(StockRequest stockRequest, string jwtToken) { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _publicShareOwnerControl.BaseAddress.AppendPathSegment(_publicShareOwnerControl.PublicSharePath.Stock) .PostJsonAsync(stockRequest).ReceiveJson <StockResponse>())); }
public async Task <List <StockWithOwnerInfoResponse> > GetStockWithOwnerInfo(Guid id, string jwtToken) { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _publicShareOwnerControl.BaseAddress.AppendPathSegment(_publicShareOwnerControl.PublicSharePath.Stock) .WithOAuthBearerToken(jwtToken).SetQueryParam("ownerId", id).GetJsonAsync <List <StockWithOwnerInfoResponse> >())); }
public async Task <List <StockResponse> > GetAllStocks() { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _publicShareOwnerControl.BaseAddress.AppendPathSegment(_publicShareOwnerControl.PublicSharePath.Stock) .GetJsonAsync <List <StockResponse> >())); }
public async Task <ValidationResult> RemoveSharesForSale(long id, string jwtToken) { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _stockShareRequester.BaseAddress.AppendPathSegments(_stockShareRequester.StockShareProviderPath.StockSell, id) .DeleteAsync().ReceiveJson <ValidationResult>())); }
public async Task <ValidationResult> SetSharesForSale(SellRequestRequest sellRequestRequest, string jwtToken) { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _stockShareRequester.BaseAddress.AppendPathSegment(_stockShareRequester.StockShareProviderPath.StockSell) .PostJsonAsync(sellRequestRequest).ReceiveJson <ValidationResult>())); }
public async Task <List <HistoryResponse> > GetHistory(Guid id, string jwtToken) { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _historyService.BaseAddress.AppendPathSegment(_historyService.HistoryPath.History).SetQueryParam("user", id) .WithOAuthBearerToken(jwtToken).GetJsonAsync <List <HistoryResponse> >())); }
public async Task Deposit(DepositRequest request, Guid id, string jwtToken) { await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _bankService.BaseAddress.AppendPathSegments(_bankService.BankPath.Account, $"{id}/balance") .WithOAuthBearerToken(jwtToken).PutJsonAsync(request)); }
public async Task <GetAccountResponse> GetAccount(GetAccountRequest request, string jwtToken) { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _bankService.BaseAddress.AppendPathSegments(_bankService.BankPath.Account, request.Id) .WithOAuthBearerToken(jwtToken).GetJsonAsync <GetAccountResponse>())); }
public async Task CreateAccount(CreateAccountRequest request, string jwtToken) { await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _bankService.BaseAddress.AppendPathSegment(_bankService.BankPath.Account) .WithOAuthBearerToken(jwtToken).PostJsonAsync(request)); }
public async Task <ValidationResult> PlaceBid(PlaceBidRequest placeBidRequest, string jwtToken) { return(await PolicyHelper.ThreeRetriesAsync().ExecuteAsync(() => _stockShareRequester.BaseAddress.AppendPathSegment(_stockShareRequester.StockShareRequesterPath.StockBid) .WithOAuthBearerToken(jwtToken).PostJsonAsync(placeBidRequest).ReceiveJson <ValidationResult>())); }