{-# 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.Get
(
OrgUnitsGetResource
, orgUnitsGet
, OrgUnitsGet
, ougOrgUnitPath
, ougCustomerId
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type OrgUnitsGetResource =
"admin" :>
"directory" :>
"v1" :>
"customer" :>
Capture "customerId" Text :>
"orgunits" :>
Captures "orgUnitPath" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] OrgUnit
data OrgUnitsGet = OrgUnitsGet'
{ _ougOrgUnitPath :: ![Text]
, _ougCustomerId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
orgUnitsGet
:: [Text]
-> Text
-> OrgUnitsGet
orgUnitsGet pOugOrgUnitPath_ pOugCustomerId_ =
OrgUnitsGet'
{ _ougOrgUnitPath = _Coerce # pOugOrgUnitPath_
, _ougCustomerId = pOugCustomerId_
}
ougOrgUnitPath :: Lens' OrgUnitsGet [Text]
ougOrgUnitPath
= lens _ougOrgUnitPath
(\ s a -> s{_ougOrgUnitPath = a})
. _Coerce
ougCustomerId :: Lens' OrgUnitsGet Text
ougCustomerId
= lens _ougCustomerId
(\ s a -> s{_ougCustomerId = a})
instance GoogleRequest OrgUnitsGet where
type Rs OrgUnitsGet = OrgUnit
type Scopes OrgUnitsGet =
'["https://www.googleapis.com/auth/admin.directory.orgunit",
"https://www.googleapis.com/auth/admin.directory.orgunit.readonly"]
requestClient OrgUnitsGet'{..}
= go _ougCustomerId _ougOrgUnitPath (Just AltJSON)
directoryService
where go
= buildClient (Proxy :: Proxy OrgUnitsGetResource)
mempty