{-# 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.SendAs.Update
(
UsersSettingsSendAsUpdateResource
, usersSettingsSendAsUpdate
, UsersSettingsSendAsUpdate
, ussauPayload
, ussauUserId
, ussauSendAsEmail
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersSettingsSendAsUpdateResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"settings" :>
"sendAs" :>
Capture "sendAsEmail" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SendAs :> Put '[JSON] SendAs
data UsersSettingsSendAsUpdate = UsersSettingsSendAsUpdate'
{ _ussauPayload :: !SendAs
, _ussauUserId :: !Text
, _ussauSendAsEmail :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersSettingsSendAsUpdate
:: SendAs
-> Text
-> UsersSettingsSendAsUpdate
usersSettingsSendAsUpdate pUssauPayload_ pUssauSendAsEmail_ =
UsersSettingsSendAsUpdate'
{ _ussauPayload = pUssauPayload_
, _ussauUserId = "me"
, _ussauSendAsEmail = pUssauSendAsEmail_
}
ussauPayload :: Lens' UsersSettingsSendAsUpdate SendAs
ussauPayload
= lens _ussauPayload (\ s a -> s{_ussauPayload = a})
ussauUserId :: Lens' UsersSettingsSendAsUpdate Text
ussauUserId
= lens _ussauUserId (\ s a -> s{_ussauUserId = a})
ussauSendAsEmail :: Lens' UsersSettingsSendAsUpdate Text
ussauSendAsEmail
= lens _ussauSendAsEmail
(\ s a -> s{_ussauSendAsEmail = a})
instance GoogleRequest UsersSettingsSendAsUpdate
where
type Rs UsersSettingsSendAsUpdate = SendAs
type Scopes UsersSettingsSendAsUpdate =
'["https://www.googleapis.com/auth/gmail.settings.basic",
"https://www.googleapis.com/auth/gmail.settings.sharing"]
requestClient UsersSettingsSendAsUpdate'{..}
= go _ussauUserId _ussauSendAsEmail (Just AltJSON)
_ussauPayload
gmailService
where go
= buildClient
(Proxy :: Proxy UsersSettingsSendAsUpdateResource)
mempty