{-# 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.Projects.Sinks.Create
(
ProjectsSinksCreateResource
, projectsSinksCreate
, ProjectsSinksCreate
, pscParent
, pscXgafv
, pscUniqueWriterIdentity
, pscUploadProtocol
, pscAccessToken
, pscUploadType
, pscPayload
, pscCallback
) where
import Network.Google.Logging.Types
import Network.Google.Prelude
type ProjectsSinksCreateResource =
"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 ProjectsSinksCreate = ProjectsSinksCreate'
{ _pscParent :: !Text
, _pscXgafv :: !(Maybe Xgafv)
, _pscUniqueWriterIdentity :: !(Maybe Bool)
, _pscUploadProtocol :: !(Maybe Text)
, _pscAccessToken :: !(Maybe Text)
, _pscUploadType :: !(Maybe Text)
, _pscPayload :: !LogSink
, _pscCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsSinksCreate
:: Text
-> LogSink
-> ProjectsSinksCreate
projectsSinksCreate pPscParent_ pPscPayload_ =
ProjectsSinksCreate'
{ _pscParent = pPscParent_
, _pscXgafv = Nothing
, _pscUniqueWriterIdentity = Nothing
, _pscUploadProtocol = Nothing
, _pscAccessToken = Nothing
, _pscUploadType = Nothing
, _pscPayload = pPscPayload_
, _pscCallback = Nothing
}
pscParent :: Lens' ProjectsSinksCreate Text
pscParent
= lens _pscParent (\ s a -> s{_pscParent = a})
pscXgafv :: Lens' ProjectsSinksCreate (Maybe Xgafv)
pscXgafv = lens _pscXgafv (\ s a -> s{_pscXgafv = a})
pscUniqueWriterIdentity :: Lens' ProjectsSinksCreate (Maybe Bool)
pscUniqueWriterIdentity
= lens _pscUniqueWriterIdentity
(\ s a -> s{_pscUniqueWriterIdentity = a})
pscUploadProtocol :: Lens' ProjectsSinksCreate (Maybe Text)
pscUploadProtocol
= lens _pscUploadProtocol
(\ s a -> s{_pscUploadProtocol = a})
pscAccessToken :: Lens' ProjectsSinksCreate (Maybe Text)
pscAccessToken
= lens _pscAccessToken
(\ s a -> s{_pscAccessToken = a})
pscUploadType :: Lens' ProjectsSinksCreate (Maybe Text)
pscUploadType
= lens _pscUploadType
(\ s a -> s{_pscUploadType = a})
pscPayload :: Lens' ProjectsSinksCreate LogSink
pscPayload
= lens _pscPayload (\ s a -> s{_pscPayload = a})
pscCallback :: Lens' ProjectsSinksCreate (Maybe Text)
pscCallback
= lens _pscCallback (\ s a -> s{_pscCallback = a})
instance GoogleRequest ProjectsSinksCreate where
type Rs ProjectsSinksCreate = LogSink
type Scopes ProjectsSinksCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/logging.admin"]
requestClient ProjectsSinksCreate'{..}
= go _pscParent _pscXgafv _pscUniqueWriterIdentity
_pscUploadProtocol
_pscAccessToken
_pscUploadType
_pscCallback
(Just AltJSON)
_pscPayload
loggingService
where go
= buildClient
(Proxy :: Proxy ProjectsSinksCreateResource)
mempty