{-# 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.Threads.Trash
(
UsersThreadsTrashResource
, usersThreadsTrash
, UsersThreadsTrash
, uttUserId
, uttId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersThreadsTrashResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"threads" :>
Capture "id" Text :>
"trash" :>
QueryParam "alt" AltJSON :> Post '[JSON] Thread
-- | Moves the specified thread to the trash.
--
-- /See:/ 'usersThreadsTrash' smart constructor.
data UsersThreadsTrash = UsersThreadsTrash'
{ _uttUserId :: !Text
, _uttId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'UsersThreadsTrash' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'uttUserId'
--
-- * 'uttId'
usersThreadsTrash
:: Text -- ^ 'uttId'
-> UsersThreadsTrash
usersThreadsTrash pUttId_ =
UsersThreadsTrash'
{ _uttUserId = "me"
, _uttId = pUttId_
}
-- | The user\'s email address. The special value me can be used to indicate
-- the authenticated user.
uttUserId :: Lens' UsersThreadsTrash Text
uttUserId
= lens _uttUserId (\ s a -> s{_uttUserId = a})
-- | The ID of the thread to Trash.
uttId :: Lens' UsersThreadsTrash Text
uttId = lens _uttId (\ s a -> s{_uttId = a})
instance GoogleRequest UsersThreadsTrash where
type Rs UsersThreadsTrash = Thread
type Scopes UsersThreadsTrash =
'["https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.modify"]
requestClient UsersThreadsTrash'{..}
= go _uttUserId _uttId (Just AltJSON) gmailService
where go
= buildClient
(Proxy :: Proxy UsersThreadsTrashResource)
mempty