Пример #1
0
 internal static string GetTimePeriod(this NexusTimePeriod timePeriod)
 {
     return(timePeriod switch
     {
         NexusTimePeriod.Day => "1d",
         NexusTimePeriod.Week => "1w",
         _ => "1m"
     });
Пример #2
0
        /// <summary>
        /// Returns an <see cref="IEnumerable{T}"/> of mods that have been updated in a given period, with timestamps of their last update.
        /// </summary>
        /// <param name="gameDomain">The game domain name</param>
        /// <param name="period">The time period!</param>
        /// <param name="cancellationToken">Enables cancellation of the HTTP request</param>
        /// <returns></returns>
        public Task <IEnumerable <NexusModUpdate> > GetUpdatedMods(string gameDomain, NexusTimePeriod period, CancellationToken cancellationToken = default)
        {
            var requestUri = ConstructRequestUri(Routes.Mods.Updated, gameDomain).AddQuery("period", period.GetTimePeriod());

            return(Client.ProcessRequestAsync <IEnumerable <NexusModUpdate> >(requestUri, HttpMethod.Get, cancellationToken));
        }