{-# 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.Insert
(
TablesInsertResource
, tablesInsert
, TablesInsert
, tiPayload
, tiDataSetId
, tiProjectId
) where
import Network.Google.BigQuery.Types
import Network.Google.Prelude
type TablesInsertResource =
"bigquery" :>
"v2" :>
"projects" :>
Capture "projectId" Text :>
"datasets" :>
Capture "datasetId" Text :>
"tables" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Table :> Post '[JSON] Table
data TablesInsert = TablesInsert'
{ _tiPayload :: !Table
, _tiDataSetId :: !Text
, _tiProjectId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
tablesInsert
:: Table
-> Text
-> Text
-> TablesInsert
tablesInsert pTiPayload_ pTiDataSetId_ pTiProjectId_ =
TablesInsert'
{ _tiPayload = pTiPayload_
, _tiDataSetId = pTiDataSetId_
, _tiProjectId = pTiProjectId_
}
tiPayload :: Lens' TablesInsert Table
tiPayload
= lens _tiPayload (\ s a -> s{_tiPayload = a})
tiDataSetId :: Lens' TablesInsert Text
tiDataSetId
= lens _tiDataSetId (\ s a -> s{_tiDataSetId = a})
tiProjectId :: Lens' TablesInsert Text
tiProjectId
= lens _tiProjectId (\ s a -> s{_tiProjectId = a})
instance GoogleRequest TablesInsert where
type Rs TablesInsert = Table
type Scopes TablesInsert =
'["https://www.googleapis.com/auth/bigquery",
"https://www.googleapis.com/auth/cloud-platform"]
requestClient TablesInsert'{..}
= go _tiProjectId _tiDataSetId (Just AltJSON)
_tiPayload
bigQueryService
where go
= buildClient (Proxy :: Proxy TablesInsertResource)
mempty