{-# 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.Patch
(
TablesPatchResource
, tablesPatch
, TablesPatch
, tpPayload
, tpDataSetId
, tpProjectId
, tpTableId
) where
import Network.Google.BigQuery.Types
import Network.Google.Prelude
type TablesPatchResource =
"bigquery" :>
"v2" :>
"projects" :>
Capture "projectId" Text :>
"datasets" :>
Capture "datasetId" Text :>
"tables" :>
Capture "tableId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Table :> Patch '[JSON] Table
data TablesPatch = TablesPatch'
{ _tpPayload :: !Table
, _tpDataSetId :: !Text
, _tpProjectId :: !Text
, _tpTableId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
tablesPatch
:: Table
-> Text
-> Text
-> Text
-> TablesPatch
tablesPatch pTpPayload_ pTpDataSetId_ pTpProjectId_ pTpTableId_ =
TablesPatch'
{ _tpPayload = pTpPayload_
, _tpDataSetId = pTpDataSetId_
, _tpProjectId = pTpProjectId_
, _tpTableId = pTpTableId_
}
tpPayload :: Lens' TablesPatch Table
tpPayload
= lens _tpPayload (\ s a -> s{_tpPayload = a})
tpDataSetId :: Lens' TablesPatch Text
tpDataSetId
= lens _tpDataSetId (\ s a -> s{_tpDataSetId = a})
tpProjectId :: Lens' TablesPatch Text
tpProjectId
= lens _tpProjectId (\ s a -> s{_tpProjectId = a})
tpTableId :: Lens' TablesPatch Text
tpTableId
= lens _tpTableId (\ s a -> s{_tpTableId = a})
instance GoogleRequest TablesPatch where
type Rs TablesPatch = Table
type Scopes TablesPatch =
'["https://www.googleapis.com/auth/bigquery",
"https://www.googleapis.com/auth/cloud-platform"]
requestClient TablesPatch'{..}
= go _tpProjectId _tpDataSetId _tpTableId
(Just AltJSON)
_tpPayload
bigQueryService
where go
= buildClient (Proxy :: Proxy TablesPatchResource)
mempty