Esempio n. 1
0
        public async Task <InfoMediaRU> GetInfoMediaRU(AMSClientV3 AmsClientV3)
        {
            await GetRefreshTokenIfNeeded(AmsClientV3);

            string URL = _restEndpoint + "EncodingReservedUnitTypes";

            string token = AmsClientV3.accessTokenForRestV2 != null ? AmsClientV3.accessTokenForRestV2.AccessToken : _tokenSP;

            _client.DefaultRequestHeaders.Remove("Authorization");
            _client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token);

            string responseString = await _client.GetStringAsync(URL);

            _myanswer = MediaRUv2Answer.FromJson(responseString).Value[0];
            return(_myanswer);
        }
 public static string ToJson(this MediaRUv2Answer self)
 {
     return(JsonConvert.SerializeObject(self, AMSExplorer.Converter.Settings));
 }