{-# 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
) where
import Network.Google.AppsCalendar.Types
import Network.Google.Prelude
type ACLInsertResource =
"calendar" :>
"v3" :>
"calendars" :>
Capture "calendarId" Text :>
"acl" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ACLRule :> Post '[JSON] ACLRule
-- | Creates an access control rule.
--
-- /See:/ 'aclInsert' smart constructor.
data ACLInsert = ACLInsert'
{ _aiCalendarId :: !Text
, _aiPayload :: !ACLRule
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'ACLInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aiCalendarId'
--
-- * 'aiPayload'
aclInsert
:: Text -- ^ 'aiCalendarId'
-> ACLRule -- ^ 'aiPayload'
-> ACLInsert
aclInsert pAiCalendarId_ pAiPayload_ =
ACLInsert'
{ _aiCalendarId = pAiCalendarId_
, _aiPayload = pAiPayload_
}
-- | 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.
aiCalendarId :: Lens' ACLInsert Text
aiCalendarId
= lens _aiCalendarId (\ s a -> s{_aiCalendarId = a})
-- | Multipart request metadata.
aiPayload :: Lens' ACLInsert ACLRule
aiPayload
= lens _aiPayload (\ s a -> s{_aiPayload = a})
instance GoogleRequest ACLInsert where
type Rs ACLInsert = ACLRule
type Scopes ACLInsert =
'["https://www.googleapis.com/auth/calendar"]
requestClient ACLInsert'{..}
= go _aiCalendarId (Just AltJSON) _aiPayload
appsCalendarService
where go
= buildClient (Proxy :: Proxy ACLInsertResource)
mempty