{-# 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.Import
(
EventsImportResource
, eventsImport
, EventsImport
, eiConferenceDataVersion
, eiCalendarId
, eiPayload
, eiSupportsAttachments
) where
import Network.Google.AppsCalendar.Types
import Network.Google.Prelude
type EventsImportResource =
"calendar" :>
"v3" :>
"calendars" :>
Capture "calendarId" Text :>
"events" :>
"import" :>
QueryParam "conferenceDataVersion" (Textual Int32) :>
QueryParam "supportsAttachments" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Event :> Post '[JSON] Event
data EventsImport = EventsImport'
{ _eiConferenceDataVersion :: !(Maybe (Textual Int32))
, _eiCalendarId :: !Text
, _eiPayload :: !Event
, _eiSupportsAttachments :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
eventsImport
:: Text
-> Event
-> EventsImport
eventsImport pEiCalendarId_ pEiPayload_ =
EventsImport'
{ _eiConferenceDataVersion = Nothing
, _eiCalendarId = pEiCalendarId_
, _eiPayload = pEiPayload_
, _eiSupportsAttachments = Nothing
}
eiConferenceDataVersion :: Lens' EventsImport (Maybe Int32)
eiConferenceDataVersion
= lens _eiConferenceDataVersion
(\ s a -> s{_eiConferenceDataVersion = a})
. mapping _Coerce
eiCalendarId :: Lens' EventsImport Text
eiCalendarId
= lens _eiCalendarId (\ s a -> s{_eiCalendarId = a})
eiPayload :: Lens' EventsImport Event
eiPayload
= lens _eiPayload (\ s a -> s{_eiPayload = a})
eiSupportsAttachments :: Lens' EventsImport (Maybe Bool)
eiSupportsAttachments
= lens _eiSupportsAttachments
(\ s a -> s{_eiSupportsAttachments = a})
instance GoogleRequest EventsImport where
type Rs EventsImport = Event
type Scopes EventsImport =
'["https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/calendar.events"]
requestClient EventsImport'{..}
= go _eiCalendarId _eiConferenceDataVersion
_eiSupportsAttachments
(Just AltJSON)
_eiPayload
appsCalendarService
where go
= buildClient (Proxy :: Proxy EventsImportResource)
mempty