{-# 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.CreativeGroups.Patch
(
CreativeGroupsPatchResource
, creativeGroupsPatch
, CreativeGroupsPatch
, cgpProFileId
, cgpPayload
, cgpId
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type CreativeGroupsPatchResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"creativeGroups" :>
QueryParam "id" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CreativeGroup :>
Patch '[JSON] CreativeGroup
data CreativeGroupsPatch = CreativeGroupsPatch'
{ _cgpProFileId :: !(Textual Int64)
, _cgpPayload :: !CreativeGroup
, _cgpId :: !(Textual Int64)
} deriving (Eq,Show,Data,Typeable,Generic)
creativeGroupsPatch
:: Int64
-> CreativeGroup
-> Int64
-> CreativeGroupsPatch
creativeGroupsPatch pCgpProFileId_ pCgpPayload_ pCgpId_ =
CreativeGroupsPatch'
{ _cgpProFileId = _Coerce # pCgpProFileId_
, _cgpPayload = pCgpPayload_
, _cgpId = _Coerce # pCgpId_
}
cgpProFileId :: Lens' CreativeGroupsPatch Int64
cgpProFileId
= lens _cgpProFileId (\ s a -> s{_cgpProFileId = a})
. _Coerce
cgpPayload :: Lens' CreativeGroupsPatch CreativeGroup
cgpPayload
= lens _cgpPayload (\ s a -> s{_cgpPayload = a})
cgpId :: Lens' CreativeGroupsPatch Int64
cgpId
= lens _cgpId (\ s a -> s{_cgpId = a}) . _Coerce
instance GoogleRequest CreativeGroupsPatch where
type Rs CreativeGroupsPatch = CreativeGroup
type Scopes CreativeGroupsPatch =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient CreativeGroupsPatch'{..}
= go _cgpProFileId (Just _cgpId) (Just AltJSON)
_cgpPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy CreativeGroupsPatchResource)
mempty