{-# 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.ImportTable
(
TableImportTableResource
, tableImportTable
, TableImportTable
, titName
, titDelimiter
, titEncoding
) where
import Network.Google.FusionTables.Types
import Network.Google.Prelude
type TableImportTableResource =
"fusiontables" :>
"v2" :>
"tables" :>
"import" :>
QueryParam "name" Text :>
QueryParam "delimiter" Text :>
QueryParam "encoding" Text :>
QueryParam "alt" AltJSON :> Post '[JSON] Table
:<|>
"upload" :>
"fusiontables" :>
"v2" :>
"tables" :>
"import" :>
QueryParam "name" Text :>
QueryParam "delimiter" Text :>
QueryParam "encoding" Text :>
QueryParam "alt" AltJSON :>
QueryParam "uploadType" AltMedia :>
AltMedia :> Post '[JSON] Table
data TableImportTable = TableImportTable'
{ _titName :: !Text
, _titDelimiter :: !(Maybe Text)
, _titEncoding :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
tableImportTable
:: Text
-> TableImportTable
tableImportTable pTitName_ =
TableImportTable'
{ _titName = pTitName_
, _titDelimiter = Nothing
, _titEncoding = Nothing
}
titName :: Lens' TableImportTable Text
titName = lens _titName (\ s a -> s{_titName = a})
titDelimiter :: Lens' TableImportTable (Maybe Text)
titDelimiter
= lens _titDelimiter (\ s a -> s{_titDelimiter = a})
titEncoding :: Lens' TableImportTable (Maybe Text)
titEncoding
= lens _titEncoding (\ s a -> s{_titEncoding = a})
instance GoogleRequest TableImportTable where
type Rs TableImportTable = Table
type Scopes TableImportTable =
'["https://www.googleapis.com/auth/fusiontables"]
requestClient TableImportTable'{..}
= go (Just _titName) _titDelimiter _titEncoding
(Just AltJSON)
fusionTablesService
where go :<|> _
= buildClient
(Proxy :: Proxy TableImportTableResource)
mempty
instance GoogleRequest (MediaUpload TableImportTable)
where
type Rs (MediaUpload TableImportTable) = Table
type Scopes (MediaUpload TableImportTable) =
Scopes TableImportTable
requestClient
(MediaUpload TableImportTable'{..} body)
= go (Just _titName) _titDelimiter _titEncoding
(Just AltJSON)
(Just AltMedia)
body
fusionTablesService
where _ :<|> go
= buildClient
(Proxy :: Proxy TableImportTableResource)
mempty