{-# 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.Patch
(
UsersPatchResource
, usersPatch
, UsersPatch
, upPayload
, upUserKey
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type UsersPatchResource =
"admin" :>
"directory" :>
"v1" :>
"users" :>
Capture "userKey" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] User :> Patch '[JSON] User
data UsersPatch = UsersPatch'
{ _upPayload :: !User
, _upUserKey :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersPatch
:: User
-> Text
-> UsersPatch
usersPatch pUpPayload_ pUpUserKey_ =
UsersPatch'
{ _upPayload = pUpPayload_
, _upUserKey = pUpUserKey_
}
upPayload :: Lens' UsersPatch User
upPayload
= lens _upPayload (\ s a -> s{_upPayload = a})
upUserKey :: Lens' UsersPatch Text
upUserKey
= lens _upUserKey (\ s a -> s{_upUserKey = a})
instance GoogleRequest UsersPatch where
type Rs UsersPatch = User
type Scopes UsersPatch =
'["https://www.googleapis.com/auth/admin.directory.user"]
requestClient UsersPatch'{..}
= go _upUserKey (Just AltJSON) _upPayload
directoryService
where go
= buildClient (Proxy :: Proxy UsersPatchResource)
mempty