{-# 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.BillingAccounts.Sinks.Create
(
BillingAccountsSinksCreateResource
, billingAccountsSinksCreate
, BillingAccountsSinksCreate
, bascParent
, bascXgafv
, bascUniqueWriterIdentity
, bascUploadProtocol
, bascAccessToken
, bascUploadType
, bascPayload
, bascCallback
) where
import Network.Google.Logging.Types
import Network.Google.Prelude
type BillingAccountsSinksCreateResource =
"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 BillingAccountsSinksCreate = BillingAccountsSinksCreate'
{ _bascParent :: !Text
, _bascXgafv :: !(Maybe Xgafv)
, _bascUniqueWriterIdentity :: !(Maybe Bool)
, _bascUploadProtocol :: !(Maybe Text)
, _bascAccessToken :: !(Maybe Text)
, _bascUploadType :: !(Maybe Text)
, _bascPayload :: !LogSink
, _bascCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
billingAccountsSinksCreate
:: Text
-> LogSink
-> BillingAccountsSinksCreate
billingAccountsSinksCreate pBascParent_ pBascPayload_ =
BillingAccountsSinksCreate'
{ _bascParent = pBascParent_
, _bascXgafv = Nothing
, _bascUniqueWriterIdentity = Nothing
, _bascUploadProtocol = Nothing
, _bascAccessToken = Nothing
, _bascUploadType = Nothing
, _bascPayload = pBascPayload_
, _bascCallback = Nothing
}
bascParent :: Lens' BillingAccountsSinksCreate Text
bascParent
= lens _bascParent (\ s a -> s{_bascParent = a})
bascXgafv :: Lens' BillingAccountsSinksCreate (Maybe Xgafv)
bascXgafv
= lens _bascXgafv (\ s a -> s{_bascXgafv = a})
bascUniqueWriterIdentity :: Lens' BillingAccountsSinksCreate (Maybe Bool)
bascUniqueWriterIdentity
= lens _bascUniqueWriterIdentity
(\ s a -> s{_bascUniqueWriterIdentity = a})
bascUploadProtocol :: Lens' BillingAccountsSinksCreate (Maybe Text)
bascUploadProtocol
= lens _bascUploadProtocol
(\ s a -> s{_bascUploadProtocol = a})
bascAccessToken :: Lens' BillingAccountsSinksCreate (Maybe Text)
bascAccessToken
= lens _bascAccessToken
(\ s a -> s{_bascAccessToken = a})
bascUploadType :: Lens' BillingAccountsSinksCreate (Maybe Text)
bascUploadType
= lens _bascUploadType
(\ s a -> s{_bascUploadType = a})
bascPayload :: Lens' BillingAccountsSinksCreate LogSink
bascPayload
= lens _bascPayload (\ s a -> s{_bascPayload = a})
bascCallback :: Lens' BillingAccountsSinksCreate (Maybe Text)
bascCallback
= lens _bascCallback (\ s a -> s{_bascCallback = a})
instance GoogleRequest BillingAccountsSinksCreate
where
type Rs BillingAccountsSinksCreate = LogSink
type Scopes BillingAccountsSinksCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/logging.admin"]
requestClient BillingAccountsSinksCreate'{..}
= go _bascParent _bascXgafv _bascUniqueWriterIdentity
_bascUploadProtocol
_bascAccessToken
_bascUploadType
_bascCallback
(Just AltJSON)
_bascPayload
loggingService
where go
= buildClient
(Proxy :: Proxy BillingAccountsSinksCreateResource)
mempty