{-# 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.Untrash
(
UsersMessagesUntrashResource
, usersMessagesUntrash
, UsersMessagesUntrash
, umuUserId
, umuId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersMessagesUntrashResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"messages" :>
Capture "id" Text :>
"untrash" :>
QueryParam "alt" AltJSON :> Post '[JSON] Message
data UsersMessagesUntrash = UsersMessagesUntrash'
{ _umuUserId :: !Text
, _umuId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersMessagesUntrash
:: Text
-> UsersMessagesUntrash
usersMessagesUntrash pUmuId_ =
UsersMessagesUntrash'
{ _umuUserId = "me"
, _umuId = pUmuId_
}
umuUserId :: Lens' UsersMessagesUntrash Text
umuUserId
= lens _umuUserId (\ s a -> s{_umuUserId = a})
umuId :: Lens' UsersMessagesUntrash Text
umuId = lens _umuId (\ s a -> s{_umuId = a})
instance GoogleRequest UsersMessagesUntrash where
type Rs UsersMessagesUntrash = Message
type Scopes UsersMessagesUntrash =
'["https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.modify"]
requestClient UsersMessagesUntrash'{..}
= go _umuUserId _umuId (Just AltJSON) gmailService
where go
= buildClient
(Proxy :: Proxy UsersMessagesUntrashResource)
mempty