Keys() public static method

Returns the Uri to retrieve keys for the current user.
public static Keys ( ) : Uri
return System.Uri
示例#1
0
        /// <summary>
        /// Gets all verified public keys for a user.
        /// </summary>
        /// <remarks>
        /// https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user
        /// </remarks>
        /// <param name="userName">The @ handle of the user.</param>
        /// <param name="options">Options to change API's behavior.</param>
        /// <returns>Lists the verified public keys for a user.</returns>
        public Task <IReadOnlyList <PublicKey> > GetAll(string userName, ApiOptions options)
        {
            Ensure.ArgumentNotNullOrEmptyString(userName, "userName");
            Ensure.ArgumentNotNull(options, "options");

            return(ApiConnection.GetAll <PublicKey>(ApiUrls.Keys(userName), options));
        }
示例#2
0
        /// <summary>
        /// Create a public key <see cref="NewPublicKey"/>.
        /// </summary>
        /// <remarks>
        /// https://developer.github.com/v3/users/keys/#create-a-public-key
        /// </remarks>
        /// <param name="newKey">The SSH Key contents</param>
        /// <returns></returns>
        public Task <PublicKey> Create(NewPublicKey newKey)
        {
            Ensure.ArgumentNotNull(newKey, "newKey");

            return(ApiConnection.Post <PublicKey>(ApiUrls.Keys(), newKey));
        }
示例#3
0
 /// <summary>
 /// Retrieves the <see cref="PublicKey"/> for the specified id.
 /// </summary>
 /// <remarks>
 /// https://developer.github.com/v3/users/keys/#get-a-single-public-key
 /// </remarks>
 /// <param name="id">The Id of the SSH key</param>
 /// <returns></returns>
 public Task <PublicKey> Get(int id)
 {
     return(ApiConnection.Get <PublicKey>(ApiUrls.Keys(id)));
 }
示例#4
0
        /// <summary>
        /// Gets all public keys for the authenticated user.
        /// </summary>
        /// <remarks>
        /// https://developer.github.com/v3/users/keys/#list-your-public-keys
        /// </remarks>
        /// <param name="options">Options to chagne API's behavior.</param>
        /// <returns>Lists the current user's keys.</returns>
        public Task <IReadOnlyList <PublicKey> > GetAllForCurrent(ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, "options");

            return(ApiConnection.GetAll <PublicKey>(ApiUrls.Keys(), options));
        }
示例#5
0
 /// <summary>
 /// Delete a public key.
 /// </summary>
 /// <remarks>
 /// https://developer.github.com/v3/users/keys/#delete-a-public-key
 /// </remarks>
 /// <param name="id">The id of the key to delete</param>
 /// <returns></returns>
 public Task Delete(int id)
 {
     return(ApiConnection.Delete(ApiUrls.Keys(id)));
 }
示例#6
0
        public Task <SshKey> Update(int id, SshKeyUpdate key)
        {
            Ensure.ArgumentNotNull(key, "key");

            return(ApiConnection.Patch <SshKey>(ApiUrls.Keys(id), key));
        }
 /// <summary>
 /// Gets all public keys for the authenticated user.
 /// </summary>
 /// <remarks>
 /// https://developer.github.com/v3/users/keys/#list-your-public-keys
 /// </remarks>
 /// <returns></returns>
 public Task <IReadOnlyList <PublicKey> > GetAllForCurrent()
 {
     return(ApiConnection.GetAll <PublicKey>(ApiUrls.Keys()));
 }
示例#8
0
 /// <summary>
 /// Gets all verified public keys for a user.
 /// </summary>
 /// <remarks>
 /// https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user
 /// </remarks>
 /// <returns>The <see cref="PublicKey"/>s for the user.</returns>
 public Task <IReadOnlyList <PublicKey> > GetAll(string userName)
 {
     return(ApiConnection.GetAll <PublicKey>(ApiUrls.Keys(userName)));
 }