module GitHub.Endpoints.Organizations (
publicOrganizationsFor,
publicOrganizationsFor',
publicOrganizationsForR,
publicOrganization,
publicOrganization',
publicOrganizationR,
organizationsR,
module GitHub.Data,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import GitHub.Request
import Prelude ()
publicOrganizationsFor' :: Maybe Auth -> Name User -> IO (Either Error (Vector SimpleOrganization))
publicOrganizationsFor' auth org =
executeRequestMaybe auth $ publicOrganizationsForR org FetchAll
publicOrganizationsFor :: Name User -> IO (Either Error (Vector SimpleOrganization))
publicOrganizationsFor = publicOrganizationsFor' Nothing
organizationsR :: FetchCount -> Request k (Vector SimpleOrganization)
organizationsR = pagedQuery ["user", "orgs"] []
publicOrganizationsForR :: Name User -> FetchCount -> Request k (Vector SimpleOrganization)
publicOrganizationsForR user = pagedQuery ["users", toPathPart user, "orgs"] []
publicOrganization' :: Maybe Auth -> Name Organization -> IO (Either Error Organization)
publicOrganization' auth = executeRequestMaybe auth . publicOrganizationR
publicOrganization :: Name Organization -> IO (Either Error Organization)
publicOrganization = publicOrganization' Nothing
publicOrganizationR :: Name Organization -> Request k Organization
publicOrganizationR reqOrganizationName = query ["orgs", toPathPart reqOrganizationName] []