{-# 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.ContentCategories.Patch
(
ContentCategoriesPatchResource
, contentCategoriesPatch
, ContentCategoriesPatch
, ccpProFileId
, ccpPayload
, ccpId
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type ContentCategoriesPatchResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"contentCategories" :>
QueryParam "id" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ContentCategory :>
Patch '[JSON] ContentCategory
data ContentCategoriesPatch = ContentCategoriesPatch'
{ _ccpProFileId :: !(Textual Int64)
, _ccpPayload :: !ContentCategory
, _ccpId :: !(Textual Int64)
} deriving (Eq,Show,Data,Typeable,Generic)
contentCategoriesPatch
:: Int64
-> ContentCategory
-> Int64
-> ContentCategoriesPatch
contentCategoriesPatch pCcpProFileId_ pCcpPayload_ pCcpId_ =
ContentCategoriesPatch'
{ _ccpProFileId = _Coerce # pCcpProFileId_
, _ccpPayload = pCcpPayload_
, _ccpId = _Coerce # pCcpId_
}
ccpProFileId :: Lens' ContentCategoriesPatch Int64
ccpProFileId
= lens _ccpProFileId (\ s a -> s{_ccpProFileId = a})
. _Coerce
ccpPayload :: Lens' ContentCategoriesPatch ContentCategory
ccpPayload
= lens _ccpPayload (\ s a -> s{_ccpPayload = a})
ccpId :: Lens' ContentCategoriesPatch Int64
ccpId
= lens _ccpId (\ s a -> s{_ccpId = a}) . _Coerce
instance GoogleRequest ContentCategoriesPatch where
type Rs ContentCategoriesPatch = ContentCategory
type Scopes ContentCategoriesPatch =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient ContentCategoriesPatch'{..}
= go _ccpProFileId (Just _ccpId) (Just AltJSON)
_ccpPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy ContentCategoriesPatchResource)
mempty