{-# 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.Modify
(
UsersThreadsModifyResource
, usersThreadsModify
, UsersThreadsModify
, utmPayload
, utmUserId
, utmId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersThreadsModifyResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"threads" :>
Capture "id" Text :>
"modify" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ModifyThreadRequest :>
Post '[JSON] Thread
data UsersThreadsModify = UsersThreadsModify'
{ _utmPayload :: !ModifyThreadRequest
, _utmUserId :: !Text
, _utmId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersThreadsModify
:: ModifyThreadRequest
-> Text
-> UsersThreadsModify
usersThreadsModify pUtmPayload_ pUtmId_ =
UsersThreadsModify'
{ _utmPayload = pUtmPayload_
, _utmUserId = "me"
, _utmId = pUtmId_
}
utmPayload :: Lens' UsersThreadsModify ModifyThreadRequest
utmPayload
= lens _utmPayload (\ s a -> s{_utmPayload = a})
utmUserId :: Lens' UsersThreadsModify Text
utmUserId
= lens _utmUserId (\ s a -> s{_utmUserId = a})
utmId :: Lens' UsersThreadsModify Text
utmId = lens _utmId (\ s a -> s{_utmId = a})
instance GoogleRequest UsersThreadsModify where
type Rs UsersThreadsModify = Thread
type Scopes UsersThreadsModify =
'["https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.modify"]
requestClient UsersThreadsModify'{..}
= go _utmUserId _utmId (Just AltJSON) _utmPayload
gmailService
where go
= buildClient
(Proxy :: Proxy UsersThreadsModifyResource)
mempty