Exemplo n.º 1
0
        public async Task <Store> GetStoreByIdAsync(string storeId, CancellationToken ct = default)
        {
            var storeList = await _httpRequestService.GetAsync <List <Store> >("stores", ct).ConfigureAwait(false);

            var store = storeList.FirstOrDefault(w => w.Id == storeId);

            return(store);
        }
Exemplo n.º 2
0
        private async Task <string> GetBackendVersion(bool isLive)
        {
            try
            {
                var responce = await _httpRequestService.GetAsync <IsAliveResponse>("isAlive", isLive, 3);

                return(responce.Version);
            }
            catch (MaintenanceException ex)
            {
                return($"Maintenance since {ex.EnabledAt}");
            }
            catch
            {
                return("Error");
            }
        }
        async Task <TaskStatus> GetReportExportTaskStatus(string exportId)
        {
            HttpResponseMessage exportStatusResponse = await httpRequestService.GetAsync($"{DocumentExportStatusPath(exportId)}");

            return(JsonConvert.DeserializeObject <ReportExportTaskStatusResponse>(await exportStatusResponse.Content.ReadAsStringAsync()).TaskStatus);
        }