{-# 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.PlacementStrategies.Insert
(
PlacementStrategiesInsertResource
, placementStrategiesInsert
, PlacementStrategiesInsert
, psiProFileId
, psiPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type PlacementStrategiesInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"placementStrategies" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] PlacementStrategy :>
Post '[JSON] PlacementStrategy
data PlacementStrategiesInsert = PlacementStrategiesInsert'
{ _psiProFileId :: !(Textual Int64)
, _psiPayload :: !PlacementStrategy
} deriving (Eq,Show,Data,Typeable,Generic)
placementStrategiesInsert
:: Int64
-> PlacementStrategy
-> PlacementStrategiesInsert
placementStrategiesInsert pPsiProFileId_ pPsiPayload_ =
PlacementStrategiesInsert'
{ _psiProFileId = _Coerce # pPsiProFileId_
, _psiPayload = pPsiPayload_
}
psiProFileId :: Lens' PlacementStrategiesInsert Int64
psiProFileId
= lens _psiProFileId (\ s a -> s{_psiProFileId = a})
. _Coerce
psiPayload :: Lens' PlacementStrategiesInsert PlacementStrategy
psiPayload
= lens _psiPayload (\ s a -> s{_psiPayload = a})
instance GoogleRequest PlacementStrategiesInsert
where
type Rs PlacementStrategiesInsert = PlacementStrategy
type Scopes PlacementStrategiesInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient PlacementStrategiesInsert'{..}
= go _psiProFileId (Just AltJSON) _psiPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy PlacementStrategiesInsertResource)
mempty