Emails() public static method

Returns the Uri that returns all of the email addresses for the currently logged in user.
public static Emails ( ) : Uri
return System.Uri
Esempio n. 1
0
        /// <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));
        }
Esempio n. 3
0
        /// <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));
        }
Esempio n. 4
0
 /// <summary>
 /// Returns emails for the current user.
 /// </summary>
 /// <returns></returns>
 public Task <IReadOnlyCollection <EmailAddress> > GetEmails()
 {
     return(ApiConnection.Get <IReadOnlyCollection <EmailAddress> >(ApiUrls.Emails(), null));
 }
Esempio n. 5
0
 /// <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()));
 }