{-# 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.SQL
(
QuerySQLResource
, querySQL
, QuerySQL
, qsqlTyped
, qsqlHdrs
, qsqlSQL
) where
import Network.Google.FusionTables.Types
import Network.Google.Prelude
type QuerySQLResource =
"fusiontables" :>
"v2" :>
"query" :>
QueryParam "sql" Text :>
QueryParam "typed" Bool :>
QueryParam "hdrs" Bool :>
QueryParam "alt" AltJSON :> Post '[JSON] SQLresponse
:<|>
"fusiontables" :>
"v2" :>
"query" :>
QueryParam "sql" Text :>
QueryParam "typed" Bool :>
QueryParam "hdrs" Bool :>
QueryParam "alt" AltMedia :>
Post '[OctetStream] Stream
data QuerySQL = QuerySQL'
{ _qsqlTyped :: !(Maybe Bool)
, _qsqlHdrs :: !(Maybe Bool)
, _qsqlSQL :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
querySQL
:: Text
-> QuerySQL
querySQL pQsqlSQL_ =
QuerySQL'
{ _qsqlTyped = Nothing
, _qsqlHdrs = Nothing
, _qsqlSQL = pQsqlSQL_
}
qsqlTyped :: Lens' QuerySQL (Maybe Bool)
qsqlTyped
= lens _qsqlTyped (\ s a -> s{_qsqlTyped = a})
qsqlHdrs :: Lens' QuerySQL (Maybe Bool)
qsqlHdrs = lens _qsqlHdrs (\ s a -> s{_qsqlHdrs = a})
qsqlSQL :: Lens' QuerySQL Text
qsqlSQL = lens _qsqlSQL (\ s a -> s{_qsqlSQL = a})
instance GoogleRequest QuerySQL where
type Rs QuerySQL = SQLresponse
type Scopes QuerySQL =
'["https://www.googleapis.com/auth/fusiontables",
"https://www.googleapis.com/auth/fusiontables.readonly"]
requestClient QuerySQL'{..}
= go (Just _qsqlSQL) _qsqlTyped _qsqlHdrs
(Just AltJSON)
fusionTablesService
where go :<|> _
= buildClient (Proxy :: Proxy QuerySQLResource)
mempty
instance GoogleRequest (MediaDownload QuerySQL) where
type Rs (MediaDownload QuerySQL) = Stream
type Scopes (MediaDownload QuerySQL) =
Scopes QuerySQL
requestClient (MediaDownload QuerySQL'{..})
= go (Just _qsqlSQL) _qsqlTyped _qsqlHdrs
(Just AltMedia)
fusionTablesService
where _ :<|> go
= buildClient (Proxy :: Proxy QuerySQLResource)
mempty