{-# 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.History.List
(
UsersHistoryListResource
, usersHistoryList
, UsersHistoryList
, uhlHistoryTypes
, uhlUserId
, uhlStartHistoryId
, uhlPageToken
, uhlLabelId
, uhlMaxResults
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
type UsersHistoryListResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"history" :>
QueryParams "historyTypes"
UsersHistoryListHistoryTypes
:>
QueryParam "startHistoryId" (Textual Word64) :>
QueryParam "pageToken" Text :>
QueryParam "labelId" Text :>
QueryParam "maxResults" (Textual Word32) :>
QueryParam "alt" AltJSON :>
Get '[JSON] ListHistoryResponse
data UsersHistoryList = UsersHistoryList'
{ _uhlHistoryTypes :: !(Maybe [UsersHistoryListHistoryTypes])
, _uhlUserId :: !Text
, _uhlStartHistoryId :: !(Maybe (Textual Word64))
, _uhlPageToken :: !(Maybe Text)
, _uhlLabelId :: !(Maybe Text)
, _uhlMaxResults :: !(Textual Word32)
} deriving (Eq,Show,Data,Typeable,Generic)
usersHistoryList
:: UsersHistoryList
usersHistoryList =
UsersHistoryList'
{ _uhlHistoryTypes = Nothing
, _uhlUserId = "me"
, _uhlStartHistoryId = Nothing
, _uhlPageToken = Nothing
, _uhlLabelId = Nothing
, _uhlMaxResults = 100
}
uhlHistoryTypes :: Lens' UsersHistoryList [UsersHistoryListHistoryTypes]
uhlHistoryTypes
= lens _uhlHistoryTypes
(\ s a -> s{_uhlHistoryTypes = a})
. _Default
. _Coerce
uhlUserId :: Lens' UsersHistoryList Text
uhlUserId
= lens _uhlUserId (\ s a -> s{_uhlUserId = a})
uhlStartHistoryId :: Lens' UsersHistoryList (Maybe Word64)
uhlStartHistoryId
= lens _uhlStartHistoryId
(\ s a -> s{_uhlStartHistoryId = a})
. mapping _Coerce
uhlPageToken :: Lens' UsersHistoryList (Maybe Text)
uhlPageToken
= lens _uhlPageToken (\ s a -> s{_uhlPageToken = a})
uhlLabelId :: Lens' UsersHistoryList (Maybe Text)
uhlLabelId
= lens _uhlLabelId (\ s a -> s{_uhlLabelId = a})
uhlMaxResults :: Lens' UsersHistoryList Word32
uhlMaxResults
= lens _uhlMaxResults
(\ s a -> s{_uhlMaxResults = a})
. _Coerce
instance GoogleRequest UsersHistoryList where
type Rs UsersHistoryList = ListHistoryResponse
type Scopes UsersHistoryList =
'["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 UsersHistoryList'{..}
= go _uhlUserId (_uhlHistoryTypes ^. _Default)
_uhlStartHistoryId
_uhlPageToken
_uhlLabelId
(Just _uhlMaxResults)
(Just AltJSON)
gmailService
where go
= buildClient
(Proxy :: Proxy UsersHistoryListResource)
mempty