{-# 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.NotificationChannels.Create
(
ProjectsNotificationChannelsCreateResource
, projectsNotificationChannelsCreate
, ProjectsNotificationChannelsCreate
, pnccXgafv
, pnccUploadProtocol
, pnccAccessToken
, pnccUploadType
, pnccPayload
, pnccName
, pnccCallback
) where
import Network.Google.Monitoring.Types
import Network.Google.Prelude
type ProjectsNotificationChannelsCreateResource =
"v3" :>
Capture "name" Text :>
"notificationChannels" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] NotificationChannel :>
Post '[JSON] NotificationChannel
data ProjectsNotificationChannelsCreate = ProjectsNotificationChannelsCreate'
{ _pnccXgafv :: !(Maybe Xgafv)
, _pnccUploadProtocol :: !(Maybe Text)
, _pnccAccessToken :: !(Maybe Text)
, _pnccUploadType :: !(Maybe Text)
, _pnccPayload :: !NotificationChannel
, _pnccName :: !Text
, _pnccCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsNotificationChannelsCreate
:: NotificationChannel
-> Text
-> ProjectsNotificationChannelsCreate
projectsNotificationChannelsCreate pPnccPayload_ pPnccName_ =
ProjectsNotificationChannelsCreate'
{ _pnccXgafv = Nothing
, _pnccUploadProtocol = Nothing
, _pnccAccessToken = Nothing
, _pnccUploadType = Nothing
, _pnccPayload = pPnccPayload_
, _pnccName = pPnccName_
, _pnccCallback = Nothing
}
pnccXgafv :: Lens' ProjectsNotificationChannelsCreate (Maybe Xgafv)
pnccXgafv
= lens _pnccXgafv (\ s a -> s{_pnccXgafv = a})
pnccUploadProtocol :: Lens' ProjectsNotificationChannelsCreate (Maybe Text)
pnccUploadProtocol
= lens _pnccUploadProtocol
(\ s a -> s{_pnccUploadProtocol = a})
pnccAccessToken :: Lens' ProjectsNotificationChannelsCreate (Maybe Text)
pnccAccessToken
= lens _pnccAccessToken
(\ s a -> s{_pnccAccessToken = a})
pnccUploadType :: Lens' ProjectsNotificationChannelsCreate (Maybe Text)
pnccUploadType
= lens _pnccUploadType
(\ s a -> s{_pnccUploadType = a})
pnccPayload :: Lens' ProjectsNotificationChannelsCreate NotificationChannel
pnccPayload
= lens _pnccPayload (\ s a -> s{_pnccPayload = a})
pnccName :: Lens' ProjectsNotificationChannelsCreate Text
pnccName = lens _pnccName (\ s a -> s{_pnccName = a})
pnccCallback :: Lens' ProjectsNotificationChannelsCreate (Maybe Text)
pnccCallback
= lens _pnccCallback (\ s a -> s{_pnccCallback = a})
instance GoogleRequest
ProjectsNotificationChannelsCreate where
type Rs ProjectsNotificationChannelsCreate =
NotificationChannel
type Scopes ProjectsNotificationChannelsCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/monitoring"]
requestClient ProjectsNotificationChannelsCreate'{..}
= go _pnccName _pnccXgafv _pnccUploadProtocol
_pnccAccessToken
_pnccUploadType
_pnccCallback
(Just AltJSON)
_pnccPayload
monitoringService
where go
= buildClient
(Proxy ::
Proxy ProjectsNotificationChannelsCreateResource)
mempty