{-# 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.CustomDimensions.Patch
(
ManagementCustomDimensionsPatchResource
, managementCustomDimensionsPatch
, ManagementCustomDimensionsPatch
, mcdpWebPropertyId
, mcdpIgnoreCustomDataSourceLinks
, mcdpPayload
, mcdpAccountId
, mcdpCustomDimensionId
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
type ManagementCustomDimensionsPatchResource =
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"webproperties" :>
Capture "webPropertyId" Text :>
"customDimensions" :>
Capture "customDimensionId" Text :>
QueryParam "ignoreCustomDataSourceLinks" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CustomDimension :>
Patch '[JSON] CustomDimension
-- | Updates an existing custom dimension. This method supports patch
-- semantics.
--
-- /See:/ 'managementCustomDimensionsPatch' smart constructor.
data ManagementCustomDimensionsPatch = ManagementCustomDimensionsPatch'
{ _mcdpWebPropertyId :: !Text
, _mcdpIgnoreCustomDataSourceLinks :: !Bool
, _mcdpPayload :: !CustomDimension
, _mcdpAccountId :: !Text
, _mcdpCustomDimensionId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'ManagementCustomDimensionsPatch' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mcdpWebPropertyId'
--
-- * 'mcdpIgnoreCustomDataSourceLinks'
--
-- * 'mcdpPayload'
--
-- * 'mcdpAccountId'
--
-- * 'mcdpCustomDimensionId'
managementCustomDimensionsPatch
:: Text -- ^ 'mcdpWebPropertyId'
-> CustomDimension -- ^ 'mcdpPayload'
-> Text -- ^ 'mcdpAccountId'
-> Text -- ^ 'mcdpCustomDimensionId'
-> ManagementCustomDimensionsPatch
managementCustomDimensionsPatch pMcdpWebPropertyId_ pMcdpPayload_ pMcdpAccountId_ pMcdpCustomDimensionId_ =
ManagementCustomDimensionsPatch'
{ _mcdpWebPropertyId = pMcdpWebPropertyId_
, _mcdpIgnoreCustomDataSourceLinks = False
, _mcdpPayload = pMcdpPayload_
, _mcdpAccountId = pMcdpAccountId_
, _mcdpCustomDimensionId = pMcdpCustomDimensionId_
}
-- | Web property ID for the custom dimension to update.
mcdpWebPropertyId :: Lens' ManagementCustomDimensionsPatch Text
mcdpWebPropertyId
= lens _mcdpWebPropertyId
(\ s a -> s{_mcdpWebPropertyId = a})
-- | Force the update and ignore any warnings related to the custom dimension
-- being linked to a custom data source \/ data set.
mcdpIgnoreCustomDataSourceLinks :: Lens' ManagementCustomDimensionsPatch Bool
mcdpIgnoreCustomDataSourceLinks
= lens _mcdpIgnoreCustomDataSourceLinks
(\ s a -> s{_mcdpIgnoreCustomDataSourceLinks = a})
-- | Multipart request metadata.
mcdpPayload :: Lens' ManagementCustomDimensionsPatch CustomDimension
mcdpPayload
= lens _mcdpPayload (\ s a -> s{_mcdpPayload = a})
-- | Account ID for the custom dimension to update.
mcdpAccountId :: Lens' ManagementCustomDimensionsPatch Text
mcdpAccountId
= lens _mcdpAccountId
(\ s a -> s{_mcdpAccountId = a})
-- | Custom dimension ID for the custom dimension to update.
mcdpCustomDimensionId :: Lens' ManagementCustomDimensionsPatch Text
mcdpCustomDimensionId
= lens _mcdpCustomDimensionId
(\ s a -> s{_mcdpCustomDimensionId = a})
instance GoogleRequest
ManagementCustomDimensionsPatch where
type Rs ManagementCustomDimensionsPatch =
CustomDimension
type Scopes ManagementCustomDimensionsPatch =
'["https://www.googleapis.com/auth/analytics.edit"]
requestClient ManagementCustomDimensionsPatch'{..}
= go _mcdpAccountId _mcdpWebPropertyId
_mcdpCustomDimensionId
(Just _mcdpIgnoreCustomDataSourceLinks)
(Just AltJSON)
_mcdpPayload
analyticsService
where go
= buildClient
(Proxy ::
Proxy ManagementCustomDimensionsPatchResource)
mempty