{-# 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.FreeBusy.Query
(
FreeBusyQueryResource
, freeBusyQuery
, FreeBusyQuery
, fbqPayload
) where
import Network.Google.AppsCalendar.Types
import Network.Google.Prelude
type FreeBusyQueryResource =
"calendar" :>
"v3" :>
"freeBusy" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] FreeBusyRequest :>
Post '[JSON] FreeBusyResponse
newtype FreeBusyQuery = FreeBusyQuery'
{ _fbqPayload :: FreeBusyRequest
} deriving (Eq,Show,Data,Typeable,Generic)
freeBusyQuery
:: FreeBusyRequest
-> FreeBusyQuery
freeBusyQuery pFbqPayload_ =
FreeBusyQuery'
{ _fbqPayload = pFbqPayload_
}
fbqPayload :: Lens' FreeBusyQuery FreeBusyRequest
fbqPayload
= lens _fbqPayload (\ s a -> s{_fbqPayload = a})
instance GoogleRequest FreeBusyQuery where
type Rs FreeBusyQuery = FreeBusyResponse
type Scopes FreeBusyQuery =
'["https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/calendar.readonly"]
requestClient FreeBusyQuery'{..}
= go (Just AltJSON) _fbqPayload appsCalendarService
where go
= buildClient (Proxy :: Proxy FreeBusyQueryResource)
mempty