{-# 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.Insert
(
EventsInsertResource
, eventsInsert
, EventsInsert
, eveConferenceDataVersion
, eveCalendarId
, evePayload
, eveMaxAttendees
, eveSendNotifications
, eveSupportsAttachments
, eveSendUpdates
) where
import Network.Google.AppsCalendar.Types
import Network.Google.Prelude
type EventsInsertResource =
"calendar" :>
"v3" :>
"calendars" :>
Capture "calendarId" Text :>
"events" :>
QueryParam "conferenceDataVersion" (Textual Int32) :>
QueryParam "maxAttendees" (Textual Int32) :>
QueryParam "sendNotifications" Bool :>
QueryParam "supportsAttachments" Bool :>
QueryParam "sendUpdates" EventsInsertSendUpdates :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Event :> Post '[JSON] Event
data EventsInsert = EventsInsert'
{ _eveConferenceDataVersion :: !(Maybe (Textual Int32))
, _eveCalendarId :: !Text
, _evePayload :: !Event
, _eveMaxAttendees :: !(Maybe (Textual Int32))
, _eveSendNotifications :: !(Maybe Bool)
, _eveSupportsAttachments :: !(Maybe Bool)
, _eveSendUpdates :: !(Maybe EventsInsertSendUpdates)
} deriving (Eq,Show,Data,Typeable,Generic)
eventsInsert
:: Text
-> Event
-> EventsInsert
eventsInsert pEveCalendarId_ pEvePayload_ =
EventsInsert'
{ _eveConferenceDataVersion = Nothing
, _eveCalendarId = pEveCalendarId_
, _evePayload = pEvePayload_
, _eveMaxAttendees = Nothing
, _eveSendNotifications = Nothing
, _eveSupportsAttachments = Nothing
, _eveSendUpdates = Nothing
}
eveConferenceDataVersion :: Lens' EventsInsert (Maybe Int32)
eveConferenceDataVersion
= lens _eveConferenceDataVersion
(\ s a -> s{_eveConferenceDataVersion = a})
. mapping _Coerce
eveCalendarId :: Lens' EventsInsert Text
eveCalendarId
= lens _eveCalendarId
(\ s a -> s{_eveCalendarId = a})
evePayload :: Lens' EventsInsert Event
evePayload
= lens _evePayload (\ s a -> s{_evePayload = a})
eveMaxAttendees :: Lens' EventsInsert (Maybe Int32)
eveMaxAttendees
= lens _eveMaxAttendees
(\ s a -> s{_eveMaxAttendees = a})
. mapping _Coerce
eveSendNotifications :: Lens' EventsInsert (Maybe Bool)
eveSendNotifications
= lens _eveSendNotifications
(\ s a -> s{_eveSendNotifications = a})
eveSupportsAttachments :: Lens' EventsInsert (Maybe Bool)
eveSupportsAttachments
= lens _eveSupportsAttachments
(\ s a -> s{_eveSupportsAttachments = a})
eveSendUpdates :: Lens' EventsInsert (Maybe EventsInsertSendUpdates)
eveSendUpdates
= lens _eveSendUpdates
(\ s a -> s{_eveSendUpdates = a})
instance GoogleRequest EventsInsert where
type Rs EventsInsert = Event
type Scopes EventsInsert =
'["https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/calendar.events"]
requestClient EventsInsert'{..}
= go _eveCalendarId _eveConferenceDataVersion
_eveMaxAttendees
_eveSendNotifications
_eveSupportsAttachments
_eveSendUpdates
(Just AltJSON)
_evePayload
appsCalendarService
where go
= buildClient (Proxy :: Proxy EventsInsertResource)
mempty