예제 #1
0
        /// <summary> Kicks all users with an inactivity greater or equal to the provided number of days. </summary>
        /// <param name="simulate">If true, no pruning will actually be done but instead return the number of users that would be pruned. </param>
        public async Task <int> PruneUsers(int days = 30, bool simulate = false)
        {
            if (days <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(days));
            }

            var request = new PruneMembersRequest(Id)
            {
                Days         = days,
                IsSimulation = simulate
            };
            var response = await Client.ClientAPI.Send(request).ConfigureAwait(false);

            return(response.Pruned);
        }
예제 #2
0
        /// <summary> Kicks all users with an inactivity greater or equal to the provided number of days. </summary>
        /// <param name="simulate">If true, no pruning will actually be done but instead return the number of users that would be pruned. </param>
        public async Task<int> PruneUsers(int days = 30, bool simulate = false)
        {
            if (days <= 0) throw new ArgumentOutOfRangeException(nameof(days));

            var request = new PruneMembersRequest(Id)
            {
                Days = days,
                IsSimulation = simulate
            };
            var response = await Client.ClientAPI.Send(request).ConfigureAwait(false);
            return response.Pruned;
        }