module Github.Organizations (
publicOrganizationsFor,
publicOrganizationsFor',
publicOrganizationsForR,
publicOrganization,
publicOrganization',
publicOrganizationR,
module Github.Data,
) where
import Data.Vector (Vector)
import Github.Auth
import Github.Data
import Github.Request
publicOrganizationsFor' :: Maybe GithubAuth -> Name GithubOwner -> IO (Either Error (Vector SimpleOrganization))
publicOrganizationsFor' auth org =
executeRequestMaybe auth $ publicOrganizationsForR org Nothing
publicOrganizationsFor :: Name GithubOwner -> IO (Either Error (Vector SimpleOrganization))
publicOrganizationsFor = publicOrganizationsFor' Nothing
publicOrganizationsForR :: Name GithubOwner -> Maybe Count -> GithubRequest k (Vector SimpleOrganization)
publicOrganizationsForR userName = GithubPagedGet ["users", toPathPart userName, "orgs"] []
publicOrganization' :: Maybe GithubAuth -> Name Organization -> IO (Either Error Organization)
publicOrganization' auth = executeRequestMaybe auth . publicOrganizationR
publicOrganization :: Name Organization -> IO (Either Error Organization)
publicOrganization = publicOrganization' Nothing
publicOrganizationR :: Name Organization -> GithubRequest k Organization
publicOrganizationR reqOrganizationName = GithubGet ["orgs", toPathPart reqOrganizationName] []