{-# 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.Tables.Get
(
TablesGetResource
, tablesGet
, TablesGet
, tgDataSetId
, tgProjectId
, tgSelectedFields
, tgTableId
) where
import Network.Google.BigQuery.Types
import Network.Google.Prelude
type TablesGetResource =
"bigquery" :>
"v2" :>
"projects" :>
Capture "projectId" Text :>
"datasets" :>
Capture "datasetId" Text :>
"tables" :>
Capture "tableId" Text :>
QueryParam "selectedFields" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] Table
data TablesGet = TablesGet'
{ _tgDataSetId :: !Text
, _tgProjectId :: !Text
, _tgSelectedFields :: !(Maybe Text)
, _tgTableId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
tablesGet
:: Text
-> Text
-> Text
-> TablesGet
tablesGet pTgDataSetId_ pTgProjectId_ pTgTableId_ =
TablesGet'
{ _tgDataSetId = pTgDataSetId_
, _tgProjectId = pTgProjectId_
, _tgSelectedFields = Nothing
, _tgTableId = pTgTableId_
}
tgDataSetId :: Lens' TablesGet Text
tgDataSetId
= lens _tgDataSetId (\ s a -> s{_tgDataSetId = a})
tgProjectId :: Lens' TablesGet Text
tgProjectId
= lens _tgProjectId (\ s a -> s{_tgProjectId = a})
tgSelectedFields :: Lens' TablesGet (Maybe Text)
tgSelectedFields
= lens _tgSelectedFields
(\ s a -> s{_tgSelectedFields = a})
tgTableId :: Lens' TablesGet Text
tgTableId
= lens _tgTableId (\ s a -> s{_tgTableId = a})
instance GoogleRequest TablesGet where
type Rs TablesGet = Table
type Scopes TablesGet =
'["https://www.googleapis.com/auth/bigquery",
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only"]
requestClient TablesGet'{..}
= go _tgProjectId _tgDataSetId _tgTableId
_tgSelectedFields
(Just AltJSON)
bigQueryService
where go
= buildClient (Proxy :: Proxy TablesGetResource)
mempty