{-# 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.Get
(
UsersThreadsGetResource
, usersThreadsGet
, UsersThreadsGet
, utgFormat
, utgUserId
, utgId
, utgMetadataHeaders
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersThreadsGetResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"threads" :>
Capture "id" Text :>
QueryParam "format" UsersThreadsGetFormat :>
QueryParams "metadataHeaders" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] Thread
data UsersThreadsGet = UsersThreadsGet'
{ _utgFormat :: !UsersThreadsGetFormat
, _utgUserId :: !Text
, _utgId :: !Text
, _utgMetadataHeaders :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
usersThreadsGet
:: Text
-> UsersThreadsGet
usersThreadsGet pUtgId_ =
UsersThreadsGet'
{ _utgFormat = UTGFFull
, _utgUserId = "me"
, _utgId = pUtgId_
, _utgMetadataHeaders = Nothing
}
utgFormat :: Lens' UsersThreadsGet UsersThreadsGetFormat
utgFormat
= lens _utgFormat (\ s a -> s{_utgFormat = a})
utgUserId :: Lens' UsersThreadsGet Text
utgUserId
= lens _utgUserId (\ s a -> s{_utgUserId = a})
utgId :: Lens' UsersThreadsGet Text
utgId = lens _utgId (\ s a -> s{_utgId = a})
utgMetadataHeaders :: Lens' UsersThreadsGet [Text]
utgMetadataHeaders
= lens _utgMetadataHeaders
(\ s a -> s{_utgMetadataHeaders = a})
. _Default
. _Coerce
instance GoogleRequest UsersThreadsGet where
type Rs UsersThreadsGet = Thread
type Scopes UsersThreadsGet =
'["https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.metadata",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly"]
requestClient UsersThreadsGet'{..}
= go _utgUserId _utgId (Just _utgFormat)
(_utgMetadataHeaders ^. _Default)
(Just AltJSON)
gmailService
where go
= buildClient
(Proxy :: Proxy UsersThreadsGetResource)
mempty