{-# 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.DriveActivity.Activity.Query
(
ActivityQueryResource
, activityQuery
, ActivityQuery
, aqXgafv
, aqUploadProtocol
, aqAccessToken
, aqUploadType
, aqPayload
, aqCallback
) where
import Network.Google.DriveActivity.Types
import Network.Google.Prelude
type ActivityQueryResource =
"v2" :>
"activity:query" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] QueryDriveActivityRequest :>
Post '[JSON] QueryDriveActivityResponse
data ActivityQuery = ActivityQuery'
{ _aqXgafv :: !(Maybe Xgafv)
, _aqUploadProtocol :: !(Maybe Text)
, _aqAccessToken :: !(Maybe Text)
, _aqUploadType :: !(Maybe Text)
, _aqPayload :: !QueryDriveActivityRequest
, _aqCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
activityQuery
:: QueryDriveActivityRequest
-> ActivityQuery
activityQuery pAqPayload_ =
ActivityQuery'
{ _aqXgafv = Nothing
, _aqUploadProtocol = Nothing
, _aqAccessToken = Nothing
, _aqUploadType = Nothing
, _aqPayload = pAqPayload_
, _aqCallback = Nothing
}
aqXgafv :: Lens' ActivityQuery (Maybe Xgafv)
aqXgafv = lens _aqXgafv (\ s a -> s{_aqXgafv = a})
aqUploadProtocol :: Lens' ActivityQuery (Maybe Text)
aqUploadProtocol
= lens _aqUploadProtocol
(\ s a -> s{_aqUploadProtocol = a})
aqAccessToken :: Lens' ActivityQuery (Maybe Text)
aqAccessToken
= lens _aqAccessToken
(\ s a -> s{_aqAccessToken = a})
aqUploadType :: Lens' ActivityQuery (Maybe Text)
aqUploadType
= lens _aqUploadType (\ s a -> s{_aqUploadType = a})
aqPayload :: Lens' ActivityQuery QueryDriveActivityRequest
aqPayload
= lens _aqPayload (\ s a -> s{_aqPayload = a})
aqCallback :: Lens' ActivityQuery (Maybe Text)
aqCallback
= lens _aqCallback (\ s a -> s{_aqCallback = a})
instance GoogleRequest ActivityQuery where
type Rs ActivityQuery = QueryDriveActivityResponse
type Scopes ActivityQuery =
'["https://www.googleapis.com/auth/drive.activity",
"https://www.googleapis.com/auth/drive.activity.readonly"]
requestClient ActivityQuery'{..}
= go _aqXgafv _aqUploadProtocol _aqAccessToken
_aqUploadType
_aqCallback
(Just AltJSON)
_aqPayload
driveActivityService
where go
= buildClient (Proxy :: Proxy ActivityQueryResource)
mempty