{-# 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.BigQuery.Jobs.Query
(
JobsQueryResource
, jobsQuery
, JobsQuery
, jqPayload
, jqProjectId
) where
import Network.Google.BigQuery.Types
import Network.Google.Prelude
type JobsQueryResource =
"bigquery" :>
"v2" :>
"projects" :>
Capture "projectId" Text :>
"queries" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] QueryRequest :>
Post '[JSON] QueryResponse
data JobsQuery = JobsQuery'
{ _jqPayload :: !QueryRequest
, _jqProjectId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
jobsQuery
:: QueryRequest
-> Text
-> JobsQuery
jobsQuery pJqPayload_ pJqProjectId_ =
JobsQuery'
{ _jqPayload = pJqPayload_
, _jqProjectId = pJqProjectId_
}
jqPayload :: Lens' JobsQuery QueryRequest
jqPayload
= lens _jqPayload (\ s a -> s{_jqPayload = a})
jqProjectId :: Lens' JobsQuery Text
jqProjectId
= lens _jqProjectId (\ s a -> s{_jqProjectId = a})
instance GoogleRequest JobsQuery where
type Rs JobsQuery = QueryResponse
type Scopes JobsQuery =
'["https://www.googleapis.com/auth/bigquery",
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only"]
requestClient JobsQuery'{..}
= go _jqProjectId (Just AltJSON) _jqPayload
bigQueryService
where go
= buildClient (Proxy :: Proxy JobsQueryResource)
mempty