{-# 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
data UsersPhotosUpdate = UsersPhotosUpdate'
{ _upuPayload :: !UserPhoto
, _upuUserKey :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersPhotosUpdate
:: UserPhoto
-> Text
-> UsersPhotosUpdate
usersPhotosUpdate pUpuPayload_ pUpuUserKey_ =
UsersPhotosUpdate'
{ _upuPayload = pUpuPayload_
, _upuUserKey = pUpuUserKey_
}
upuPayload :: Lens' UsersPhotosUpdate UserPhoto
upuPayload
= lens _upuPayload (\ s a -> s{_upuPayload = a})
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