{-# 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.Drafts.Get
(
UsersDraftsGetResource
, usersDraftsGet
, UsersDraftsGet
, udgFormat
, udgUserId
, udgId
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersDraftsGetResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"drafts" :>
Capture "id" Text :>
QueryParam "format" UsersDraftsGetFormat :>
QueryParam "alt" AltJSON :> Get '[JSON] Draft
data UsersDraftsGet = UsersDraftsGet'
{ _udgFormat :: !UsersDraftsGetFormat
, _udgUserId :: !Text
, _udgId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
usersDraftsGet
:: Text
-> UsersDraftsGet
usersDraftsGet pUdgId_ =
UsersDraftsGet'
{ _udgFormat = UDGFFull
, _udgUserId = "me"
, _udgId = pUdgId_
}
udgFormat :: Lens' UsersDraftsGet UsersDraftsGetFormat
udgFormat
= lens _udgFormat (\ s a -> s{_udgFormat = a})
udgUserId :: Lens' UsersDraftsGet Text
udgUserId
= lens _udgUserId (\ s a -> s{_udgUserId = a})
udgId :: Lens' UsersDraftsGet Text
udgId = lens _udgId (\ s a -> s{_udgId = a})
instance GoogleRequest UsersDraftsGet where
type Rs UsersDraftsGet = Draft
type Scopes UsersDraftsGet =
'["https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.compose",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly"]
requestClient UsersDraftsGet'{..}
= go _udgUserId _udgId (Just _udgFormat)
(Just AltJSON)
gmailService
where go
= buildClient (Proxy :: Proxy UsersDraftsGetResource)
mempty