{-# 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.Copy
(
TableCopyResource
, tableCopy
, TableCopy
, tcTableId
, tcCopyPresentation
) where
import Network.Google.FusionTables.Types
import Network.Google.Prelude
type TableCopyResource =
"fusiontables" :>
"v2" :>
"tables" :>
Capture "tableId" Text :>
"copy" :>
QueryParam "copyPresentation" Bool :>
QueryParam "alt" AltJSON :> Post '[JSON] Table
-- | Copies a table.
--
-- /See:/ 'tableCopy' smart constructor.
data TableCopy = TableCopy'
{ _tcTableId :: !Text
, _tcCopyPresentation :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'TableCopy' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'tcTableId'
--
-- * 'tcCopyPresentation'
tableCopy
:: Text -- ^ 'tcTableId'
-> TableCopy
tableCopy pTcTableId_ =
TableCopy'
{ _tcTableId = pTcTableId_
, _tcCopyPresentation = Nothing
}
-- | ID of the table that is being copied.
tcTableId :: Lens' TableCopy Text
tcTableId
= lens _tcTableId (\ s a -> s{_tcTableId = a})
-- | Whether to also copy tabs, styles, and templates. Default is false.
tcCopyPresentation :: Lens' TableCopy (Maybe Bool)
tcCopyPresentation
= lens _tcCopyPresentation
(\ s a -> s{_tcCopyPresentation = a})
instance GoogleRequest TableCopy where
type Rs TableCopy = Table
type Scopes TableCopy =
'["https://www.googleapis.com/auth/fusiontables",
"https://www.googleapis.com/auth/fusiontables.readonly"]
requestClient TableCopy'{..}
= go _tcTableId _tcCopyPresentation (Just AltJSON)
fusionTablesService
where go
= buildClient (Proxy :: Proxy TableCopyResource)
mempty