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