{-# 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.ProFiles.Insert
(
ManagementProFilesInsertResource
, managementProFilesInsert
, ManagementProFilesInsert
, mpfiWebPropertyId
, mpfiPayload
, mpfiAccountId
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
type ManagementProFilesInsertResource =
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"webproperties" :>
Capture "webPropertyId" Text :>
"profiles" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ProFile :> Post '[JSON] ProFile
data ManagementProFilesInsert = ManagementProFilesInsert'
{ _mpfiWebPropertyId :: !Text
, _mpfiPayload :: !ProFile
, _mpfiAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
managementProFilesInsert
:: Text
-> ProFile
-> Text
-> ManagementProFilesInsert
managementProFilesInsert pMpfiWebPropertyId_ pMpfiPayload_ pMpfiAccountId_ =
ManagementProFilesInsert'
{ _mpfiWebPropertyId = pMpfiWebPropertyId_
, _mpfiPayload = pMpfiPayload_
, _mpfiAccountId = pMpfiAccountId_
}
mpfiWebPropertyId :: Lens' ManagementProFilesInsert Text
mpfiWebPropertyId
= lens _mpfiWebPropertyId
(\ s a -> s{_mpfiWebPropertyId = a})
mpfiPayload :: Lens' ManagementProFilesInsert ProFile
mpfiPayload
= lens _mpfiPayload (\ s a -> s{_mpfiPayload = a})
mpfiAccountId :: Lens' ManagementProFilesInsert Text
mpfiAccountId
= lens _mpfiAccountId
(\ s a -> s{_mpfiAccountId = a})
instance GoogleRequest ManagementProFilesInsert where
type Rs ManagementProFilesInsert = ProFile
type Scopes ManagementProFilesInsert =
'["https://www.googleapis.com/auth/analytics.edit"]
requestClient ManagementProFilesInsert'{..}
= go _mpfiAccountId _mpfiWebPropertyId (Just AltJSON)
_mpfiPayload
analyticsService
where go
= buildClient
(Proxy :: Proxy ManagementProFilesInsertResource)
mempty