GetMetadataUrl() private méthode

private GetMetadataUrl ( ) : Task
Résultat Task
Exemple #1
0
        /// <summary>
        /// Requests for node information by its Id
        /// </summary>
        /// <param name="id">Node id</param>
        /// <returns>Node info or null</returns>
        public async Task <AmazonNode> GetNode(string id)
        {
            var url    = "{0}nodes/{1}";
            var result = await http.GetJsonAsync <AmazonNode>(string.Format(url, await amazon.GetMetadataUrl().ConfigureAwait(false), id)).ConfigureAwait(false);

            return(result);
        }
        /// <summary>
        /// Request for drive quota info.
        /// </summary>
        /// <returns></returns>
        public async Task <Quota> GetQuota()
        {
            if (_quota == null || DateTime.UtcNow - _quota.lastCalculated > generalExpiration)
            {
                var metadataUrl = await amazon.GetMetadataUrl().ConfigureAwait(false);

                _quota = await http.GetJsonAsync <Quota>(string.Format("{0}account/quota", metadataUrl)).ConfigureAwait(false);
            }
            return(_quota);
        }