public PagedModel <V2ContactAlliance> Alliance(SsoToken token, int allianceId, int page)
        {
            StaticMethods.CheckToken(token, AllianceScopes.esi_alliances_read_contacts_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.ContactsV2Alliance(allianceId, page), _testing);

            EsiModel esiRaw = PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Get(StaticMethods.CreateHeaders(token), url, 300));

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

            IList <V2ContactAlliance> mapped = _mapper.Map <IList <EsiV2ContactAlliance>, IList <V2ContactAlliance> >(esiModel);

            return(new PagedModel <V2ContactAlliance> {
                Model = mapped, MaxPages = esiRaw.MaxPages, CurrentPage = page
            });
        }
示例#2
0
        public async Task <PagedModel <V1ContractsCorporation> > CorporationAsync(SsoToken token, int corporationId, int page)
        {
            StaticMethods.CheckToken(token, ContractScopes.esi_contracts_read_corporation_contracts_v1);

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

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

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

            IList <V1ContractsCorporation> mapped = _mapper.Map <IList <EsiV1ContractsCorporation>, IList <V1ContractsCorporation> >(esiModel);

            return(new PagedModel <V1ContractsCorporation> {
                Model = mapped, MaxPages = esiRaw.MaxPages, CurrentPage = page
            });
        }
        public PagedModel <V2CorporationBlueprints> Blueprints(SsoToken token, long corporationId, int page)
        {
            StaticMethods.CheckToken(token, CorporationScopes.esi_corporations_read_blueprints_v1);

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

            EsiModel esiRaw = PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Get(StaticMethods.CreateHeaders(token), url, 3600));

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

            IList <V2CorporationBlueprints> mapped = _mapper.Map <IList <EsiV2CorporationBlueprints>, IList <V2CorporationBlueprints> >(esiModel);

            return(new PagedModel <V2CorporationBlueprints> {
                Model = mapped, MaxPages = esiRaw.MaxPages, CurrentPage = page
            });
        }
示例#4
0
        public async Task <PagedModel <V1MailCharacter> > CharacterAsync(SsoToken token, int lastMailId)
        {
            StaticMethods.CheckToken(token, MailScopes.esi_mail_read_mail_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.MailV1Character(token.CharacterId, lastMailId), _testing);

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

            IList <EsiV1MailCharacter> esiMail = JsonConvert.DeserializeObject <IList <EsiV1MailCharacter> >(raw.Model);

            IList <V1MailCharacter> mapped = _mapper.Map <IList <EsiV1MailCharacter>, IList <V1MailCharacter> >(esiMail);

            return(new PagedModel <V1MailCharacter> {
                Model = mapped, CurrentPage = lastMailId
            });
        }
        public PagedModel <V1CorporationRolesHistory> RoleHistory(SsoToken token, long corporationId, int page)
        {
            StaticMethods.CheckToken(token, CorporationScopes.esi_corporations_read_corporation_membership_v1);

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

            EsiModel esiRaw = PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Get(StaticMethods.CreateHeaders(token), url, 3600));

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

            IList <V1CorporationRolesHistory> mapped = _mapper.Map <IList <EsiV1CorporationRolesHistory>, IList <V1CorporationRolesHistory> >(esiModel);

            return(new PagedModel <V1CorporationRolesHistory> {
                CurrentPage = page, MaxPages = esiRaw.MaxPages, Model = mapped
            });
        }
        public async Task <PagedModel <V3CorporationStructures> > StructuresAsync(SsoToken token, long corporationId, int page)
        {
            StaticMethods.CheckToken(token, CorporationScopes.esi_corporations_read_structures_v1);

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

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

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

            IList <V3CorporationStructures> mapped = _mapper.Map <IList <EsiV3CorporationStructures>, IList <V3CorporationStructures> >(esiModel);

            return(new PagedModel <V3CorporationStructures> {
                CurrentPage = page, MaxPages = esiRaw.MaxPages, Model = mapped
            });
        }
        public async Task <PagedModel <V1PlanetaryInteractionCorporationCustomsOffice> > CorporationsCustomsOfficesAsync(SsoToken token, int corporationId, int page)
        {
            StaticMethods.CheckToken(token, PlanetScopes.esi_planets_read_customs_offices_v1);

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

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

            IList <EsiV1PlanetaryInteractionCorporationCustomsOffice> esiCustomOffices = JsonConvert.DeserializeObject <IList <EsiV1PlanetaryInteractionCorporationCustomsOffice> >(esiRaw.Model);

            IList <V1PlanetaryInteractionCorporationCustomsOffice> mapped = _mapper.Map <IList <EsiV1PlanetaryInteractionCorporationCustomsOffice>, IList <V1PlanetaryInteractionCorporationCustomsOffice> >(esiCustomOffices);

            return(new PagedModel <V1PlanetaryInteractionCorporationCustomsOffice> {
                Model = mapped, MaxPages = esiRaw.MaxPages, CurrentPage = page
            });
        }
        public async Task <PagedModel <V1MarketCharacterHistoricOrders> > CharacterOrdersHistoricAsync(SsoToken token, int page)
        {
            StaticMethods.CheckToken(token, MarketScopes.esi_markets_read_character_orders_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.MarketV1CharacterOrdersHistoric(token.CharacterId, page), _testing);

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

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

            IList <V1MarketCharacterHistoricOrders> mapped = _mapper.Map <IList <EsiV1MarketCharacterHistoricOrders>, IList <V1MarketCharacterHistoricOrders> >(esiModel);

            return(new PagedModel <V1MarketCharacterHistoricOrders> {
                Model = mapped, MaxPages = esiRaw.MaxPages, CurrentPage = page
            });
        }
        public PagedModel <V1MarketStructure> Structure(SsoToken token, long structureId, int page)
        {
            StaticMethods.CheckToken(token, MarketScopes.esi_markets_structure_markets_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.MarketV1Structure(structureId, page), _testing);

            EsiModel esiRaw = PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Get(StaticMethods.CreateHeaders(token), url, 300));

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

            IList <V1MarketStructure> mapped = _mapper.Map <IList <EsiV1MarketStructure>, IList <V1MarketStructure> >(esiModel);

            return(new PagedModel <V1MarketStructure> {
                Model = mapped, MaxPages = esiRaw.MaxPages, CurrentPage = page
            });
        }
        public PagedModel <V3MarketCorporationOrdersHistoric> CorporationOrdersHistoric(SsoToken token, int corporationId, int page)
        {
            StaticMethods.CheckToken(token, MarketScopes.esi_markets_read_corporation_orders_v1);

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

            EsiModel esiRaw = PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Get(StaticMethods.CreateHeaders(token), url, 3600));

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

            IList <V3MarketCorporationOrdersHistoric> mapped = _mapper.Map <IList <EsiV3MarketCorporationOrdersHistoric>, IList <V3MarketCorporationOrdersHistoric> >(esiModel);

            return(new PagedModel <V3MarketCorporationOrdersHistoric> {
                Model = mapped, MaxPages = esiRaw.MaxPages, CurrentPage = page
            });
        }
示例#11
0
        public PagedModel <V2BookmarksCharacterFolder> CharacterBookmarkFolders(SsoToken token, int page)
        {
            StaticMethods.CheckToken(token, BookmarkScopes.esi_bookmarks_read_character_bookmarks_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.BookmarksV2CharactersFolders(token.CharacterId, page), _testing);

            EsiModel esiRaw = PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Get(StaticMethods.CreateHeaders(token), url, 3600));

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

            IList <V2BookmarksCharacterFolder> mapped = _mapper.Map <IList <EsiV2BookmarksCharacterFolder>, IList <V2BookmarksCharacterFolder> >(esiModel);

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