{-# 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.Gmail.Users.Settings.UpdatePop
(
UsersSettingsUpdatePopResource
, usersSettingsUpdatePop
, UsersSettingsUpdatePop
, usupPayload
, usupUserId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersSettingsUpdatePopResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"settings" :>
"pop" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] PopSettings :>
Put '[JSON] PopSettings
data UsersSettingsUpdatePop = UsersSettingsUpdatePop'
{ _usupPayload :: !PopSettings
, _usupUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersSettingsUpdatePop
:: PopSettings
-> UsersSettingsUpdatePop
usersSettingsUpdatePop pUsupPayload_ =
UsersSettingsUpdatePop'
{ _usupPayload = pUsupPayload_
, _usupUserId = "me"
}
usupPayload :: Lens' UsersSettingsUpdatePop PopSettings
usupPayload
= lens _usupPayload (\ s a -> s{_usupPayload = a})
usupUserId :: Lens' UsersSettingsUpdatePop Text
usupUserId
= lens _usupUserId (\ s a -> s{_usupUserId = a})
instance GoogleRequest UsersSettingsUpdatePop where
type Rs UsersSettingsUpdatePop = PopSettings
type Scopes UsersSettingsUpdatePop =
'["https://www.googleapis.com/auth/gmail.settings.basic"]
requestClient UsersSettingsUpdatePop'{..}
= go _usupUserId (Just AltJSON) _usupPayload
gmailService
where go
= buildClient
(Proxy :: Proxy UsersSettingsUpdatePopResource)
mempty