/// <summary> /// Deletes email addresses for the authenticated user. /// </summary> /// <remarks> /// http://developer.github.com/v3/users/emails/#delete-email-addresses /// </remarks> /// <param name="emailAddresses">The email addresses to delete.</param> /// <returns>Returns the added <see cref="EmailAddress"/>es.</returns> public Task Delete(params string[] emailAddresses) { Ensure.ArgumentNotNull(emailAddresses, "emailAddresses"); if (emailAddresses.Any(string.IsNullOrWhiteSpace)) { throw new ArgumentException("Cannot contain null, empty or whitespace values", "emailAddresses"); } return(ApiConnection.Delete(ApiUrls.Emails(), emailAddresses)); }
/// <summary> /// Adds email addresses for the authenticated user. /// </summary> /// <remarks> /// http://developer.github.com/v3/users/emails/#add-email-addresses /// </remarks> /// <param name="emailAddresses">The email addresses to add.</param> /// <returns>Returns the added <see cref="EmailAddress"/>es.</returns> public Task <IReadOnlyList <EmailAddress> > Add(params string[] emailAddresses) { Ensure.ArgumentNotNull(emailAddresses, "emailAddresses"); if (emailAddresses.Any(StringExt.IsNullOrWhiteSpace)) { throw new ArgumentException("Cannot contain null, empty or whitespace values", "emailAddresses"); } return(ApiConnection.Post <IReadOnlyList <EmailAddress> >(ApiUrls.Emails(), emailAddresses)); }
/// <summary> /// Gets all email addresses for the authenticated user. /// </summary> /// <remarks> /// http://developer.github.com/v3/users/emails/#list-email-addresses-for-a-user /// </remarks> /// <returns>The <see cref="EmailAddress"/>es for the authenticated user.</returns> public Task <IReadOnlyList <EmailAddress> > GetAll(ApiOptions options) { Ensure.ArgumentNotNull(options, "options"); return(ApiConnection.GetAll <EmailAddress>(ApiUrls.Emails(), options)); }
/// <summary> /// Returns emails for the current user. /// </summary> /// <returns></returns> public Task <IReadOnlyCollection <EmailAddress> > GetEmails() { return(ApiConnection.Get <IReadOnlyCollection <EmailAddress> >(ApiUrls.Emails(), null)); }
/// <summary> /// Gets all email addresses for the authenticated user. /// </summary> /// <remarks> /// http://developer.github.com/v3/users/emails/#list-email-addresses-for-a-user /// </remarks> /// <returns>The <see cref="EmailAddress"/>es for the authenticated user.</returns> public Task <IReadOnlyList <EmailAddress> > GetAll() { return(ApiConnection.GetAll <EmailAddress>(ApiUrls.Emails())); }