{-# 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
-- | Update Organization Unit
--
-- /See:/ 'orgUnitsUpdate' smart constructor.
data OrgUnitsUpdate = OrgUnitsUpdate'
{ _ouuPayload :: !OrgUnit
, _ouuOrgUnitPath :: ![Text]
, _ouuCustomerId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'OrgUnitsUpdate' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ouuPayload'
--
-- * 'ouuOrgUnitPath'
--
-- * 'ouuCustomerId'
orgUnitsUpdate
:: OrgUnit -- ^ 'ouuPayload'
-> [Text] -- ^ 'ouuOrgUnitPath'
-> Text -- ^ 'ouuCustomerId'
-> OrgUnitsUpdate
orgUnitsUpdate pOuuPayload_ pOuuOrgUnitPath_ pOuuCustomerId_ =
OrgUnitsUpdate'
{ _ouuPayload = pOuuPayload_
, _ouuOrgUnitPath = _Coerce # pOuuOrgUnitPath_
, _ouuCustomerId = pOuuCustomerId_
}
-- | Multipart request metadata.
ouuPayload :: Lens' OrgUnitsUpdate OrgUnit
ouuPayload
= lens _ouuPayload (\ s a -> s{_ouuPayload = a})
-- | Full path of the organization unit or its Id
ouuOrgUnitPath :: Lens' OrgUnitsUpdate [Text]
ouuOrgUnitPath
= lens _ouuOrgUnitPath
(\ s a -> s{_ouuOrgUnitPath = a})
. _Coerce
-- | Immutable id of the Google Apps account
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