コード例 #1
0
        public async Task <IList <V1ContactCharacterLabel> > CharacterLabelsAsync(SsoToken token)
        {
            StaticMethods.CheckToken(token, CharacterScopes.esi_characters_read_contacts_v1);

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

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

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

            return(_mapper.Map <IList <EsiV1ContactCharacterLabel>, IList <V1ContactCharacterLabel> >(esiModel));
        }