{-# 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.FusionTables.Table.Update
(
TableUpdateResource
, tableUpdate
, TableUpdate
, tabPayload
, tabReplaceViewDefinition
, tabTableId
) where
import Network.Google.FusionTables.Types
import Network.Google.Prelude
type TableUpdateResource =
"fusiontables" :>
"v2" :>
"tables" :>
Capture "tableId" Text :>
QueryParam "replaceViewDefinition" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Table :> Put '[JSON] Table
data TableUpdate = TableUpdate'
{ _tabPayload :: !Table
, _tabReplaceViewDefinition :: !(Maybe Bool)
, _tabTableId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
tableUpdate
:: Table
-> Text
-> TableUpdate
tableUpdate pTabPayload_ pTabTableId_ =
TableUpdate'
{ _tabPayload = pTabPayload_
, _tabReplaceViewDefinition = Nothing
, _tabTableId = pTabTableId_
}
tabPayload :: Lens' TableUpdate Table
tabPayload
= lens _tabPayload (\ s a -> s{_tabPayload = a})
tabReplaceViewDefinition :: Lens' TableUpdate (Maybe Bool)
tabReplaceViewDefinition
= lens _tabReplaceViewDefinition
(\ s a -> s{_tabReplaceViewDefinition = a})
tabTableId :: Lens' TableUpdate Text
tabTableId
= lens _tabTableId (\ s a -> s{_tabTableId = a})
instance GoogleRequest TableUpdate where
type Rs TableUpdate = Table
type Scopes TableUpdate =
'["https://www.googleapis.com/auth/fusiontables"]
requestClient TableUpdate'{..}
= go _tabTableId _tabReplaceViewDefinition
(Just AltJSON)
_tabPayload
fusionTablesService
where go
= buildClient (Proxy :: Proxy TableUpdateResource)
mempty