{-# 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.Monitoring.Projects.AlertPolicies.Create
(
ProjectsAlertPoliciesCreateResource
, projectsAlertPoliciesCreate
, ProjectsAlertPoliciesCreate
, papcXgafv
, papcUploadProtocol
, papcAccessToken
, papcUploadType
, papcPayload
, papcName
, papcCallback
) where
import Network.Google.Monitoring.Types
import Network.Google.Prelude
type ProjectsAlertPoliciesCreateResource =
"v3" :>
Capture "name" Text :>
"alertPolicies" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] AlertPolicy :>
Post '[JSON] AlertPolicy
data ProjectsAlertPoliciesCreate = ProjectsAlertPoliciesCreate'
{ _papcXgafv :: !(Maybe Xgafv)
, _papcUploadProtocol :: !(Maybe Text)
, _papcAccessToken :: !(Maybe Text)
, _papcUploadType :: !(Maybe Text)
, _papcPayload :: !AlertPolicy
, _papcName :: !Text
, _papcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsAlertPoliciesCreate
:: AlertPolicy
-> Text
-> ProjectsAlertPoliciesCreate
projectsAlertPoliciesCreate pPapcPayload_ pPapcName_ =
ProjectsAlertPoliciesCreate'
{ _papcXgafv = Nothing
, _papcUploadProtocol = Nothing
, _papcAccessToken = Nothing
, _papcUploadType = Nothing
, _papcPayload = pPapcPayload_
, _papcName = pPapcName_
, _papcCallback = Nothing
}
papcXgafv :: Lens' ProjectsAlertPoliciesCreate (Maybe Xgafv)
papcXgafv
= lens _papcXgafv (\ s a -> s{_papcXgafv = a})
papcUploadProtocol :: Lens' ProjectsAlertPoliciesCreate (Maybe Text)
papcUploadProtocol
= lens _papcUploadProtocol
(\ s a -> s{_papcUploadProtocol = a})
papcAccessToken :: Lens' ProjectsAlertPoliciesCreate (Maybe Text)
papcAccessToken
= lens _papcAccessToken
(\ s a -> s{_papcAccessToken = a})
papcUploadType :: Lens' ProjectsAlertPoliciesCreate (Maybe Text)
papcUploadType
= lens _papcUploadType
(\ s a -> s{_papcUploadType = a})
papcPayload :: Lens' ProjectsAlertPoliciesCreate AlertPolicy
papcPayload
= lens _papcPayload (\ s a -> s{_papcPayload = a})
papcName :: Lens' ProjectsAlertPoliciesCreate Text
papcName = lens _papcName (\ s a -> s{_papcName = a})
papcCallback :: Lens' ProjectsAlertPoliciesCreate (Maybe Text)
papcCallback
= lens _papcCallback (\ s a -> s{_papcCallback = a})
instance GoogleRequest ProjectsAlertPoliciesCreate
where
type Rs ProjectsAlertPoliciesCreate = AlertPolicy
type Scopes ProjectsAlertPoliciesCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/monitoring"]
requestClient ProjectsAlertPoliciesCreate'{..}
= go _papcName _papcXgafv _papcUploadProtocol
_papcAccessToken
_papcUploadType
_papcCallback
(Just AltJSON)
_papcPayload
monitoringService
where go
= buildClient
(Proxy :: Proxy ProjectsAlertPoliciesCreateResource)
mempty