Beispiel #1
0
        public async Task <PagedModel <V1BookmarksCorporationFolder> > CorporationBookmarkFoldersAsync(SsoToken token, int corporationId, int page)
        {
            StaticMethods.CheckToken(token, BookmarkScopes.esi_bookmarks_read_corporation_bookmarks_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.BookmarksV1CorporationsFolders(corporationId, page), _testing);

            EsiModel esiRaw = await PollyPolicies.WebExceptionRetryWithFallbackAsync.ExecuteAsync(async() => await _webClient.GetAsync(StaticMethods.CreateHeaders(token), url, 3600));

            IList <EsiV1BookmarksCorporationFolder> esiModel = JsonConvert.DeserializeObject <IList <EsiV1BookmarksCorporationFolder> >(esiRaw.Model);

            IList <V1BookmarksCorporationFolder> mapped = _mapper.Map <IList <EsiV1BookmarksCorporationFolder>, IList <V1BookmarksCorporationFolder> >(esiModel);

            return(new PagedModel <V1BookmarksCorporationFolder> {
                Model = mapped, MaxPages = esiRaw.MaxPages, CurrentPage = page
            });
        }