{-# 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.Sinks.Create
(
SinksCreateResource
, sinksCreate
, SinksCreate
, scParent
, scXgafv
, scUniqueWriterIdentity
, scUploadProtocol
, scAccessToken
, scUploadType
, scPayload
, scCallback
) where
import Network.Google.Logging.Types
import Network.Google.Prelude
type SinksCreateResource =
"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 SinksCreate = SinksCreate'
{ _scParent :: !Text
, _scXgafv :: !(Maybe Xgafv)
, _scUniqueWriterIdentity :: !(Maybe Bool)
, _scUploadProtocol :: !(Maybe Text)
, _scAccessToken :: !(Maybe Text)
, _scUploadType :: !(Maybe Text)
, _scPayload :: !LogSink
, _scCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
sinksCreate
:: Text
-> LogSink
-> SinksCreate
sinksCreate pScParent_ pScPayload_ =
SinksCreate'
{ _scParent = pScParent_
, _scXgafv = Nothing
, _scUniqueWriterIdentity = Nothing
, _scUploadProtocol = Nothing
, _scAccessToken = Nothing
, _scUploadType = Nothing
, _scPayload = pScPayload_
, _scCallback = Nothing
}
scParent :: Lens' SinksCreate Text
scParent = lens _scParent (\ s a -> s{_scParent = a})
scXgafv :: Lens' SinksCreate (Maybe Xgafv)
scXgafv = lens _scXgafv (\ s a -> s{_scXgafv = a})
scUniqueWriterIdentity :: Lens' SinksCreate (Maybe Bool)
scUniqueWriterIdentity
= lens _scUniqueWriterIdentity
(\ s a -> s{_scUniqueWriterIdentity = a})
scUploadProtocol :: Lens' SinksCreate (Maybe Text)
scUploadProtocol
= lens _scUploadProtocol
(\ s a -> s{_scUploadProtocol = a})
scAccessToken :: Lens' SinksCreate (Maybe Text)
scAccessToken
= lens _scAccessToken
(\ s a -> s{_scAccessToken = a})
scUploadType :: Lens' SinksCreate (Maybe Text)
scUploadType
= lens _scUploadType (\ s a -> s{_scUploadType = a})
scPayload :: Lens' SinksCreate LogSink
scPayload
= lens _scPayload (\ s a -> s{_scPayload = a})
scCallback :: Lens' SinksCreate (Maybe Text)
scCallback
= lens _scCallback (\ s a -> s{_scCallback = a})
instance GoogleRequest SinksCreate where
type Rs SinksCreate = LogSink
type Scopes SinksCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/logging.admin"]
requestClient SinksCreate'{..}
= go _scParent _scXgafv _scUniqueWriterIdentity
_scUploadProtocol
_scAccessToken
_scUploadType
_scCallback
(Just AltJSON)
_scPayload
loggingService
where go
= buildClient (Proxy :: Proxy SinksCreateResource)
mempty