{-# 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.Drive.Changes.Watch
(
ChangesWatchResource
, changesWatch
, ChangesWatch
, cwIncludeTeamDriveItems
, cwPayload
, cwIncludeCorpusRemovals
, cwTeamDriveId
, cwRestrictToMyDrive
, cwSpaces
, cwPageToken
, cwPageSize
, cwIncludeRemoved
, cwSupportsTeamDrives
) where
import Network.Google.Drive.Types
import Network.Google.Prelude
type ChangesWatchResource =
"drive" :>
"v3" :>
"changes" :>
"watch" :>
QueryParam "pageToken" Text :>
QueryParam "includeTeamDriveItems" Bool :>
QueryParam "includeCorpusRemovals" Bool :>
QueryParam "teamDriveId" Text :>
QueryParam "restrictToMyDrive" Bool :>
QueryParam "spaces" Text :>
QueryParam "pageSize" (Textual Int32) :>
QueryParam "includeRemoved" Bool :>
QueryParam "supportsTeamDrives" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Channel :> Post '[JSON] Channel
data ChangesWatch = ChangesWatch'
{ _cwIncludeTeamDriveItems :: !Bool
, _cwPayload :: !Channel
, _cwIncludeCorpusRemovals :: !Bool
, _cwTeamDriveId :: !(Maybe Text)
, _cwRestrictToMyDrive :: !Bool
, _cwSpaces :: !Text
, _cwPageToken :: !Text
, _cwPageSize :: !(Textual Int32)
, _cwIncludeRemoved :: !Bool
, _cwSupportsTeamDrives :: !Bool
} deriving (Eq,Show,Data,Typeable,Generic)
changesWatch
:: Channel
-> Text
-> ChangesWatch
changesWatch pCwPayload_ pCwPageToken_ =
ChangesWatch'
{ _cwIncludeTeamDriveItems = False
, _cwPayload = pCwPayload_
, _cwIncludeCorpusRemovals = False
, _cwTeamDriveId = Nothing
, _cwRestrictToMyDrive = False
, _cwSpaces = "drive"
, _cwPageToken = pCwPageToken_
, _cwPageSize = 100
, _cwIncludeRemoved = True
, _cwSupportsTeamDrives = False
}
cwIncludeTeamDriveItems :: Lens' ChangesWatch Bool
cwIncludeTeamDriveItems
= lens _cwIncludeTeamDriveItems
(\ s a -> s{_cwIncludeTeamDriveItems = a})
cwPayload :: Lens' ChangesWatch Channel
cwPayload
= lens _cwPayload (\ s a -> s{_cwPayload = a})
cwIncludeCorpusRemovals :: Lens' ChangesWatch Bool
cwIncludeCorpusRemovals
= lens _cwIncludeCorpusRemovals
(\ s a -> s{_cwIncludeCorpusRemovals = a})
cwTeamDriveId :: Lens' ChangesWatch (Maybe Text)
cwTeamDriveId
= lens _cwTeamDriveId
(\ s a -> s{_cwTeamDriveId = a})
cwRestrictToMyDrive :: Lens' ChangesWatch Bool
cwRestrictToMyDrive
= lens _cwRestrictToMyDrive
(\ s a -> s{_cwRestrictToMyDrive = a})
cwSpaces :: Lens' ChangesWatch Text
cwSpaces = lens _cwSpaces (\ s a -> s{_cwSpaces = a})
cwPageToken :: Lens' ChangesWatch Text
cwPageToken
= lens _cwPageToken (\ s a -> s{_cwPageToken = a})
cwPageSize :: Lens' ChangesWatch Int32
cwPageSize
= lens _cwPageSize (\ s a -> s{_cwPageSize = a}) .
_Coerce
cwIncludeRemoved :: Lens' ChangesWatch Bool
cwIncludeRemoved
= lens _cwIncludeRemoved
(\ s a -> s{_cwIncludeRemoved = a})
cwSupportsTeamDrives :: Lens' ChangesWatch Bool
cwSupportsTeamDrives
= lens _cwSupportsTeamDrives
(\ s a -> s{_cwSupportsTeamDrives = a})
instance GoogleRequest ChangesWatch where
type Rs ChangesWatch = Channel
type Scopes ChangesWatch =
'["https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.appdata",
"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/drive.metadata",
"https://www.googleapis.com/auth/drive.metadata.readonly",
"https://www.googleapis.com/auth/drive.photos.readonly",
"https://www.googleapis.com/auth/drive.readonly"]
requestClient ChangesWatch'{..}
= go (Just _cwPageToken)
(Just _cwIncludeTeamDriveItems)
(Just _cwIncludeCorpusRemovals)
_cwTeamDriveId
(Just _cwRestrictToMyDrive)
(Just _cwSpaces)
(Just _cwPageSize)
(Just _cwIncludeRemoved)
(Just _cwSupportsTeamDrives)
(Just AltJSON)
_cwPayload
driveService
where go
= buildClient (Proxy :: Proxy ChangesWatchResource)
mempty