{-# 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
-- | Inserts a calendar resource.
--
-- /See:/ 'resourcesCalendarsInsert' smart constructor.
data ResourcesCalendarsInsert = ResourcesCalendarsInsert'
{ _rciPayload :: !CalendarResource
, _rciCustomer :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'ResourcesCalendarsInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'rciPayload'
--
-- * 'rciCustomer'
resourcesCalendarsInsert
:: CalendarResource -- ^ 'rciPayload'
-> Text -- ^ 'rciCustomer'
-> ResourcesCalendarsInsert
resourcesCalendarsInsert pRciPayload_ pRciCustomer_ =
ResourcesCalendarsInsert'
{ _rciPayload = pRciPayload_
, _rciCustomer = pRciCustomer_
}
-- | Multipart request metadata.
rciPayload :: Lens' ResourcesCalendarsInsert CalendarResource
rciPayload
= lens _rciPayload (\ s a -> s{_rciPayload = a})
-- | The unique ID for the customer\'s Google account. As an account
-- administrator, you can also use the my_customer alias to represent your
-- account\'s customer ID.
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