UserAdministrationSiteAdmin() public static method

Creates the relative Uri for altering administration status of a user.
public static UserAdministrationSiteAdmin ( string login ) : Uri
login string The login for the intended user.
return Uri
Example #1
0
        /// <summary>
        /// Demotes a site administrator to an ordinary user (must be Site Admin user).
        /// </summary>
        /// <remarks>
        /// See the <a href="https://developer.github.com/v3/users/administration/#demote-a-site-administrator-to-an-ordinary-user">API documentation</a>
        /// for more information.
        /// </remarks>
        /// <param name="login">The user to demote from administrator.</param>
        /// <returns></returns>
        public Task Demote(string login)
        {
            Ensure.ArgumentNotNullOrEmptyString(login, "login");
            var endpoint = ApiUrls.UserAdministrationSiteAdmin(login);

            return(ApiConnection.Delete(endpoint));
        }
Example #2
0
        /// <summary>
        /// Promotes ordinary user to a site administrator (must be Site Admin user).
        /// </summary>
        /// <remarks>
        /// See the <a href="https://developer.github.com/v3/users/administration/#promote-an-ordinary-user-to-a-site-administrator">API documentation</a>
        /// for more information.
        /// </remarks>
        /// <param name="login">The user to promote to administrator.</param>
        /// <returns></returns>
        public Task Promote(string login)
        {
            Ensure.ArgumentNotNullOrEmptyString(login, nameof(login));
            var endpoint = ApiUrls.UserAdministrationSiteAdmin(login);

            return(ApiConnection.Put(endpoint));
        }