-- |
-- The GitHub Enterprise orgs API as described on <https://developer.github.com/enterprise/v3/enterprise-admin/orgs/>.

module GitHub.Endpoints.Enterprise.Organizations (
    createOrganizationR,
    renameOrganizationR,
    module GitHub.Data,
    ) where

import GitHub.Data
import GitHub.Data.Enterprise
import GitHub.Internal.Prelude
import Prelude ()

-- | Create an organization.
-- See <https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#create-an-organization>
createOrganizationR :: CreateOrganization -> Request 'RW SimpleOrganization
createOrganizationR :: CreateOrganization -> Request 'RW SimpleOrganization
createOrganizationR =
    forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Post [Text
"admin", Text
"organizations"] forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. ToJSON a => a -> ByteString
encode

-- | Rename an organization.
-- See <https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#rename-an-organization>
renameOrganizationR :: Name Organization -> RenameOrganization -> Request 'RW RenameOrganizationResponse
renameOrganizationR :: Name Organization
-> RenameOrganization -> Request 'RW RenameOrganizationResponse
renameOrganizationR Name Organization
org =
    forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Patch [Text
"admin", Text
"organizations", forall a. IsPathPart a => a -> Text
toPathPart Name Organization
org] forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. ToJSON a => a -> ByteString
encode