{-# 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.Query.SQLGet
(
QuerySQLGetResource
, querySQLGet
, QuerySQLGet
, qsqlgTyped
, qsqlgHdrs
, qsqlgSQL
) where
import Network.Google.FusionTables.Types
import Network.Google.Prelude
type QuerySQLGetResource =
"fusiontables" :>
"v2" :>
"query" :>
QueryParam "sql" Text :>
QueryParam "typed" Bool :>
QueryParam "hdrs" Bool :>
QueryParam "alt" AltJSON :> Get '[JSON] SQLresponse
:<|>
"fusiontables" :>
"v2" :>
"query" :>
QueryParam "sql" Text :>
QueryParam "typed" Bool :>
QueryParam "hdrs" Bool :>
QueryParam "alt" AltMedia :>
Get '[OctetStream] Stream
data QuerySQLGet = QuerySQLGet'
{ _qsqlgTyped :: !(Maybe Bool)
, _qsqlgHdrs :: !(Maybe Bool)
, _qsqlgSQL :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
querySQLGet
:: Text
-> QuerySQLGet
querySQLGet pQsqlgSQL_ =
QuerySQLGet'
{ _qsqlgTyped = Nothing
, _qsqlgHdrs = Nothing
, _qsqlgSQL = pQsqlgSQL_
}
qsqlgTyped :: Lens' QuerySQLGet (Maybe Bool)
qsqlgTyped
= lens _qsqlgTyped (\ s a -> s{_qsqlgTyped = a})
qsqlgHdrs :: Lens' QuerySQLGet (Maybe Bool)
qsqlgHdrs
= lens _qsqlgHdrs (\ s a -> s{_qsqlgHdrs = a})
qsqlgSQL :: Lens' QuerySQLGet Text
qsqlgSQL = lens _qsqlgSQL (\ s a -> s{_qsqlgSQL = a})
instance GoogleRequest QuerySQLGet where
type Rs QuerySQLGet = SQLresponse
type Scopes QuerySQLGet =
'["https://www.googleapis.com/auth/fusiontables",
"https://www.googleapis.com/auth/fusiontables.readonly"]
requestClient QuerySQLGet'{..}
= go (Just _qsqlgSQL) _qsqlgTyped _qsqlgHdrs
(Just AltJSON)
fusionTablesService
where go :<|> _
= buildClient (Proxy :: Proxy QuerySQLGetResource)
mempty
instance GoogleRequest (MediaDownload QuerySQLGet)
where
type Rs (MediaDownload QuerySQLGet) = Stream
type Scopes (MediaDownload QuerySQLGet) =
Scopes QuerySQLGet
requestClient (MediaDownload QuerySQLGet'{..})
= go (Just _qsqlgSQL) _qsqlgTyped _qsqlgHdrs
(Just AltMedia)
fusionTablesService
where _ :<|> go
= buildClient (Proxy :: Proxy QuerySQLGetResource)
mempty