UserAdministrationPublicKeys() 공개 정적인 메소드

public static UserAdministrationPublicKeys ( ) : Uri
리턴 Uri
        /// <summary>
        /// Delete a public key (must be Site Admin user).
        /// </summary>
        /// <remarks>
        /// See the <a href="https://developer.github.com/enterprise/2.5/v3/users/administration/#delete-a-public-key">API documentation</a>
        /// for more information.
        /// </remarks>
        /// <param name="keyId">The key to delete</param>
        /// <returns></returns>
        public async Task DeletePublicKey(int keyId)
        {
            Ensure.ArgumentNotNull(keyId, "keyId");
            var endpoint = ApiUrls.UserAdministrationPublicKeys(keyId);

            var response = await Connection.Delete(endpoint).ConfigureAwait(false);

            if (response != HttpStatusCode.NoContent)
            {
                throw new ApiException("Invalid Status Code returned. Expected a 204", response);
            }
        }
예제 #2
0
        /// <summary>
        /// List all public keys (must be Site Admin user).
        /// </summary>
        /// <remarks>
        /// See the <a href="https://developer.github.com/enterprise/2.5/v3/users/administration/#list-all-public-keys">API documentation</a>
        /// for more information.
        /// </remarks>
        /// <returns></returns>
        public Task <IReadOnlyList <PublicKey> > ListAllPublicKeys()
        {
            var endpoint = ApiUrls.UserAdministrationPublicKeys();

            return(ApiConnection.GetAll <PublicKey>(endpoint));
        }