{-# 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.Patch
(
UsersSettingsSendAsPatchResource
, usersSettingsSendAsPatch
, UsersSettingsSendAsPatch
, ussapPayload
, ussapUserId
, ussapSendAsEmail
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersSettingsSendAsPatchResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"settings" :>
"sendAs" :>
Capture "sendAsEmail" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SendAs :> Patch '[JSON] SendAs
-- | Updates a send-as alias. If a signature is provided, Gmail will sanitize
-- the HTML before saving it with the alias. This method supports patch
-- semantics.
--
-- /See:/ 'usersSettingsSendAsPatch' smart constructor.
data UsersSettingsSendAsPatch = UsersSettingsSendAsPatch'
{ _ussapPayload :: !SendAs
, _ussapUserId :: !Text
, _ussapSendAsEmail :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'UsersSettingsSendAsPatch' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ussapPayload'
--
-- * 'ussapUserId'
--
-- * 'ussapSendAsEmail'
usersSettingsSendAsPatch
:: SendAs -- ^ 'ussapPayload'
-> Text -- ^ 'ussapSendAsEmail'
-> UsersSettingsSendAsPatch
usersSettingsSendAsPatch pUssapPayload_ pUssapSendAsEmail_ =
UsersSettingsSendAsPatch'
{ _ussapPayload = pUssapPayload_
, _ussapUserId = "me"
, _ussapSendAsEmail = pUssapSendAsEmail_
}
-- | Multipart request metadata.
ussapPayload :: Lens' UsersSettingsSendAsPatch SendAs
ussapPayload
= lens _ussapPayload (\ s a -> s{_ussapPayload = a})
-- | User\'s email address. The special value \"me\" can be used to indicate
-- the authenticated user.
ussapUserId :: Lens' UsersSettingsSendAsPatch Text
ussapUserId
= lens _ussapUserId (\ s a -> s{_ussapUserId = a})
-- | The send-as alias to be updated.
ussapSendAsEmail :: Lens' UsersSettingsSendAsPatch Text
ussapSendAsEmail
= lens _ussapSendAsEmail
(\ s a -> s{_ussapSendAsEmail = a})
instance GoogleRequest UsersSettingsSendAsPatch where
type Rs UsersSettingsSendAsPatch = SendAs
type Scopes UsersSettingsSendAsPatch =
'["https://www.googleapis.com/auth/gmail.settings.basic",
"https://www.googleapis.com/auth/gmail.settings.sharing"]
requestClient UsersSettingsSendAsPatch'{..}
= go _ussapUserId _ussapSendAsEmail (Just AltJSON)
_ussapPayload
gmailService
where go
= buildClient
(Proxy :: Proxy UsersSettingsSendAsPatchResource)
mempty