{-# 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.Uploads.UploadData
(
ManagementUploadsUploadDataResource
, managementUploadsUploadData
, ManagementUploadsUploadData
, muudWebPropertyId
, muudCustomDataSourceId
, muudAccountId
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
type ManagementUploadsUploadDataResource =
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"webproperties" :>
Capture "webPropertyId" Text :>
"customDataSources" :>
Capture "customDataSourceId" Text :>
"uploads" :>
QueryParam "alt" AltJSON :> Post '[JSON] Upload
:<|>
"upload" :>
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"webproperties" :>
Capture "webPropertyId" Text :>
"customDataSources" :>
Capture "customDataSourceId" Text :>
"uploads" :>
QueryParam "alt" AltJSON :>
QueryParam "uploadType" AltMedia :>
AltMedia :> Post '[JSON] Upload
data ManagementUploadsUploadData = ManagementUploadsUploadData'
{ _muudWebPropertyId :: !Text
, _muudCustomDataSourceId :: !Text
, _muudAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
managementUploadsUploadData
:: Text
-> Text
-> Text
-> ManagementUploadsUploadData
managementUploadsUploadData pMuudWebPropertyId_ pMuudCustomDataSourceId_ pMuudAccountId_ =
ManagementUploadsUploadData'
{ _muudWebPropertyId = pMuudWebPropertyId_
, _muudCustomDataSourceId = pMuudCustomDataSourceId_
, _muudAccountId = pMuudAccountId_
}
muudWebPropertyId :: Lens' ManagementUploadsUploadData Text
muudWebPropertyId
= lens _muudWebPropertyId
(\ s a -> s{_muudWebPropertyId = a})
muudCustomDataSourceId :: Lens' ManagementUploadsUploadData Text
muudCustomDataSourceId
= lens _muudCustomDataSourceId
(\ s a -> s{_muudCustomDataSourceId = a})
muudAccountId :: Lens' ManagementUploadsUploadData Text
muudAccountId
= lens _muudAccountId
(\ s a -> s{_muudAccountId = a})
instance GoogleRequest ManagementUploadsUploadData
where
type Rs ManagementUploadsUploadData = Upload
type Scopes ManagementUploadsUploadData =
'["https://www.googleapis.com/auth/analytics",
"https://www.googleapis.com/auth/analytics.edit"]
requestClient ManagementUploadsUploadData'{..}
= go _muudAccountId _muudWebPropertyId
_muudCustomDataSourceId
(Just AltJSON)
analyticsService
where go :<|> _
= buildClient
(Proxy :: Proxy ManagementUploadsUploadDataResource)
mempty
instance GoogleRequest
(MediaUpload ManagementUploadsUploadData) where
type Rs (MediaUpload ManagementUploadsUploadData) =
Upload
type Scopes (MediaUpload ManagementUploadsUploadData)
= Scopes ManagementUploadsUploadData
requestClient
(MediaUpload ManagementUploadsUploadData'{..} body)
= go _muudAccountId _muudWebPropertyId
_muudCustomDataSourceId
(Just AltJSON)
(Just AltMedia)
body
analyticsService
where _ :<|> go
= buildClient
(Proxy :: Proxy ManagementUploadsUploadDataResource)
mempty