{-# 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.UpdateImap
(
UsersSettingsUpdateImapResource
, usersSettingsUpdateImap
, UsersSettingsUpdateImap
, usuiPayload
, usuiUserId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersSettingsUpdateImapResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"settings" :>
"imap" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ImapSettings :>
Put '[JSON] ImapSettings
data UsersSettingsUpdateImap = UsersSettingsUpdateImap'
{ _usuiPayload :: !ImapSettings
, _usuiUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersSettingsUpdateImap
:: ImapSettings
-> UsersSettingsUpdateImap
usersSettingsUpdateImap pUsuiPayload_ =
UsersSettingsUpdateImap'
{ _usuiPayload = pUsuiPayload_
, _usuiUserId = "me"
}
usuiPayload :: Lens' UsersSettingsUpdateImap ImapSettings
usuiPayload
= lens _usuiPayload (\ s a -> s{_usuiPayload = a})
usuiUserId :: Lens' UsersSettingsUpdateImap Text
usuiUserId
= lens _usuiUserId (\ s a -> s{_usuiUserId = a})
instance GoogleRequest UsersSettingsUpdateImap where
type Rs UsersSettingsUpdateImap = ImapSettings
type Scopes UsersSettingsUpdateImap =
'["https://www.googleapis.com/auth/gmail.settings.basic"]
requestClient UsersSettingsUpdateImap'{..}
= go _usuiUserId (Just AltJSON) _usuiPayload
gmailService
where go
= buildClient
(Proxy :: Proxy UsersSettingsUpdateImapResource)
mempty