{-# 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
data UsersSettingsSendAsPatch = UsersSettingsSendAsPatch'
{ _ussapPayload :: !SendAs
, _ussapUserId :: !Text
, _ussapSendAsEmail :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersSettingsSendAsPatch
:: SendAs
-> Text
-> UsersSettingsSendAsPatch
usersSettingsSendAsPatch pUssapPayload_ pUssapSendAsEmail_ =
UsersSettingsSendAsPatch'
{ _ussapPayload = pUssapPayload_
, _ussapUserId = "me"
, _ussapSendAsEmail = pUssapSendAsEmail_
}
ussapPayload :: Lens' UsersSettingsSendAsPatch SendAs
ussapPayload
= lens _ussapPayload (\ s a -> s{_ussapPayload = a})
ussapUserId :: Lens' UsersSettingsSendAsPatch Text
ussapUserId
= lens _ussapUserId (\ s a -> s{_ussapUserId = a})
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