{-# 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.ForwardingAddresses.Get
(
UsersSettingsForwardingAddressesGetResource
, usersSettingsForwardingAddressesGet
, UsersSettingsForwardingAddressesGet
, usfagForwardingEmail
, usfagUserId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersSettingsForwardingAddressesGetResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"settings" :>
"forwardingAddresses" :>
Capture "forwardingEmail" Text :>
QueryParam "alt" AltJSON :>
Get '[JSON] ForwardingAddress
data UsersSettingsForwardingAddressesGet = UsersSettingsForwardingAddressesGet'
{ _usfagForwardingEmail :: !Text
, _usfagUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersSettingsForwardingAddressesGet
:: Text
-> UsersSettingsForwardingAddressesGet
usersSettingsForwardingAddressesGet pUsfagForwardingEmail_ =
UsersSettingsForwardingAddressesGet'
{ _usfagForwardingEmail = pUsfagForwardingEmail_
, _usfagUserId = "me"
}
usfagForwardingEmail :: Lens' UsersSettingsForwardingAddressesGet Text
usfagForwardingEmail
= lens _usfagForwardingEmail
(\ s a -> s{_usfagForwardingEmail = a})
usfagUserId :: Lens' UsersSettingsForwardingAddressesGet Text
usfagUserId
= lens _usfagUserId (\ s a -> s{_usfagUserId = a})
instance GoogleRequest
UsersSettingsForwardingAddressesGet where
type Rs UsersSettingsForwardingAddressesGet =
ForwardingAddress
type Scopes UsersSettingsForwardingAddressesGet =
'["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
UsersSettingsForwardingAddressesGet'{..}
= go _usfagUserId _usfagForwardingEmail
(Just AltJSON)
gmailService
where go
= buildClient
(Proxy ::
Proxy UsersSettingsForwardingAddressesGetResource)
mempty