{-# 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.Logging.Folders.Sinks.Create
(
FoldersSinksCreateResource
, foldersSinksCreate
, FoldersSinksCreate
, fscParent
, fscXgafv
, fscUniqueWriterIdentity
, fscUploadProtocol
, fscAccessToken
, fscUploadType
, fscPayload
, fscCallback
) where
import Network.Google.Logging.Types
import Network.Google.Prelude
type FoldersSinksCreateResource =
"v2" :>
Capture "parent" Text :>
"sinks" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "uniqueWriterIdentity" Bool :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] LogSink :> Post '[JSON] LogSink
data FoldersSinksCreate = FoldersSinksCreate'
{ _fscParent :: !Text
, _fscXgafv :: !(Maybe Xgafv)
, _fscUniqueWriterIdentity :: !(Maybe Bool)
, _fscUploadProtocol :: !(Maybe Text)
, _fscAccessToken :: !(Maybe Text)
, _fscUploadType :: !(Maybe Text)
, _fscPayload :: !LogSink
, _fscCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
foldersSinksCreate
:: Text
-> LogSink
-> FoldersSinksCreate
foldersSinksCreate pFscParent_ pFscPayload_ =
FoldersSinksCreate'
{ _fscParent = pFscParent_
, _fscXgafv = Nothing
, _fscUniqueWriterIdentity = Nothing
, _fscUploadProtocol = Nothing
, _fscAccessToken = Nothing
, _fscUploadType = Nothing
, _fscPayload = pFscPayload_
, _fscCallback = Nothing
}
fscParent :: Lens' FoldersSinksCreate Text
fscParent
= lens _fscParent (\ s a -> s{_fscParent = a})
fscXgafv :: Lens' FoldersSinksCreate (Maybe Xgafv)
fscXgafv = lens _fscXgafv (\ s a -> s{_fscXgafv = a})
fscUniqueWriterIdentity :: Lens' FoldersSinksCreate (Maybe Bool)
fscUniqueWriterIdentity
= lens _fscUniqueWriterIdentity
(\ s a -> s{_fscUniqueWriterIdentity = a})
fscUploadProtocol :: Lens' FoldersSinksCreate (Maybe Text)
fscUploadProtocol
= lens _fscUploadProtocol
(\ s a -> s{_fscUploadProtocol = a})
fscAccessToken :: Lens' FoldersSinksCreate (Maybe Text)
fscAccessToken
= lens _fscAccessToken
(\ s a -> s{_fscAccessToken = a})
fscUploadType :: Lens' FoldersSinksCreate (Maybe Text)
fscUploadType
= lens _fscUploadType
(\ s a -> s{_fscUploadType = a})
fscPayload :: Lens' FoldersSinksCreate LogSink
fscPayload
= lens _fscPayload (\ s a -> s{_fscPayload = a})
fscCallback :: Lens' FoldersSinksCreate (Maybe Text)
fscCallback
= lens _fscCallback (\ s a -> s{_fscCallback = a})
instance GoogleRequest FoldersSinksCreate where
type Rs FoldersSinksCreate = LogSink
type Scopes FoldersSinksCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/logging.admin"]
requestClient FoldersSinksCreate'{..}
= go _fscParent _fscXgafv _fscUniqueWriterIdentity
_fscUploadProtocol
_fscAccessToken
_fscUploadType
_fscCallback
(Just AltJSON)
_fscPayload
loggingService
where go
= buildClient
(Proxy :: Proxy FoldersSinksCreateResource)
mempty