{-# 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.ACL.Insert
(
ACLInsertResource
, aclInsert
, ACLInsert
, aiCalendarId
, aiPayload
, aiSendNotifications
) where
import Network.Google.AppsCalendar.Types
import Network.Google.Prelude
type ACLInsertResource =
"calendar" :>
"v3" :>
"calendars" :>
Capture "calendarId" Text :>
"acl" :>
QueryParam "sendNotifications" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ACLRule :> Post '[JSON] ACLRule
data ACLInsert = ACLInsert'
{ _aiCalendarId :: !Text
, _aiPayload :: !ACLRule
, _aiSendNotifications :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
aclInsert
:: Text
-> ACLRule
-> ACLInsert
aclInsert pAiCalendarId_ pAiPayload_ =
ACLInsert'
{ _aiCalendarId = pAiCalendarId_
, _aiPayload = pAiPayload_
, _aiSendNotifications = Nothing
}
aiCalendarId :: Lens' ACLInsert Text
aiCalendarId
= lens _aiCalendarId (\ s a -> s{_aiCalendarId = a})
aiPayload :: Lens' ACLInsert ACLRule
aiPayload
= lens _aiPayload (\ s a -> s{_aiPayload = a})
aiSendNotifications :: Lens' ACLInsert (Maybe Bool)
aiSendNotifications
= lens _aiSendNotifications
(\ s a -> s{_aiSendNotifications = a})
instance GoogleRequest ACLInsert where
type Rs ACLInsert = ACLRule
type Scopes ACLInsert =
'["https://www.googleapis.com/auth/calendar"]
requestClient ACLInsert'{..}
= go _aiCalendarId _aiSendNotifications
(Just AltJSON)
_aiPayload
appsCalendarService
where go
= buildClient (Proxy :: Proxy ACLInsertResource)
mempty