{-# 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.BatchDelete
(
UsersMessagesBatchDeleteResource
, usersMessagesBatchDelete
, UsersMessagesBatchDelete
, umbdPayload
, umbdUserId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersMessagesBatchDeleteResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"messages" :>
"batchDelete" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] BatchDeleteMessagesRequest :>
Post '[JSON] ()
data UsersMessagesBatchDelete = UsersMessagesBatchDelete'
{ _umbdPayload :: !BatchDeleteMessagesRequest
, _umbdUserId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersMessagesBatchDelete
:: BatchDeleteMessagesRequest
-> UsersMessagesBatchDelete
usersMessagesBatchDelete pUmbdPayload_ =
UsersMessagesBatchDelete'
{ _umbdPayload = pUmbdPayload_
, _umbdUserId = "me"
}
umbdPayload :: Lens' UsersMessagesBatchDelete BatchDeleteMessagesRequest
umbdPayload
= lens _umbdPayload (\ s a -> s{_umbdPayload = a})
umbdUserId :: Lens' UsersMessagesBatchDelete Text
umbdUserId
= lens _umbdUserId (\ s a -> s{_umbdUserId = a})
instance GoogleRequest UsersMessagesBatchDelete where
type Rs UsersMessagesBatchDelete = ()
type Scopes UsersMessagesBatchDelete =
'["https://mail.google.com/"]
requestClient UsersMessagesBatchDelete'{..}
= go _umbdUserId (Just AltJSON) _umbdPayload
gmailService
where go
= buildClient
(Proxy :: Proxy UsersMessagesBatchDeleteResource)
mempty