{-# 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.Modify
(
UsersMessagesModifyResource
, usersMessagesModify
, UsersMessagesModify
, ummPayload
, ummUserId
, ummId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersMessagesModifyResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"messages" :>
Capture "id" Text :>
"modify" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ModifyMessageRequest :>
Post '[JSON] Message
data UsersMessagesModify = UsersMessagesModify'
{ _ummPayload :: !ModifyMessageRequest
, _ummUserId :: !Text
, _ummId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersMessagesModify
:: ModifyMessageRequest
-> Text
-> UsersMessagesModify
usersMessagesModify pUmmPayload_ pUmmId_ =
UsersMessagesModify'
{ _ummPayload = pUmmPayload_
, _ummUserId = "me"
, _ummId = pUmmId_
}
ummPayload :: Lens' UsersMessagesModify ModifyMessageRequest
ummPayload
= lens _ummPayload (\ s a -> s{_ummPayload = a})
ummUserId :: Lens' UsersMessagesModify Text
ummUserId
= lens _ummUserId (\ s a -> s{_ummUserId = a})
ummId :: Lens' UsersMessagesModify Text
ummId = lens _ummId (\ s a -> s{_ummId = a})
instance GoogleRequest UsersMessagesModify where
type Rs UsersMessagesModify = Message
type Scopes UsersMessagesModify =
'["https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.modify"]
requestClient UsersMessagesModify'{..}
= go _ummUserId _ummId (Just AltJSON) _ummPayload
gmailService
where go
= buildClient
(Proxy :: Proxy UsersMessagesModifyResource)
mempty