Exemple #1
0
        public void RenameWing(SsoToken token, long fleetId, int wingId, string name)
        {
            StaticMethods.CheckToken(token, FleetScopes.esi_fleets_write_fleet_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.FleetsV1WingsRename(fleetId, wingId), _testing);

            PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Put(StaticMethods.CreateHeaders(token), url, name));
        }
Exemple #2
0
        public void Metadata(SsoToken token, int mailId, V1MailMetadata metadata)
        {
            StaticMethods.CheckToken(token, MailScopes.esi_mail_organize_mail_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.MailV1Metadata(token.CharacterId, mailId), _testing);

            EsiV1MailMetadata model = _mapper.Map <EsiV1MailMetadata>(metadata);

            PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Put(StaticMethods.CreateHeaders(token), url, JsonConvert.SerializeObject(model)));
        }
        public void CharacterEdit(SsoToken token, V2ContactCharacterEdit model)
        {
            StaticMethods.CheckToken(token, CharacterScopes.esi_characters_write_contacts_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.ContactsV2CharacterEdit(token.CharacterId, model), _testing);

            string jsonObject = JsonConvert.SerializeObject(model.ContactIds);

            PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Put(StaticMethods.CreateHeaders(token), url, jsonObject));
        }
Exemple #4
0
        public void FleetUpdate(SsoToken token, long fleetId, V1FleetUpdate updateModel)
        {
            StaticMethods.CheckToken(token, FleetScopes.esi_fleets_write_fleet_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.FleetsV1FleetUpdate(fleetId), _testing);

            EsiV1FleetUpdate model = _mapper.Map <EsiV1FleetUpdate>(updateModel);

            string objectModel = JsonConvert.SerializeObject(model);

            PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Put(StaticMethods.CreateHeaders(token), url, objectModel));
        }
        public void RespondEvent(SsoToken token, int eventId, V3CalendarResponse response)
        {
            StaticMethods.CheckToken(token, CalendarScopes.esi_calendar_respond_calendar_events_v1);

            EsiV3CalendarResponse esiResponse = _mapper.Map <EsiV3CalendarResponse>(response);

            string jsonResponse = JsonConvert.SerializeObject(esiResponse);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.CalendarV3EventResponse(token.CharacterId, eventId), _testing);

            PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Put(StaticMethods.CreateHeaders(token), url, jsonResponse));
        }
        public async Task <V1FwCorporationStats> CorporationStatsAsync(SsoToken token, int corporationId)
        {
            StaticMethods.CheckToken(token, CorporationScopes.esi_corporations_read_fw_stats_v1);

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

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

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

            return(_mapper.Map <EsiV1FwCorporationStats, V1FwCorporationStats>(esiModel));
        }
        public async Task <IList <V1FwWars> > WarsAsync()
        {
            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.FactionWarfareV1Wars(), _testing);

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

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

            return(_mapper.Map <IList <EsiV1FwWars>, IList <V1FwWars> >(esiModel));
        }
Exemple #8
0
        public PagedModel <V1WalletCharacterTransactions> CharacterTransactions(SsoToken token, int lastTransactionId)
        {
            StaticMethods.CheckToken(token, WalletScopes.esi_wallet_read_character_wallet_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.WalletV4CharactersWalletTransaction(token.CharacterId, lastTransactionId), _testing);

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

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

            IList <V1WalletCharacterTransactions> mapped = _mapper.Map <IList <EsiV1WalletCharacterTransactions>, IList <V1WalletCharacterTransactions> >(esiModel);

            return(new PagedModel <V1WalletCharacterTransactions> {
                Model = mapped, CurrentPage = lastTransactionId, MaxPages = esiRaw.MaxPages
            });
        }
Exemple #9
0
        public async Task <double> CharacterAsync(SsoToken token)
        {
            StaticMethods.CheckToken(token, WalletScopes.esi_wallet_read_character_wallet_v1);

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

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

            return(JsonConvert.DeserializeObject <double>(esiRaw.Model));
        }
Exemple #10
0
        public PagedModel <V4WalletCorporationJournal> CorporationJournal(SsoToken token, int corporationId, int division, int page)
        {
            StaticMethods.CheckToken(token, WalletScopes.esi_wallet_read_corporation_wallets_v1);

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

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

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

            IList <V4WalletCorporationJournal> mapped = _mapper.Map <IList <EsiV4WalletCorporationJournal>, IList <V4WalletCorporationJournal> >(esiModel);

            return(new PagedModel <V4WalletCorporationJournal> {
                Model = mapped, MaxPages = esiRaw.MaxPages, CurrentPage = page
            });
        }
Exemple #11
0
        public async Task <V1OpportunitiesGroup> GroupAsync(int groupId)
        {
            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.OpportunitiesV1Group(groupId), _testing);

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

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

            return(_mapper.Map <V1OpportunitiesGroup>(esiModel));
        }
        public IList <V2AssetsCorporationLocation> CorporationLocations(SsoToken token, int corporationId, IList <long> ids)
        {
            StaticMethods.CheckToken(token, AssetScopes.esi_assets_read_corporation_assets_v1);

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

            string jsonObject = JsonConvert.SerializeObject(ids);

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

            IList <EsiV2AssetsCorporationLocation> esiAssetsLocations = JsonConvert.DeserializeObject <IList <EsiV2AssetsCorporationLocation> >(esiRaw.Model);

            return(_mapper.Map <IList <EsiV2AssetsCorporationLocation>, IList <V2AssetsCorporationLocation> >(esiAssetsLocations));
        }
        public PagedModel <V5AssetsCorporations> Corporations(SsoToken token, int corporationId, int page)
        {
            StaticMethods.CheckToken(token, AssetScopes.esi_assets_read_corporation_assets_v1);

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

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

            IList <EsiV5AssetsCorporations> esiCorporationAssets = JsonConvert.DeserializeObject <IList <EsiV5AssetsCorporations> >(raw.Model);

            IList <V5AssetsCorporations> mapped = _mapper.Map <IList <EsiV5AssetsCorporations>, IList <V5AssetsCorporations> >(esiCorporationAssets);

            return(new PagedModel <V5AssetsCorporations> {
                Model = mapped, MaxPages = raw.MaxPages, CurrentPage = page
            });
        }
Exemple #14
0
        public V1AllianceIcons Icons(int allianceId)
        {
            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.AllianceV1Icons(allianceId), _testing);

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

            EsiV1AllianceIcons esiAllianceIcons = JsonConvert.DeserializeObject <EsiV1AllianceIcons>(esiRaw.Model);

            return(_mapper.Map <EsiV1AllianceIcons, V1AllianceIcons>(esiAllianceIcons));
        }
Exemple #15
0
        public async Task <IList <int> > CorporationsAsync(int allianceId)
        {
            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.AllianceV1Corporations(allianceId), _testing);

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

            IList <int> esiAllianceCorporations = JsonConvert.DeserializeObject <IList <int> >(esiRaw.Model);

            return(esiAllianceCorporations);
        }
Exemple #16
0
        public async Task <IList <V1OpportunitiesCharacter> > CharacterAsync(SsoToken token)
        {
            StaticMethods.CheckToken(token, CharacterScopes.esi_characters_read_opportunities_v1);

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

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

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

            return(_mapper.Map <IList <EsiV1OpportunitiesCharacter>, IList <V1OpportunitiesCharacter> >(esiModel));
        }
Exemple #17
0
        public IList <int> Groups()
        {
            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.OpportunitiesV1Groups(), _testing);

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

            return(JsonConvert.DeserializeObject <IList <int> >(esiRaw.Model));
        }
        public async Task <PagedModel <V5AssetsCharacter> > CharactersAsync(SsoToken token, int page)
        {
            StaticMethods.CheckToken(token, AssetScopes.esi_assets_read_assets_v1);

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

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

            IList <EsiV5AssetsCharacter> esiCharacterAssets = JsonConvert.DeserializeObject <IList <EsiV5AssetsCharacter> >(raw.Model);

            IList <V5AssetsCharacter> mapped = _mapper.Map <IList <EsiV5AssetsCharacter>, IList <V5AssetsCharacter> >(esiCharacterAssets);

            return(new PagedModel <V5AssetsCharacter> {
                Model = mapped, MaxPages = raw.MaxPages, CurrentPage = page
            });
        }
Exemple #19
0
        public IList <V1WalletCorporationWallet> Corporation(SsoToken token, int corporationId)
        {
            StaticMethods.CheckToken(token, WalletScopes.esi_wallet_read_corporation_wallets_v1);

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

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

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

            return(_mapper.Map <IList <EsiV1WalletCorporationWallet>, IList <V1WalletCorporationWallet> >(esiModel));
        }
        public async Task <IList <V2AssetsCharacterLocation> > CharacterLocationAsync(SsoToken token, IList <long> ids)
        {
            StaticMethods.CheckToken(token, AssetScopes.esi_assets_read_assets_v1);

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

            string jsonObject = JsonConvert.SerializeObject(ids);

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

            IList <EsiV2AssetsCharacterLocation> esiAssetsLocations = JsonConvert.DeserializeObject <IList <EsiV2AssetsCharacterLocation> >(esiRaw.Model);

            return(_mapper.Map <IList <EsiV2AssetsCharacterLocation>, IList <V2AssetsCharacterLocation> >(esiAssetsLocations));
        }
Exemple #21
0
        public async Task <IList <V1WalletCorporationTransactions> > CorporationTransactionsAsync(SsoToken token, int corporationId, int division, int lastTransactionId)
        {
            StaticMethods.CheckToken(token, WalletScopes.esi_wallet_read_corporation_wallets_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.WalletV1CorporationDivisionsTransactions(corporationId, division, lastTransactionId), _testing);

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

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

            return(_mapper.Map <IList <EsiV1WalletCorporationTransactions>, IList <V1WalletCorporationTransactions> >(esiModel));
        }
        public IList <V1AssetsCharacterName> CharacterNames(SsoToken token, IList <long> ids)
        {
            StaticMethods.CheckToken(token, AssetScopes.esi_assets_read_assets_v1);

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

            string jsonObject = JsonConvert.SerializeObject(ids);

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

            IList <EsiV1AssetsCharacterNames> esiAssetsNames = JsonConvert.DeserializeObject <IList <EsiV1AssetsCharacterNames> >(esiRaw.Model);

            return(_mapper.Map <IList <EsiV1AssetsCharacterNames>, IList <V1AssetsCharacterName> >(esiAssetsNames));
        }
Exemple #23
0
        public async Task <PagedModel <V6WalletCharacterJournal> > CharacterJournalAsync(SsoToken token, int page)
        {
            StaticMethods.CheckToken(token, WalletScopes.esi_wallet_read_character_wallet_v1);

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

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

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

            IList <V6WalletCharacterJournal> mapped = _mapper.Map <IList <EsiV6WalletCharacterJournal>, IList <V6WalletCharacterJournal> >(esiModel);

            return(new PagedModel <V6WalletCharacterJournal> {
                Model = mapped, MaxPages = esiRaw.MaxPages, CurrentPage = page
            });
        }
        public IList <V1LoyaltyPoint> Points(SsoToken token)
        {
            StaticMethods.CheckToken(token, CharacterScopes.esi_characters_read_loyalty_v1);

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

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

            IList <EsiV1LoyaltyPoint> model = JsonConvert.DeserializeObject <IList <EsiV1LoyaltyPoint> >(esiRaw.Model);

            return(_mapper.Map <IList <EsiV1LoyaltyPoint>, IList <V1LoyaltyPoint> >(model));
        }
        public IList <V2FwSystems> Systems()
        {
            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.FactionWarfareV2Systems(), _testing);

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

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

            return(_mapper.Map <IList <EsiV2FwSystems>, IList <V2FwSystems> >(esiModel));
        }
        public async Task <IList <V1LoyaltyOffer> > OffersAsync(int corporationId)
        {
            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.LoyaltyV1Offers(corporationId), _testing);

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

            IList <EsiV1LoyaltyOffer> model = JsonConvert.DeserializeObject <IList <EsiV1LoyaltyOffer> >(esiRaw.Model);

            return(_mapper.Map <IList <EsiV1LoyaltyOffer>, IList <V1LoyaltyOffer> >(model));
        }
        public V1FwCharacterStats CharacterStats(SsoToken token)
        {
            StaticMethods.CheckToken(token, CharacterScopes.esi_characters_read_fw_stats_v1);

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

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

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

            return(_mapper.Map <EsiV1FwCharacterStats, V1FwCharacterStats>(esiModel));
        }
Exemple #28
0
        public async Task <IList <int> > TasksAsync()
        {
            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.OpportunitiesV1Tasks(), _testing);

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

            return(JsonConvert.DeserializeObject <IList <int> >(esiRaw.Model));
        }
        public V1FwFactionLeaderboard FactionLeaderboard()
        {
            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.FactionWarfareV1FactionLeaderboard(), _testing);

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

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

            return(_mapper.Map <EsiV1FwFactionLeaderboard, V1FwFactionLeaderboard>(esiModel));
        }
Exemple #30
0
        public V1OpportunitiesTask Task(int taskId)
        {
            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.OpportunitiesV1Task(taskId), _testing);

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

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

            return(_mapper.Map <V1OpportunitiesTask>(esiModel));
        }