{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.FMS.PutNotificationChannel
(
putNotificationChannel
, PutNotificationChannel
, pncSNSTopicARN
, pncSNSRoleName
, putNotificationChannelResponse
, PutNotificationChannelResponse
) where
import Network.AWS.FMS.Types
import Network.AWS.FMS.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data PutNotificationChannel = PutNotificationChannel'
{ _pncSNSTopicARN :: !Text
, _pncSNSRoleName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putNotificationChannel
:: Text
-> Text
-> PutNotificationChannel
putNotificationChannel pSNSTopicARN_ pSNSRoleName_ =
PutNotificationChannel'
{_pncSNSTopicARN = pSNSTopicARN_, _pncSNSRoleName = pSNSRoleName_}
pncSNSTopicARN :: Lens' PutNotificationChannel Text
pncSNSTopicARN = lens _pncSNSTopicARN (\ s a -> s{_pncSNSTopicARN = a})
pncSNSRoleName :: Lens' PutNotificationChannel Text
pncSNSRoleName = lens _pncSNSRoleName (\ s a -> s{_pncSNSRoleName = a})
instance AWSRequest PutNotificationChannel where
type Rs PutNotificationChannel =
PutNotificationChannelResponse
request = postJSON fms
response
= receiveNull PutNotificationChannelResponse'
instance Hashable PutNotificationChannel where
instance NFData PutNotificationChannel where
instance ToHeaders PutNotificationChannel where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSFMS_20180101.PutNotificationChannel" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON PutNotificationChannel where
toJSON PutNotificationChannel'{..}
= object
(catMaybes
[Just ("SnsTopicArn" .= _pncSNSTopicARN),
Just ("SnsRoleName" .= _pncSNSRoleName)])
instance ToPath PutNotificationChannel where
toPath = const "/"
instance ToQuery PutNotificationChannel where
toQuery = const mempty
data PutNotificationChannelResponse =
PutNotificationChannelResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
putNotificationChannelResponse
:: PutNotificationChannelResponse
putNotificationChannelResponse = PutNotificationChannelResponse'
instance NFData PutNotificationChannelResponse where