{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Resource.Directory.OrgUnits.Insert
(
OrgUnitsInsertResource
, orgUnitsInsert
, OrgUnitsInsert
, ouiPayload
, ouiCustomerId
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type OrgUnitsInsertResource =
"admin" :>
"directory" :>
"v1" :>
"customer" :>
Capture "customerId" Text :>
"orgunits" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] OrgUnit :> Post '[JSON] OrgUnit
data OrgUnitsInsert = OrgUnitsInsert'
{ _ouiPayload :: !OrgUnit
, _ouiCustomerId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
orgUnitsInsert
:: OrgUnit
-> Text
-> OrgUnitsInsert
orgUnitsInsert pOuiPayload_ pOuiCustomerId_ =
OrgUnitsInsert'
{ _ouiPayload = pOuiPayload_
, _ouiCustomerId = pOuiCustomerId_
}
ouiPayload :: Lens' OrgUnitsInsert OrgUnit
ouiPayload
= lens _ouiPayload (\ s a -> s{_ouiPayload = a})
ouiCustomerId :: Lens' OrgUnitsInsert Text
ouiCustomerId
= lens _ouiCustomerId
(\ s a -> s{_ouiCustomerId = a})
instance GoogleRequest OrgUnitsInsert where
type Rs OrgUnitsInsert = OrgUnit
type Scopes OrgUnitsInsert =
'["https://www.googleapis.com/auth/admin.directory.orgunit"]
requestClient OrgUnitsInsert'{..}
= go _ouiCustomerId (Just AltJSON) _ouiPayload
directoryService
where go
= buildClient (Proxy :: Proxy OrgUnitsInsertResource)
mempty