{-# 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.DFAReporting.Sites.Insert
(
SitesInsertResource
, sitesInsert
, SitesInsert
, sProFileId
, sPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type SitesInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"sites" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Site :> Post '[JSON] Site
data SitesInsert = SitesInsert'
{ _sProFileId :: !(Textual Int64)
, _sPayload :: !Site
} deriving (Eq,Show,Data,Typeable,Generic)
sitesInsert
:: Int64
-> Site
-> SitesInsert
sitesInsert pSProFileId_ pSPayload_ =
SitesInsert'
{ _sProFileId = _Coerce # pSProFileId_
, _sPayload = pSPayload_
}
sProFileId :: Lens' SitesInsert Int64
sProFileId
= lens _sProFileId (\ s a -> s{_sProFileId = a}) .
_Coerce
sPayload :: Lens' SitesInsert Site
sPayload = lens _sPayload (\ s a -> s{_sPayload = a})
instance GoogleRequest SitesInsert where
type Rs SitesInsert = Site
type Scopes SitesInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient SitesInsert'{..}
= go _sProFileId (Just AltJSON) _sPayload
dFAReportingService
where go
= buildClient (Proxy :: Proxy SitesInsertResource)
mempty