{-# 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.Update
(
OrgUnitsUpdateResource
, orgUnitsUpdate
, OrgUnitsUpdate
, ouuPayload
, ouuOrgUnitPath
, ouuCustomerId
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type OrgUnitsUpdateResource =
"admin" :>
"directory" :>
"v1" :>
"customer" :>
Capture "customerId" Text :>
"orgunits" :>
Captures "orgUnitPath" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] OrgUnit :> Put '[JSON] OrgUnit
data OrgUnitsUpdate = OrgUnitsUpdate'
{ _ouuPayload :: !OrgUnit
, _ouuOrgUnitPath :: ![Text]
, _ouuCustomerId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
orgUnitsUpdate
:: OrgUnit
-> [Text]
-> Text
-> OrgUnitsUpdate
orgUnitsUpdate pOuuPayload_ pOuuOrgUnitPath_ pOuuCustomerId_ =
OrgUnitsUpdate'
{ _ouuPayload = pOuuPayload_
, _ouuOrgUnitPath = _Coerce # pOuuOrgUnitPath_
, _ouuCustomerId = pOuuCustomerId_
}
ouuPayload :: Lens' OrgUnitsUpdate OrgUnit
ouuPayload
= lens _ouuPayload (\ s a -> s{_ouuPayload = a})
ouuOrgUnitPath :: Lens' OrgUnitsUpdate [Text]
ouuOrgUnitPath
= lens _ouuOrgUnitPath
(\ s a -> s{_ouuOrgUnitPath = a})
. _Coerce
ouuCustomerId :: Lens' OrgUnitsUpdate Text
ouuCustomerId
= lens _ouuCustomerId
(\ s a -> s{_ouuCustomerId = a})
instance GoogleRequest OrgUnitsUpdate where
type Rs OrgUnitsUpdate = OrgUnit
type Scopes OrgUnitsUpdate =
'["https://www.googleapis.com/auth/admin.directory.orgunit"]
requestClient OrgUnitsUpdate'{..}
= go _ouuCustomerId _ouuOrgUnitPath (Just AltJSON)
_ouuPayload
directoryService
where go
= buildClient (Proxy :: Proxy OrgUnitsUpdateResource)
mempty