{-# 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.UpdateAutoForwarding
(
UsersSettingsUpdateAutoForwardingResource
, usersSettingsUpdateAutoForwarding
, UsersSettingsUpdateAutoForwarding
, usuafPayload
, usuafUserId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersSettingsUpdateAutoForwardingResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"settings" :>
"autoForwarding" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] AutoForwarding :>
Put '[JSON] AutoForwarding
data UsersSettingsUpdateAutoForwarding = UsersSettingsUpdateAutoForwarding'
{ _usuafPayload :: !AutoForwarding
, _usuafUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersSettingsUpdateAutoForwarding
:: AutoForwarding
-> UsersSettingsUpdateAutoForwarding
usersSettingsUpdateAutoForwarding pUsuafPayload_ =
UsersSettingsUpdateAutoForwarding'
{ _usuafPayload = pUsuafPayload_
, _usuafUserId = "me"
}
usuafPayload :: Lens' UsersSettingsUpdateAutoForwarding AutoForwarding
usuafPayload
= lens _usuafPayload (\ s a -> s{_usuafPayload = a})
usuafUserId :: Lens' UsersSettingsUpdateAutoForwarding Text
usuafUserId
= lens _usuafUserId (\ s a -> s{_usuafUserId = a})
instance GoogleRequest
UsersSettingsUpdateAutoForwarding where
type Rs UsersSettingsUpdateAutoForwarding =
AutoForwarding
type Scopes UsersSettingsUpdateAutoForwarding =
'["https://www.googleapis.com/auth/gmail.settings.sharing"]
requestClient UsersSettingsUpdateAutoForwarding'{..}
= go _usuafUserId (Just AltJSON) _usuafPayload
gmailService
where go
= buildClient
(Proxy ::
Proxy UsersSettingsUpdateAutoForwardingResource)
mempty