{-# 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.Calendar.Settings.Watch
(
SettingsWatchResource
, settingsWatch
, SettingsWatch
, swSyncToken
, swPayload
, swPageToken
, swMaxResults
) where
import Network.Google.AppsCalendar.Types
import Network.Google.Prelude
type SettingsWatchResource =
"calendar" :>
"v3" :>
"users" :>
"me" :>
"settings" :>
"watch" :>
QueryParam "syncToken" Text :>
QueryParam "pageToken" Text :>
QueryParam "maxResults" (Textual Int32) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Channel :> Post '[JSON] Channel
data SettingsWatch = SettingsWatch'
{ _swSyncToken :: !(Maybe Text)
, _swPayload :: !Channel
, _swPageToken :: !(Maybe Text)
, _swMaxResults :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
settingsWatch
:: Channel
-> SettingsWatch
settingsWatch pSwPayload_ =
SettingsWatch'
{ _swSyncToken = Nothing
, _swPayload = pSwPayload_
, _swPageToken = Nothing
, _swMaxResults = Nothing
}
swSyncToken :: Lens' SettingsWatch (Maybe Text)
swSyncToken
= lens _swSyncToken (\ s a -> s{_swSyncToken = a})
swPayload :: Lens' SettingsWatch Channel
swPayload
= lens _swPayload (\ s a -> s{_swPayload = a})
swPageToken :: Lens' SettingsWatch (Maybe Text)
swPageToken
= lens _swPageToken (\ s a -> s{_swPageToken = a})
swMaxResults :: Lens' SettingsWatch (Maybe Int32)
swMaxResults
= lens _swMaxResults (\ s a -> s{_swMaxResults = a})
. mapping _Coerce
instance GoogleRequest SettingsWatch where
type Rs SettingsWatch = Channel
type Scopes SettingsWatch =
'["https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/calendar.readonly",
"https://www.googleapis.com/auth/calendar.settings.readonly"]
requestClient SettingsWatch'{..}
= go _swSyncToken _swPageToken _swMaxResults
(Just AltJSON)
_swPayload
appsCalendarService
where go
= buildClient (Proxy :: Proxy SettingsWatchResource)
mempty