{-# 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.Directory.Resources.Calendars.Insert
(
ResourcesCalendarsInsertResource
, resourcesCalendarsInsert
, ResourcesCalendarsInsert
, rciPayload
, rciCustomer
) where
import Network.Google.Directory.Types
import Network.Google.Prelude
type ResourcesCalendarsInsertResource =
"admin" :>
"directory" :>
"v1" :>
"customer" :>
Capture "customer" Text :>
"resources" :>
"calendars" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CalendarResource :>
Post '[JSON] CalendarResource
data ResourcesCalendarsInsert = ResourcesCalendarsInsert'
{ _rciPayload :: !CalendarResource
, _rciCustomer :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
resourcesCalendarsInsert
:: CalendarResource
-> Text
-> ResourcesCalendarsInsert
resourcesCalendarsInsert pRciPayload_ pRciCustomer_ =
ResourcesCalendarsInsert'
{ _rciPayload = pRciPayload_
, _rciCustomer = pRciCustomer_
}
rciPayload :: Lens' ResourcesCalendarsInsert CalendarResource
rciPayload
= lens _rciPayload (\ s a -> s{_rciPayload = a})
rciCustomer :: Lens' ResourcesCalendarsInsert Text
rciCustomer
= lens _rciCustomer (\ s a -> s{_rciCustomer = a})
instance GoogleRequest ResourcesCalendarsInsert where
type Rs ResourcesCalendarsInsert = CalendarResource
type Scopes ResourcesCalendarsInsert =
'["https://www.googleapis.com/auth/admin.directory.resource.calendar"]
requestClient ResourcesCalendarsInsert'{..}
= go _rciCustomer (Just AltJSON) _rciPayload
directoryService
where go
= buildClient
(Proxy :: Proxy ResourcesCalendarsInsertResource)
mempty