{-# 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.Analytics.Management.Filters.Insert
(
ManagementFiltersInsertResource
, managementFiltersInsert
, ManagementFiltersInsert
, mfiPayload
, mfiAccountId
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
type ManagementFiltersInsertResource =
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"filters" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Filter :> Post '[JSON] Filter
data ManagementFiltersInsert = ManagementFiltersInsert'
{ _mfiPayload :: !Filter
, _mfiAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
managementFiltersInsert
:: Filter
-> Text
-> ManagementFiltersInsert
managementFiltersInsert pMfiPayload_ pMfiAccountId_ =
ManagementFiltersInsert'
{ _mfiPayload = pMfiPayload_
, _mfiAccountId = pMfiAccountId_
}
mfiPayload :: Lens' ManagementFiltersInsert Filter
mfiPayload
= lens _mfiPayload (\ s a -> s{_mfiPayload = a})
mfiAccountId :: Lens' ManagementFiltersInsert Text
mfiAccountId
= lens _mfiAccountId (\ s a -> s{_mfiAccountId = a})
instance GoogleRequest ManagementFiltersInsert where
type Rs ManagementFiltersInsert = Filter
type Scopes ManagementFiltersInsert =
'["https://www.googleapis.com/auth/analytics.edit"]
requestClient ManagementFiltersInsert'{..}
= go _mfiAccountId (Just AltJSON) _mfiPayload
analyticsService
where go
= buildClient
(Proxy :: Proxy ManagementFiltersInsertResource)
mempty