{-# 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.Get
(
UsersSettingsSendAsGetResource
, usersSettingsSendAsGet
, UsersSettingsSendAsGet
, ussagUserId
, ussagSendAsEmail
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersSettingsSendAsGetResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"settings" :>
"sendAs" :>
Capture "sendAsEmail" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] SendAs
data UsersSettingsSendAsGet = UsersSettingsSendAsGet'
{ _ussagUserId :: !Text
, _ussagSendAsEmail :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersSettingsSendAsGet
:: Text
-> UsersSettingsSendAsGet
usersSettingsSendAsGet pUssagSendAsEmail_ =
UsersSettingsSendAsGet'
{ _ussagUserId = "me"
, _ussagSendAsEmail = pUssagSendAsEmail_
}
ussagUserId :: Lens' UsersSettingsSendAsGet Text
ussagUserId
= lens _ussagUserId (\ s a -> s{_ussagUserId = a})
ussagSendAsEmail :: Lens' UsersSettingsSendAsGet Text
ussagSendAsEmail
= lens _ussagSendAsEmail
(\ s a -> s{_ussagSendAsEmail = a})
instance GoogleRequest UsersSettingsSendAsGet where
type Rs UsersSettingsSendAsGet = SendAs
type Scopes UsersSettingsSendAsGet =
'["https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.settings.basic"]
requestClient UsersSettingsSendAsGet'{..}
= go _ussagUserId _ussagSendAsEmail (Just AltJSON)
gmailService
where go
= buildClient
(Proxy :: Proxy UsersSettingsSendAsGetResource)
mempty