{-# 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.Attachments.Get
(
UsersMessagesAttachmentsGetResource
, usersMessagesAttachmentsGet
, UsersMessagesAttachmentsGet
, umagUserId
, umagId
, umagMessageId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersMessagesAttachmentsGetResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"messages" :>
Capture "messageId" Text :>
"attachments" :>
Capture "id" Text :>
QueryParam "alt" AltJSON :>
Get '[JSON] MessagePartBody
data UsersMessagesAttachmentsGet = UsersMessagesAttachmentsGet'
{ _umagUserId :: !Text
, _umagId :: !Text
, _umagMessageId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersMessagesAttachmentsGet
:: Text
-> Text
-> UsersMessagesAttachmentsGet
usersMessagesAttachmentsGet pUmagId_ pUmagMessageId_ =
UsersMessagesAttachmentsGet'
{ _umagUserId = "me"
, _umagId = pUmagId_
, _umagMessageId = pUmagMessageId_
}
umagUserId :: Lens' UsersMessagesAttachmentsGet Text
umagUserId
= lens _umagUserId (\ s a -> s{_umagUserId = a})
umagId :: Lens' UsersMessagesAttachmentsGet Text
umagId = lens _umagId (\ s a -> s{_umagId = a})
umagMessageId :: Lens' UsersMessagesAttachmentsGet Text
umagMessageId
= lens _umagMessageId
(\ s a -> s{_umagMessageId = a})
instance GoogleRequest UsersMessagesAttachmentsGet
where
type Rs UsersMessagesAttachmentsGet = MessagePartBody
type Scopes UsersMessagesAttachmentsGet =
'["https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly"]
requestClient UsersMessagesAttachmentsGet'{..}
= go _umagUserId _umagMessageId _umagId
(Just AltJSON)
gmailService
where go
= buildClient
(Proxy :: Proxy UsersMessagesAttachmentsGetResource)
mempty