{-# 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.GetNotificationChannel
(
getNotificationChannel
, GetNotificationChannel
, getNotificationChannelResponse
, GetNotificationChannelResponse
, gncrsSNSTopicARN
, gncrsSNSRoleName
, gncrsResponseStatus
) 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 GetNotificationChannel =
GetNotificationChannel'
deriving (Eq, Read, Show, Data, Typeable, Generic)
getNotificationChannel
:: GetNotificationChannel
getNotificationChannel = GetNotificationChannel'
instance AWSRequest GetNotificationChannel where
type Rs GetNotificationChannel =
GetNotificationChannelResponse
request = postJSON fms
response
= receiveJSON
(\ s h x ->
GetNotificationChannelResponse' <$>
(x .?> "SnsTopicArn") <*> (x .?> "SnsRoleName") <*>
(pure (fromEnum s)))
instance Hashable GetNotificationChannel where
instance NFData GetNotificationChannel where
instance ToHeaders GetNotificationChannel where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSFMS_20180101.GetNotificationChannel" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetNotificationChannel where
toJSON = const (Object mempty)
instance ToPath GetNotificationChannel where
toPath = const "/"
instance ToQuery GetNotificationChannel where
toQuery = const mempty
data GetNotificationChannelResponse = GetNotificationChannelResponse'
{ _gncrsSNSTopicARN :: !(Maybe Text)
, _gncrsSNSRoleName :: !(Maybe Text)
, _gncrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getNotificationChannelResponse
:: Int
-> GetNotificationChannelResponse
getNotificationChannelResponse pResponseStatus_ =
GetNotificationChannelResponse'
{ _gncrsSNSTopicARN = Nothing
, _gncrsSNSRoleName = Nothing
, _gncrsResponseStatus = pResponseStatus_
}
gncrsSNSTopicARN :: Lens' GetNotificationChannelResponse (Maybe Text)
gncrsSNSTopicARN = lens _gncrsSNSTopicARN (\ s a -> s{_gncrsSNSTopicARN = a})
gncrsSNSRoleName :: Lens' GetNotificationChannelResponse (Maybe Text)
gncrsSNSRoleName = lens _gncrsSNSRoleName (\ s a -> s{_gncrsSNSRoleName = a})
gncrsResponseStatus :: Lens' GetNotificationChannelResponse Int
gncrsResponseStatus = lens _gncrsResponseStatus (\ s a -> s{_gncrsResponseStatus = a})
instance NFData GetNotificationChannelResponse where