{-# 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.Messages.BatchModify
(
UsersMessagesBatchModifyResource
, usersMessagesBatchModify
, UsersMessagesBatchModify
, umbmPayload
, umbmUserId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersMessagesBatchModifyResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"messages" :>
"batchModify" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] BatchModifyMessagesRequest :>
Post '[JSON] ()
data UsersMessagesBatchModify = UsersMessagesBatchModify'
{ _umbmPayload :: !BatchModifyMessagesRequest
, _umbmUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersMessagesBatchModify
:: BatchModifyMessagesRequest
-> UsersMessagesBatchModify
usersMessagesBatchModify pUmbmPayload_ =
UsersMessagesBatchModify'
{ _umbmPayload = pUmbmPayload_
, _umbmUserId = "me"
}
umbmPayload :: Lens' UsersMessagesBatchModify BatchModifyMessagesRequest
umbmPayload
= lens _umbmPayload (\ s a -> s{_umbmPayload = a})
umbmUserId :: Lens' UsersMessagesBatchModify Text
umbmUserId
= lens _umbmUserId (\ s a -> s{_umbmUserId = a})
instance GoogleRequest UsersMessagesBatchModify where
type Rs UsersMessagesBatchModify = ()
type Scopes UsersMessagesBatchModify =
'["https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.modify"]
requestClient UsersMessagesBatchModify'{..}
= go _umbmUserId (Just AltJSON) _umbmPayload
gmailService
where go
= buildClient
(Proxy :: Proxy UsersMessagesBatchModifyResource)
mempty