{-# 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.Insert
(
ContentCategoriesInsertResource
, contentCategoriesInsert
, ContentCategoriesInsert
, cciProFileId
, cciPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type ContentCategoriesInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"contentCategories" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ContentCategory :>
Post '[JSON] ContentCategory
data ContentCategoriesInsert = ContentCategoriesInsert'
{ _cciProFileId :: !(Textual Int64)
, _cciPayload :: !ContentCategory
} deriving (Eq,Show,Data,Typeable,Generic)
contentCategoriesInsert
:: Int64
-> ContentCategory
-> ContentCategoriesInsert
contentCategoriesInsert pCciProFileId_ pCciPayload_ =
ContentCategoriesInsert'
{ _cciProFileId = _Coerce # pCciProFileId_
, _cciPayload = pCciPayload_
}
cciProFileId :: Lens' ContentCategoriesInsert Int64
cciProFileId
= lens _cciProFileId (\ s a -> s{_cciProFileId = a})
. _Coerce
cciPayload :: Lens' ContentCategoriesInsert ContentCategory
cciPayload
= lens _cciPayload (\ s a -> s{_cciPayload = a})
instance GoogleRequest ContentCategoriesInsert where
type Rs ContentCategoriesInsert = ContentCategory
type Scopes ContentCategoriesInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient ContentCategoriesInsert'{..}
= go _cciProFileId (Just AltJSON) _cciPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy ContentCategoriesInsertResource)
mempty