{-# 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.Photos.Update
(
UsersPhotosUpdateResource
, usersPhotosUpdate
, UsersPhotosUpdate
, upuPayload
, upuUserKey
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type UsersPhotosUpdateResource =
"admin" :>
"directory" :>
"v1" :>
"users" :>
Capture "userKey" Text :>
"photos" :>
"thumbnail" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] UserPhoto :> Put '[JSON] UserPhoto
-- | Add a photo for the user
--
-- /See:/ 'usersPhotosUpdate' smart constructor.
data UsersPhotosUpdate = UsersPhotosUpdate'
{ _upuPayload :: !UserPhoto
, _upuUserKey :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'UsersPhotosUpdate' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'upuPayload'
--
-- * 'upuUserKey'
usersPhotosUpdate
:: UserPhoto -- ^ 'upuPayload'
-> Text -- ^ 'upuUserKey'
-> UsersPhotosUpdate
usersPhotosUpdate pUpuPayload_ pUpuUserKey_ =
UsersPhotosUpdate'
{ _upuPayload = pUpuPayload_
, _upuUserKey = pUpuUserKey_
}
-- | Multipart request metadata.
upuPayload :: Lens' UsersPhotosUpdate UserPhoto
upuPayload
= lens _upuPayload (\ s a -> s{_upuPayload = a})
-- | Email or immutable Id of the user
upuUserKey :: Lens' UsersPhotosUpdate Text
upuUserKey
= lens _upuUserKey (\ s a -> s{_upuUserKey = a})
instance GoogleRequest UsersPhotosUpdate where
type Rs UsersPhotosUpdate = UserPhoto
type Scopes UsersPhotosUpdate =
'["https://www.googleapis.com/auth/admin.directory.user"]
requestClient UsersPhotosUpdate'{..}
= go _upuUserKey (Just AltJSON) _upuPayload
directoryService
where go
= buildClient
(Proxy :: Proxy UsersPhotosUpdateResource)
mempty