{-# 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.Trash
(
UsersMessagesTrashResource
, usersMessagesTrash
, UsersMessagesTrash
, umtUserId
, umtId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersMessagesTrashResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"messages" :>
Capture "id" Text :>
"trash" :>
QueryParam "alt" AltJSON :> Post '[JSON] Message
data UsersMessagesTrash = UsersMessagesTrash'
{ _umtUserId :: !Text
, _umtId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersMessagesTrash
:: Text
-> UsersMessagesTrash
usersMessagesTrash pUmtId_ =
UsersMessagesTrash'
{ _umtUserId = "me"
, _umtId = pUmtId_
}
umtUserId :: Lens' UsersMessagesTrash Text
umtUserId
= lens _umtUserId (\ s a -> s{_umtUserId = a})
umtId :: Lens' UsersMessagesTrash Text
umtId = lens _umtId (\ s a -> s{_umtId = a})
instance GoogleRequest UsersMessagesTrash where
type Rs UsersMessagesTrash = Message
type Scopes UsersMessagesTrash =
'["https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.modify"]
requestClient UsersMessagesTrash'{..}
= go _umtUserId _umtId (Just AltJSON) gmailService
where go
= buildClient
(Proxy :: Proxy UsersMessagesTrashResource)
mempty