{-# 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.Calendars.Insert
(
CalendarsInsertResource
, calendarsInsert
, CalendarsInsert
, ciPayload
) where
import Network.Google.AppsCalendar.Types
import Network.Google.Prelude
type CalendarsInsertResource =
"calendar" :>
"v3" :>
"calendars" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Calendar :> Post '[JSON] Calendar
newtype CalendarsInsert = CalendarsInsert'
{ _ciPayload :: Calendar
} deriving (Eq,Show,Data,Typeable,Generic)
calendarsInsert
:: Calendar
-> CalendarsInsert
calendarsInsert pCiPayload_ =
CalendarsInsert'
{ _ciPayload = pCiPayload_
}
ciPayload :: Lens' CalendarsInsert Calendar
ciPayload
= lens _ciPayload (\ s a -> s{_ciPayload = a})
instance GoogleRequest CalendarsInsert where
type Rs CalendarsInsert = Calendar
type Scopes CalendarsInsert =
'["https://www.googleapis.com/auth/calendar"]
requestClient CalendarsInsert'{..}
= go (Just AltJSON) _ciPayload appsCalendarService
where go
= buildClient
(Proxy :: Proxy CalendarsInsertResource)
mempty