{-# 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.BigQuery.DataSets.Insert
(
DataSetsInsertResource
, dataSetsInsert
, DataSetsInsert
, dsiPayload
, dsiProjectId
) where
import Network.Google.BigQuery.Types
import Network.Google.Prelude
type DataSetsInsertResource =
"bigquery" :>
"v2" :>
"projects" :>
Capture "projectId" Text :>
"datasets" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] DataSet :> Post '[JSON] DataSet
data DataSetsInsert = DataSetsInsert'
{ _dsiPayload :: !DataSet
, _dsiProjectId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
dataSetsInsert
:: DataSet
-> Text
-> DataSetsInsert
dataSetsInsert pDsiPayload_ pDsiProjectId_ =
DataSetsInsert'
{ _dsiPayload = pDsiPayload_
, _dsiProjectId = pDsiProjectId_
}
dsiPayload :: Lens' DataSetsInsert DataSet
dsiPayload
= lens _dsiPayload (\ s a -> s{_dsiPayload = a})
dsiProjectId :: Lens' DataSetsInsert Text
dsiProjectId
= lens _dsiProjectId (\ s a -> s{_dsiProjectId = a})
instance GoogleRequest DataSetsInsert where
type Rs DataSetsInsert = DataSet
type Scopes DataSetsInsert =
'["https://www.googleapis.com/auth/bigquery",
"https://www.googleapis.com/auth/cloud-platform"]
requestClient DataSetsInsert'{..}
= go _dsiProjectId (Just AltJSON) _dsiPayload
bigQueryService
where go
= buildClient (Proxy :: Proxy DataSetsInsertResource)
mempty