{-# 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.Delegates.Get
(
UsersSettingsDelegatesGetResource
, usersSettingsDelegatesGet
, UsersSettingsDelegatesGet
, usdgUserId
, usdgDelegateEmail
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersSettingsDelegatesGetResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"settings" :>
"delegates" :>
Capture "delegateEmail" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] Delegate
data UsersSettingsDelegatesGet = UsersSettingsDelegatesGet'
{ _usdgUserId :: !Text
, _usdgDelegateEmail :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersSettingsDelegatesGet
:: Text
-> UsersSettingsDelegatesGet
usersSettingsDelegatesGet pUsdgDelegateEmail_ =
UsersSettingsDelegatesGet'
{ _usdgUserId = "me"
, _usdgDelegateEmail = pUsdgDelegateEmail_
}
usdgUserId :: Lens' UsersSettingsDelegatesGet Text
usdgUserId
= lens _usdgUserId (\ s a -> s{_usdgUserId = a})
usdgDelegateEmail :: Lens' UsersSettingsDelegatesGet Text
usdgDelegateEmail
= lens _usdgDelegateEmail
(\ s a -> s{_usdgDelegateEmail = a})
instance GoogleRequest UsersSettingsDelegatesGet
where
type Rs UsersSettingsDelegatesGet = Delegate
type Scopes UsersSettingsDelegatesGet =
'["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 UsersSettingsDelegatesGet'{..}
= go _usdgUserId _usdgDelegateEmail (Just AltJSON)
gmailService
where go
= buildClient
(Proxy :: Proxy UsersSettingsDelegatesGetResource)
mempty