{-# 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.PlacementGroups.Patch
(
PlacementGroupsPatchResource
, placementGroupsPatch
, PlacementGroupsPatch
, pgpProFileId
, pgpPayload
, pgpId
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type PlacementGroupsPatchResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"placementGroups" :>
QueryParam "id" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] PlacementGroup :>
Patch '[JSON] PlacementGroup
data PlacementGroupsPatch = PlacementGroupsPatch'
{ _pgpProFileId :: !(Textual Int64)
, _pgpPayload :: !PlacementGroup
, _pgpId :: !(Textual Int64)
} deriving (Eq,Show,Data,Typeable,Generic)
placementGroupsPatch
:: Int64
-> PlacementGroup
-> Int64
-> PlacementGroupsPatch
placementGroupsPatch pPgpProFileId_ pPgpPayload_ pPgpId_ =
PlacementGroupsPatch'
{ _pgpProFileId = _Coerce # pPgpProFileId_
, _pgpPayload = pPgpPayload_
, _pgpId = _Coerce # pPgpId_
}
pgpProFileId :: Lens' PlacementGroupsPatch Int64
pgpProFileId
= lens _pgpProFileId (\ s a -> s{_pgpProFileId = a})
. _Coerce
pgpPayload :: Lens' PlacementGroupsPatch PlacementGroup
pgpPayload
= lens _pgpPayload (\ s a -> s{_pgpPayload = a})
pgpId :: Lens' PlacementGroupsPatch Int64
pgpId
= lens _pgpId (\ s a -> s{_pgpId = a}) . _Coerce
instance GoogleRequest PlacementGroupsPatch where
type Rs PlacementGroupsPatch = PlacementGroup
type Scopes PlacementGroupsPatch =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient PlacementGroupsPatch'{..}
= go _pgpProFileId (Just _pgpId) (Just AltJSON)
_pgpPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy PlacementGroupsPatchResource)
mempty