|
| 1 | +----------------------------------------------------------------------------- |
| 2 | +-- | |
| 3 | +-- License : BSD-3-Clause |
| 4 | +-- Maintainer : Oleg Grenrus <[email protected]> |
| 5 | +-- |
| 6 | +-- The user emails API as described on |
| 7 | +-- <http://developer.github.com/v3/users/emails/>. |
| 8 | +module GitHub.Endpoints.Users.Emails ( |
| 9 | + currentUserEmails', |
| 10 | + currentUserEmailsR, |
| 11 | + currentUserPublicEmails', |
| 12 | + currentUserPublicEmailsR, |
| 13 | + module GitHub.Data, |
| 14 | + ) where |
| 15 | + |
| 16 | +import GitHub.Data |
| 17 | +import GitHub.Internal.Prelude |
| 18 | +import GitHub.Request |
| 19 | +import Prelude () |
| 20 | + |
| 21 | +-- | List email addresses for the authenticated user. |
| 22 | +-- |
| 23 | +-- > currentUserEmails' (OAuth "token") |
| 24 | +currentUserEmails' :: Auth -> IO (Either Error (Vector Email)) |
| 25 | +currentUserEmails' auth = |
| 26 | + executeRequest auth $ currentUserEmailsR FetchAll |
| 27 | + |
| 28 | +-- | List email addresses. |
| 29 | +-- See <https://developer.github.com/v3/users/emails/#list-email-addresses-for-a-user> |
| 30 | +currentUserEmailsR :: FetchCount -> Request 'RA (Vector Email) |
| 31 | +currentUserEmailsR = |
| 32 | + pagedQuery ["user", "emails"] [] |
| 33 | + |
| 34 | +-- | List public email addresses for the authenticated user. |
| 35 | +-- |
| 36 | +-- > currentUserPublicEmails' (OAuth "token") |
| 37 | +currentUserPublicEmails' :: Auth -> IO (Either Error (Vector Email)) |
| 38 | +currentUserPublicEmails' auth = |
| 39 | + executeRequest auth $ currentUserPublicEmailsR FetchAll |
| 40 | + |
| 41 | +-- | List public email addresses. |
| 42 | +-- See <https://developer.github.com/v3/users/emails/#list-public-email-addresses-for-a-user> |
| 43 | +currentUserPublicEmailsR :: FetchCount -> Request 'RA (Vector Email) |
| 44 | +currentUserPublicEmailsR = |
| 45 | + pagedQuery ["user", "public_emails"] [] |
0 commit comments