示例#1
0
        public async Task CharacterDeleteAsync(SsoToken token, int fittingId)
        {
            StaticMethods.CheckToken(token, FittingScopes.esi_fittings_write_fittings_v1);

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

            await PollyPolicies.WebExceptionRetryWithFallbackAsync.ExecuteAsync(async() => await _webClient.DeleteAsync(StaticMethods.CreateHeaders(token), url, string.Empty));
        }
        public void OpenMarketWindow(SsoToken token, int typeId)
        {
            StaticMethods.CheckToken(token, UiScopes.esi_ui_open_window_v1);

            string url = StaticConnectionStrings.UiV1OpenMarketDataWindow(typeId);

            PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Post(StaticMethods.CreateHeaders(token), url, string.Empty));
        }
        public async Task AddSolarSystemIntoAutopilotWaypointAsync(SsoToken token, bool addToBeginning, bool clearOtherWaypoints, int destinationId)
        {
            StaticMethods.CheckToken(token, UiScopes.esi_ui_write_waypoint_v1);

            string url = StaticConnectionStrings.UiV2AddWaypoint(addToBeginning, clearOtherWaypoints, destinationId);

            await PollyPolicies.WebExceptionRetryWithFallbackAsync.ExecuteAsync(async() => await _webClient.PostAsync(StaticMethods.CreateHeaders(token), url, string.Empty));
        }
        public async Task OpenMarketWindowAsync(SsoToken token, int typeId)
        {
            StaticMethods.CheckToken(token, UiScopes.esi_ui_open_window_v1);

            string url = StaticConnectionStrings.UiV1OpenMarketDataWindow(typeId);

            await PollyPolicies.WebExceptionRetryWithFallbackAsync.ExecuteAsync(async() => await _webClient.PostAsync(StaticMethods.CreateHeaders(token), url, string.Empty));
        }
示例#5
0
        public void DeleteSquad(SsoToken token, long fleetId, int squadId)
        {
            StaticMethods.CheckToken(token, FleetScopes.esi_fleets_write_fleet_v1);

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

            PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Delete(StaticMethods.CreateHeaders(token), url, string.Empty));
        }
示例#6
0
        public async Task CreateSquadAsync(SsoToken token, long fleetId, int wingId)
        {
            StaticMethods.CheckToken(token, FleetScopes.esi_fleets_write_fleet_v1);

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

            await PollyPolicies.WebExceptionRetryWithFallbackAsync.ExecuteAsync(async() => await _webClient.PostAsync(StaticMethods.CreateHeaders(token), url, string.Empty));
        }
示例#7
0
        public async Task DeleteAsync(SsoToken token, int mailId)
        {
            StaticMethods.CheckToken(token, MailScopes.esi_mail_organize_mail_v1);

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

            await PollyPolicies.WebExceptionRetryWithFallbackAsync.ExecuteAsync(async() => await _webClient.DeleteAsync(StaticMethods.CreateHeaders(token), url, string.Empty));
        }
示例#8
0
        public void DeleteLabel(SsoToken token, int labelId)
        {
            StaticMethods.CheckToken(token, MailScopes.esi_mail_organize_mail_v1);

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

            PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Delete(StaticMethods.CreateHeaders(token), url, string.Empty));
        }
示例#9
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));
        }
        public async Task CharacterDeleteAsync(SsoToken token, IList <int> contactIds)
        {
            StaticMethods.CheckToken(token, CharacterScopes.esi_characters_write_contacts_v1);

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

            string jsonObject = JsonConvert.SerializeObject(contactIds);

            await PollyPolicies.WebExceptionRetryWithFallbackAsync.ExecuteAsync(async() => await _webClient.DeleteAsync(StaticMethods.CreateHeaders(token), url, jsonObject));
        }
        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));
        }
示例#12
0
        public async Task SendAsync(SsoToken token, V1MailSend mail)
        {
            StaticMethods.CheckToken(token, MailScopes.esi_mail_send_mail_v1);

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

            EsiV1MailSend model = _mapper.Map <EsiV1MailSend>(mail);

            await PollyPolicies.WebExceptionRetryWithFallbackAsync.ExecuteAsync(async() => await _webClient.PostAsync(StaticMethods.CreateHeaders(token), url, JsonConvert.SerializeObject(model)));
        }
示例#13
0
        public void CreateLabel(SsoToken token, V2MailCreateLabel labelModel)
        {
            StaticMethods.CheckToken(token, MailScopes.esi_mail_organize_mail_v1);

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

            EsiV2MailCreateLabel model = _mapper.Map <EsiV2MailCreateLabel>(labelModel);

            PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Post(StaticMethods.CreateHeaders(token), url, JsonConvert.SerializeObject(model)));
        }
示例#14
0
        public async Task MetadataAsync(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);

            await PollyPolicies.WebExceptionRetryWithFallbackAsync.ExecuteAsync(async() => await _webClient.PutAsync(StaticMethods.CreateHeaders(token), url, JsonConvert.SerializeObject(model)));
        }
        public async Task <int> MembersLimitAsync(SsoToken token, long corporationId)
        {
            StaticMethods.CheckToken(token, CorporationScopes.esi_corporations_track_members_v1);

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

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

            return(JsonConvert.DeserializeObject <int>(esiRaw.Model));
        }
        public IList <int> Members(SsoToken token, long corporationId)
        {
            StaticMethods.CheckToken(token, CorporationScopes.esi_corporations_read_corporation_membership_v1);

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

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

            return(JsonConvert.DeserializeObject <IList <int> >(esiRaw.Model));
        }
        public async Task <IList <int> > ActiveImplantsAsync(SsoToken token)
        {
            StaticMethods.CheckToken(token, CloneScopes.esi_clones_read_implants_v1);

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

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

            return(JsonConvert.DeserializeObject <IList <int> >(esiRaw.Model));
        }
        public void OpenNewMailWindow(SsoToken token, V1UiSendMail sendMail)
        {
            StaticMethods.CheckToken(token, UiScopes.esi_ui_open_window_v1);

            string url = StaticConnectionStrings.UiV1OpenNewMailWindow();

            EsiV1UiSendMail newMail = _mapper.Map <EsiV1UiSendMail>(sendMail);

            PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Post(StaticMethods.CreateHeaders(token), url, JsonConvert.SerializeObject(newMail)));
        }
示例#19
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));
        }
        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 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));
        }
示例#22
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));
        }
示例#23
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));
        }
示例#24
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));
        }
        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));
        }
示例#26
0
        public void Move(SsoToken token, long fleetId, int characterId, V1FleetMemberMove moveModel)
        {
            StaticMethods.CheckToken(token, FleetScopes.esi_fleets_write_fleet_v1);

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

            EsiV1FleetMemberMove model = _mapper.Map <EsiV1FleetMemberMove>(moveModel);

            string objectModel = JsonConvert.SerializeObject(model);

            PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Put(StaticMethods.CreateHeaders(token), url, objectModel));
        }
示例#27
0
        public IList <V1FleetWing> Wings(SsoToken token, long fleetId)
        {
            StaticMethods.CheckToken(token, FleetScopes.esi_fleets_read_fleet_v1);

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

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

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

            return(_mapper.Map <IList <EsiV1FleetWing>, IList <V1FleetWing> >(model));
        }
示例#28
0
        public V1FleetCharacter Character(SsoToken token)
        {
            StaticMethods.CheckToken(token, FleetScopes.esi_fleets_read_fleet_v1);

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

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

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

            return(_mapper.Map <EsiV1FleetCharacter, V1FleetCharacter>(model));
        }
示例#29
0
        public async Task FleetUpdateAsync(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);

            await PollyPolicies.WebExceptionRetryWithFallbackAsync.ExecuteAsync(async() => await _webClient.PutAsync(StaticMethods.CreateHeaders(token), url, objectModel));
        }
示例#30
0
        public async Task <V1Fleet> FleetAsync(SsoToken token, long fleetId)
        {
            StaticMethods.CheckToken(token, FleetScopes.esi_fleets_read_fleet_v1);

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

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

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

            return(_mapper.Map <EsiV1Fleet, V1Fleet>(model));
        }