{-# 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.Organizations.Sinks.Create
(
OrganizationsSinksCreateResource
, organizationsSinksCreate
, OrganizationsSinksCreate
, oscParent
, oscXgafv
, oscUniqueWriterIdentity
, oscUploadProtocol
, oscAccessToken
, oscUploadType
, oscPayload
, oscCallback
) where
import Network.Google.Logging.Types
import Network.Google.Prelude
type OrganizationsSinksCreateResource =
"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 OrganizationsSinksCreate = OrganizationsSinksCreate'
{ _oscParent :: !Text
, _oscXgafv :: !(Maybe Xgafv)
, _oscUniqueWriterIdentity :: !(Maybe Bool)
, _oscUploadProtocol :: !(Maybe Text)
, _oscAccessToken :: !(Maybe Text)
, _oscUploadType :: !(Maybe Text)
, _oscPayload :: !LogSink
, _oscCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
organizationsSinksCreate
:: Text
-> LogSink
-> OrganizationsSinksCreate
organizationsSinksCreate pOscParent_ pOscPayload_ =
OrganizationsSinksCreate'
{ _oscParent = pOscParent_
, _oscXgafv = Nothing
, _oscUniqueWriterIdentity = Nothing
, _oscUploadProtocol = Nothing
, _oscAccessToken = Nothing
, _oscUploadType = Nothing
, _oscPayload = pOscPayload_
, _oscCallback = Nothing
}
oscParent :: Lens' OrganizationsSinksCreate Text
oscParent
= lens _oscParent (\ s a -> s{_oscParent = a})
oscXgafv :: Lens' OrganizationsSinksCreate (Maybe Xgafv)
oscXgafv = lens _oscXgafv (\ s a -> s{_oscXgafv = a})
oscUniqueWriterIdentity :: Lens' OrganizationsSinksCreate (Maybe Bool)
oscUniqueWriterIdentity
= lens _oscUniqueWriterIdentity
(\ s a -> s{_oscUniqueWriterIdentity = a})
oscUploadProtocol :: Lens' OrganizationsSinksCreate (Maybe Text)
oscUploadProtocol
= lens _oscUploadProtocol
(\ s a -> s{_oscUploadProtocol = a})
oscAccessToken :: Lens' OrganizationsSinksCreate (Maybe Text)
oscAccessToken
= lens _oscAccessToken
(\ s a -> s{_oscAccessToken = a})
oscUploadType :: Lens' OrganizationsSinksCreate (Maybe Text)
oscUploadType
= lens _oscUploadType
(\ s a -> s{_oscUploadType = a})
oscPayload :: Lens' OrganizationsSinksCreate LogSink
oscPayload
= lens _oscPayload (\ s a -> s{_oscPayload = a})
oscCallback :: Lens' OrganizationsSinksCreate (Maybe Text)
oscCallback
= lens _oscCallback (\ s a -> s{_oscCallback = a})
instance GoogleRequest OrganizationsSinksCreate where
type Rs OrganizationsSinksCreate = LogSink
type Scopes OrganizationsSinksCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/logging.admin"]
requestClient OrganizationsSinksCreate'{..}
= go _oscParent _oscXgafv _oscUniqueWriterIdentity
_oscUploadProtocol
_oscAccessToken
_oscUploadType
_oscCallback
(Just AltJSON)
_oscPayload
loggingService
where go
= buildClient
(Proxy :: Proxy OrganizationsSinksCreateResource)
mempty