{-# 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.List
(
OrgUnitsListResource
, orgUnitsList
, OrgUnitsList
, oulOrgUnitPath
, oulCustomerId
, oulType
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type OrgUnitsListResource =
"admin" :>
"directory" :>
"v1" :>
"customer" :>
Capture "customerId" Text :>
"orgunits" :>
QueryParam "orgUnitPath" Text :>
QueryParam "type" OrgUnitsListType :>
QueryParam "alt" AltJSON :> Get '[JSON] OrgUnits
data OrgUnitsList = OrgUnitsList'
{ _oulOrgUnitPath :: !Text
, _oulCustomerId :: !Text
, _oulType :: !(Maybe OrgUnitsListType)
} deriving (Eq,Show,Data,Typeable,Generic)
orgUnitsList
:: Text
-> OrgUnitsList
orgUnitsList pOulCustomerId_ =
OrgUnitsList'
{ _oulOrgUnitPath = ""
, _oulCustomerId = pOulCustomerId_
, _oulType = Nothing
}
oulOrgUnitPath :: Lens' OrgUnitsList Text
oulOrgUnitPath
= lens _oulOrgUnitPath
(\ s a -> s{_oulOrgUnitPath = a})
oulCustomerId :: Lens' OrgUnitsList Text
oulCustomerId
= lens _oulCustomerId
(\ s a -> s{_oulCustomerId = a})
oulType :: Lens' OrgUnitsList (Maybe OrgUnitsListType)
oulType = lens _oulType (\ s a -> s{_oulType = a})
instance GoogleRequest OrgUnitsList where
type Rs OrgUnitsList = OrgUnits
type Scopes OrgUnitsList =
'["https://www.googleapis.com/auth/admin.directory.orgunit",
"https://www.googleapis.com/auth/admin.directory.orgunit.readonly"]
requestClient OrgUnitsList'{..}
= go _oulCustomerId (Just _oulOrgUnitPath) _oulType
(Just AltJSON)
directoryService
where go
= buildClient (Proxy :: Proxy OrgUnitsListResource)
mempty