{-# 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.Users.MakeAdmin
(
UsersMakeAdminResource
, usersMakeAdmin
, UsersMakeAdmin
, umaPayload
, umaUserKey
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type UsersMakeAdminResource =
"admin" :>
"directory" :>
"v1" :>
"users" :>
Capture "userKey" Text :>
"makeAdmin" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] UserMakeAdmin :> Post '[JSON] ()
data UsersMakeAdmin = UsersMakeAdmin'
{ _umaPayload :: !UserMakeAdmin
, _umaUserKey :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersMakeAdmin
:: UserMakeAdmin
-> Text
-> UsersMakeAdmin
usersMakeAdmin pUmaPayload_ pUmaUserKey_ =
UsersMakeAdmin'
{ _umaPayload = pUmaPayload_
, _umaUserKey = pUmaUserKey_
}
umaPayload :: Lens' UsersMakeAdmin UserMakeAdmin
umaPayload
= lens _umaPayload (\ s a -> s{_umaPayload = a})
umaUserKey :: Lens' UsersMakeAdmin Text
umaUserKey
= lens _umaUserKey (\ s a -> s{_umaUserKey = a})
instance GoogleRequest UsersMakeAdmin where
type Rs UsersMakeAdmin = ()
type Scopes UsersMakeAdmin =
'["https://www.googleapis.com/auth/admin.directory.user"]
requestClient UsersMakeAdmin'{..}
= go _umaUserKey (Just AltJSON) _umaPayload
directoryService
where go
= buildClient (Proxy :: Proxy UsersMakeAdminResource)
mempty