{-# 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
) 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 "alt" AltJSON :> Post '[JSON] Event
-- | Creates an event based on a simple text string.
--
-- /See:/ 'eventsQuickAdd' smart constructor.
data EventsQuickAdd = EventsQuickAdd'
{ _eqaCalendarId :: !Text
, _eqaText :: !Text
, _eqaSendNotifications :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'EventsQuickAdd' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'eqaCalendarId'
--
-- * 'eqaText'
--
-- * 'eqaSendNotifications'
eventsQuickAdd
:: Text -- ^ 'eqaCalendarId'
-> Text -- ^ 'eqaText'
-> EventsQuickAdd
eventsQuickAdd pEqaCalendarId_ pEqaText_ =
EventsQuickAdd'
{ _eqaCalendarId = pEqaCalendarId_
, _eqaText = pEqaText_
, _eqaSendNotifications = Nothing
}
-- | Calendar identifier. To retrieve calendar IDs call the calendarList.list
-- method. If you want to access the primary calendar of the currently
-- logged in user, use the \"primary\" keyword.
eqaCalendarId :: Lens' EventsQuickAdd Text
eqaCalendarId
= lens _eqaCalendarId
(\ s a -> s{_eqaCalendarId = a})
-- | The text describing the event to be created.
eqaText :: Lens' EventsQuickAdd Text
eqaText = lens _eqaText (\ s a -> s{_eqaText = a})
-- | Whether to send notifications about the creation of the event. Optional.
-- The default is False.
eqaSendNotifications :: Lens' EventsQuickAdd (Maybe Bool)
eqaSendNotifications
= lens _eqaSendNotifications
(\ s a -> s{_eqaSendNotifications = a})
instance GoogleRequest EventsQuickAdd where
type Rs EventsQuickAdd = Event
type Scopes EventsQuickAdd =
'["https://www.googleapis.com/auth/calendar"]
requestClient EventsQuickAdd'{..}
= go _eqaCalendarId (Just _eqaText)
_eqaSendNotifications
(Just AltJSON)
appsCalendarService
where go
= buildClient (Proxy :: Proxy EventsQuickAddResource)
mempty