{-# 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.Get
(
ManagementProFilesGetResource
, managementProFilesGet
, ManagementProFilesGet
, mpfgWebPropertyId
, mpfgProFileId
, mpfgAccountId
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
type ManagementProFilesGetResource =
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"webproperties" :>
Capture "webPropertyId" Text :>
"profiles" :>
Capture "profileId" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] ProFile
-- | Gets a view (profile) to which the user has access.
--
-- /See:/ 'managementProFilesGet' smart constructor.
data ManagementProFilesGet = ManagementProFilesGet'
{ _mpfgWebPropertyId :: !Text
, _mpfgProFileId :: !Text
, _mpfgAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'ManagementProFilesGet' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mpfgWebPropertyId'
--
-- * 'mpfgProFileId'
--
-- * 'mpfgAccountId'
managementProFilesGet
:: Text -- ^ 'mpfgWebPropertyId'
-> Text -- ^ 'mpfgProFileId'
-> Text -- ^ 'mpfgAccountId'
-> ManagementProFilesGet
managementProFilesGet pMpfgWebPropertyId_ pMpfgProFileId_ pMpfgAccountId_ =
ManagementProFilesGet'
{ _mpfgWebPropertyId = pMpfgWebPropertyId_
, _mpfgProFileId = pMpfgProFileId_
, _mpfgAccountId = pMpfgAccountId_
}
-- | Web property ID to retrieve the view (profile) for.
mpfgWebPropertyId :: Lens' ManagementProFilesGet Text
mpfgWebPropertyId
= lens _mpfgWebPropertyId
(\ s a -> s{_mpfgWebPropertyId = a})
-- | View (Profile) ID to retrieve the view (profile) for.
mpfgProFileId :: Lens' ManagementProFilesGet Text
mpfgProFileId
= lens _mpfgProFileId
(\ s a -> s{_mpfgProFileId = a})
-- | Account ID to retrieve the view (profile) for.
mpfgAccountId :: Lens' ManagementProFilesGet Text
mpfgAccountId
= lens _mpfgAccountId
(\ s a -> s{_mpfgAccountId = a})
instance GoogleRequest ManagementProFilesGet where
type Rs ManagementProFilesGet = ProFile
type Scopes ManagementProFilesGet =
'["https://www.googleapis.com/auth/analytics.edit",
"https://www.googleapis.com/auth/analytics.readonly"]
requestClient ManagementProFilesGet'{..}
= go _mpfgAccountId _mpfgWebPropertyId _mpfgProFileId
(Just AltJSON)
analyticsService
where go
= buildClient
(Proxy :: Proxy ManagementProFilesGetResource)
mempty