{-# 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.Datastore.Projects.RunQuery
(
ProjectsRunQueryResource
, projectsRunQuery
, ProjectsRunQuery
, prqXgafv
, prqUploadProtocol
, prqAccessToken
, prqUploadType
, prqPayload
, prqProjectId
, prqCallback
) where
import Network.Google.Datastore.Types
import Network.Google.Prelude
type ProjectsRunQueryResource =
"v1" :>
"projects" :>
CaptureMode "projectId" "runQuery" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] RunQueryRequest :>
Post '[JSON] RunQueryResponse
data ProjectsRunQuery = ProjectsRunQuery'
{ _prqXgafv :: !(Maybe Xgafv)
, _prqUploadProtocol :: !(Maybe Text)
, _prqAccessToken :: !(Maybe Text)
, _prqUploadType :: !(Maybe Text)
, _prqPayload :: !RunQueryRequest
, _prqProjectId :: !Text
, _prqCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsRunQuery
:: RunQueryRequest
-> Text
-> ProjectsRunQuery
projectsRunQuery pPrqPayload_ pPrqProjectId_ =
ProjectsRunQuery'
{ _prqXgafv = Nothing
, _prqUploadProtocol = Nothing
, _prqAccessToken = Nothing
, _prqUploadType = Nothing
, _prqPayload = pPrqPayload_
, _prqProjectId = pPrqProjectId_
, _prqCallback = Nothing
}
prqXgafv :: Lens' ProjectsRunQuery (Maybe Xgafv)
prqXgafv = lens _prqXgafv (\ s a -> s{_prqXgafv = a})
prqUploadProtocol :: Lens' ProjectsRunQuery (Maybe Text)
prqUploadProtocol
= lens _prqUploadProtocol
(\ s a -> s{_prqUploadProtocol = a})
prqAccessToken :: Lens' ProjectsRunQuery (Maybe Text)
prqAccessToken
= lens _prqAccessToken
(\ s a -> s{_prqAccessToken = a})
prqUploadType :: Lens' ProjectsRunQuery (Maybe Text)
prqUploadType
= lens _prqUploadType
(\ s a -> s{_prqUploadType = a})
prqPayload :: Lens' ProjectsRunQuery RunQueryRequest
prqPayload
= lens _prqPayload (\ s a -> s{_prqPayload = a})
prqProjectId :: Lens' ProjectsRunQuery Text
prqProjectId
= lens _prqProjectId (\ s a -> s{_prqProjectId = a})
prqCallback :: Lens' ProjectsRunQuery (Maybe Text)
prqCallback
= lens _prqCallback (\ s a -> s{_prqCallback = a})
instance GoogleRequest ProjectsRunQuery where
type Rs ProjectsRunQuery = RunQueryResponse
type Scopes ProjectsRunQuery =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/datastore"]
requestClient ProjectsRunQuery'{..}
= go _prqProjectId _prqXgafv _prqUploadProtocol
_prqAccessToken
_prqUploadType
_prqCallback
(Just AltJSON)
_prqPayload
datastoreService
where go
= buildClient
(Proxy :: Proxy ProjectsRunQueryResource)
mempty