{-# 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.Insert
(
CalendarListInsertResource
, calendarListInsert
, CalendarListInsert
, cliPayload
, cliColorRgbFormat
) where
import Network.Google.AppsCalendar.Types
import Network.Google.Prelude
type CalendarListInsertResource =
"calendar" :>
"v3" :>
"users" :>
"me" :>
"calendarList" :>
QueryParam "colorRgbFormat" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CalendarListEntry :>
Post '[JSON] CalendarListEntry
data CalendarListInsert = CalendarListInsert'
{ _cliPayload :: !CalendarListEntry
, _cliColorRgbFormat :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
calendarListInsert
:: CalendarListEntry
-> CalendarListInsert
calendarListInsert pCliPayload_ =
CalendarListInsert'
{ _cliPayload = pCliPayload_
, _cliColorRgbFormat = Nothing
}
cliPayload :: Lens' CalendarListInsert CalendarListEntry
cliPayload
= lens _cliPayload (\ s a -> s{_cliPayload = a})
cliColorRgbFormat :: Lens' CalendarListInsert (Maybe Bool)
cliColorRgbFormat
= lens _cliColorRgbFormat
(\ s a -> s{_cliColorRgbFormat = a})
instance GoogleRequest CalendarListInsert where
type Rs CalendarListInsert = CalendarListEntry
type Scopes CalendarListInsert =
'["https://www.googleapis.com/auth/calendar"]
requestClient CalendarListInsert'{..}
= go _cliColorRgbFormat (Just AltJSON) _cliPayload
appsCalendarService
where go
= buildClient
(Proxy :: Proxy CalendarListInsertResource)
mempty