{-# 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.WebProperties.Insert
(
ManagementWebPropertiesInsertResource
, managementWebPropertiesInsert
, ManagementWebPropertiesInsert
, mwpiPayload
, mwpiAccountId
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
type ManagementWebPropertiesInsertResource =
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"webproperties" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] WebProperty :>
Post '[JSON] WebProperty
data ManagementWebPropertiesInsert = ManagementWebPropertiesInsert'
{ _mwpiPayload :: !WebProperty
, _mwpiAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
managementWebPropertiesInsert
:: WebProperty
-> Text
-> ManagementWebPropertiesInsert
managementWebPropertiesInsert pMwpiPayload_ pMwpiAccountId_ =
ManagementWebPropertiesInsert'
{ _mwpiPayload = pMwpiPayload_
, _mwpiAccountId = pMwpiAccountId_
}
mwpiPayload :: Lens' ManagementWebPropertiesInsert WebProperty
mwpiPayload
= lens _mwpiPayload (\ s a -> s{_mwpiPayload = a})
mwpiAccountId :: Lens' ManagementWebPropertiesInsert Text
mwpiAccountId
= lens _mwpiAccountId
(\ s a -> s{_mwpiAccountId = a})
instance GoogleRequest ManagementWebPropertiesInsert
where
type Rs ManagementWebPropertiesInsert = WebProperty
type Scopes ManagementWebPropertiesInsert =
'["https://www.googleapis.com/auth/analytics.edit"]
requestClient ManagementWebPropertiesInsert'{..}
= go _mwpiAccountId (Just AltJSON) _mwpiPayload
analyticsService
where go
= buildClient
(Proxy ::
Proxy ManagementWebPropertiesInsertResource)
mempty