{-# 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.CalendarList.Update
(
CalendarListUpdateResource
, calendarListUpdate
, CalendarListUpdate
, cluCalendarId
, cluPayload
, cluColorRgbFormat
) where
import Network.Google.AppsCalendar.Types
import Network.Google.Prelude
type CalendarListUpdateResource =
"calendar" :>
"v3" :>
"users" :>
"me" :>
"calendarList" :>
Capture "calendarId" Text :>
QueryParam "colorRgbFormat" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CalendarListEntry :>
Put '[JSON] CalendarListEntry
data CalendarListUpdate = CalendarListUpdate'
{ _cluCalendarId :: !Text
, _cluPayload :: !CalendarListEntry
, _cluColorRgbFormat :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
calendarListUpdate
:: Text
-> CalendarListEntry
-> CalendarListUpdate
calendarListUpdate pCluCalendarId_ pCluPayload_ =
CalendarListUpdate'
{ _cluCalendarId = pCluCalendarId_
, _cluPayload = pCluPayload_
, _cluColorRgbFormat = Nothing
}
cluCalendarId :: Lens' CalendarListUpdate Text
cluCalendarId
= lens _cluCalendarId
(\ s a -> s{_cluCalendarId = a})
cluPayload :: Lens' CalendarListUpdate CalendarListEntry
cluPayload
= lens _cluPayload (\ s a -> s{_cluPayload = a})
cluColorRgbFormat :: Lens' CalendarListUpdate (Maybe Bool)
cluColorRgbFormat
= lens _cluColorRgbFormat
(\ s a -> s{_cluColorRgbFormat = a})
instance GoogleRequest CalendarListUpdate where
type Rs CalendarListUpdate = CalendarListEntry
type Scopes CalendarListUpdate =
'["https://www.googleapis.com/auth/calendar"]
requestClient CalendarListUpdate'{..}
= go _cluCalendarId _cluColorRgbFormat (Just AltJSON)
_cluPayload
appsCalendarService
where go
= buildClient
(Proxy :: Proxy CalendarListUpdateResource)
mempty