{-# 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.Update
(
UsersUpdateResource
, usersUpdate
, UsersUpdate
, uPayload
, uUserKey
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type UsersUpdateResource =
"admin" :>
"directory" :>
"v1" :>
"users" :>
Capture "userKey" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] User :> Put '[JSON] User
-- | update user
--
-- /See:/ 'usersUpdate' smart constructor.
data UsersUpdate = UsersUpdate'
{ _uPayload :: !User
, _uUserKey :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'UsersUpdate' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'uPayload'
--
-- * 'uUserKey'
usersUpdate
:: User -- ^ 'uPayload'
-> Text -- ^ 'uUserKey'
-> UsersUpdate
usersUpdate pUPayload_ pUUserKey_ =
UsersUpdate'
{ _uPayload = pUPayload_
, _uUserKey = pUUserKey_
}
-- | Multipart request metadata.
uPayload :: Lens' UsersUpdate User
uPayload = lens _uPayload (\ s a -> s{_uPayload = a})
-- | Email or immutable Id of the user. If Id, it should match with id of
-- user object
uUserKey :: Lens' UsersUpdate Text
uUserKey = lens _uUserKey (\ s a -> s{_uUserKey = a})
instance GoogleRequest UsersUpdate where
type Rs UsersUpdate = User
type Scopes UsersUpdate =
'["https://www.googleapis.com/auth/admin.directory.user"]
requestClient UsersUpdate'{..}
= go _uUserKey (Just AltJSON) _uPayload
directoryService
where go
= buildClient (Proxy :: Proxy UsersUpdateResource)
mempty