{-# 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.Events.QuickAdd
(
EventsQuickAddResource
, eventsQuickAdd
, EventsQuickAdd
, eqaCalendarId
, eqaText
, eqaSendNotifications
, eqaSendUpdates
) where
import Network.Google.AppsCalendar.Types
import Network.Google.Prelude
type EventsQuickAddResource =
"calendar" :>
"v3" :>
"calendars" :>
Capture "calendarId" Text :>
"events" :>
"quickAdd" :>
QueryParam "text" Text :>
QueryParam "sendNotifications" Bool :>
QueryParam "sendUpdates" EventsQuickAddSendUpdates :>
QueryParam "alt" AltJSON :> Post '[JSON] Event
data EventsQuickAdd = EventsQuickAdd'
{ _eqaCalendarId :: !Text
, _eqaText :: !Text
, _eqaSendNotifications :: !(Maybe Bool)
, _eqaSendUpdates :: !(Maybe EventsQuickAddSendUpdates)
} deriving (Eq,Show,Data,Typeable,Generic)
eventsQuickAdd
:: Text
-> Text
-> EventsQuickAdd
eventsQuickAdd pEqaCalendarId_ pEqaText_ =
EventsQuickAdd'
{ _eqaCalendarId = pEqaCalendarId_
, _eqaText = pEqaText_
, _eqaSendNotifications = Nothing
, _eqaSendUpdates = Nothing
}
eqaCalendarId :: Lens' EventsQuickAdd Text
eqaCalendarId
= lens _eqaCalendarId
(\ s a -> s{_eqaCalendarId = a})
eqaText :: Lens' EventsQuickAdd Text
eqaText = lens _eqaText (\ s a -> s{_eqaText = a})
eqaSendNotifications :: Lens' EventsQuickAdd (Maybe Bool)
eqaSendNotifications
= lens _eqaSendNotifications
(\ s a -> s{_eqaSendNotifications = a})
eqaSendUpdates :: Lens' EventsQuickAdd (Maybe EventsQuickAddSendUpdates)
eqaSendUpdates
= lens _eqaSendUpdates
(\ s a -> s{_eqaSendUpdates = a})
instance GoogleRequest EventsQuickAdd where
type Rs EventsQuickAdd = Event
type Scopes EventsQuickAdd =
'["https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/calendar.events"]
requestClient EventsQuickAdd'{..}
= go _eqaCalendarId (Just _eqaText)
_eqaSendNotifications
_eqaSendUpdates
(Just AltJSON)
appsCalendarService
where go
= buildClient (Proxy :: Proxy EventsQuickAddResource)
mempty