{-# 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.Template.Update
(
TemplateUpdateResource
, templateUpdate
, TemplateUpdate
, tuTemplateId
, tuPayload
, tuTableId
) where
import Network.Google.FusionTables.Types
import Network.Google.Prelude
type TemplateUpdateResource =
"fusiontables" :>
"v2" :>
"tables" :>
Capture "tableId" Text :>
"templates" :>
Capture "templateId" (Textual Int32) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Template :> Put '[JSON] Template
data TemplateUpdate = TemplateUpdate'
{ _tuTemplateId :: !(Textual Int32)
, _tuPayload :: !Template
, _tuTableId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
templateUpdate
:: Int32
-> Template
-> Text
-> TemplateUpdate
templateUpdate pTuTemplateId_ pTuPayload_ pTuTableId_ =
TemplateUpdate'
{ _tuTemplateId = _Coerce # pTuTemplateId_
, _tuPayload = pTuPayload_
, _tuTableId = pTuTableId_
}
tuTemplateId :: Lens' TemplateUpdate Int32
tuTemplateId
= lens _tuTemplateId (\ s a -> s{_tuTemplateId = a})
. _Coerce
tuPayload :: Lens' TemplateUpdate Template
tuPayload
= lens _tuPayload (\ s a -> s{_tuPayload = a})
tuTableId :: Lens' TemplateUpdate Text
tuTableId
= lens _tuTableId (\ s a -> s{_tuTableId = a})
instance GoogleRequest TemplateUpdate where
type Rs TemplateUpdate = Template
type Scopes TemplateUpdate =
'["https://www.googleapis.com/auth/fusiontables"]
requestClient TemplateUpdate'{..}
= go _tuTableId _tuTemplateId (Just AltJSON)
_tuPayload
fusionTablesService
where go
= buildClient (Proxy :: Proxy TemplateUpdateResource)
mempty