{-# 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.Config.DescribeDeliveryChannelStatus
(
describeDeliveryChannelStatus
, DescribeDeliveryChannelStatus
, ddcsDeliveryChannelNames
, describeDeliveryChannelStatusResponse
, DescribeDeliveryChannelStatusResponse
, ddcsrsDeliveryChannelsStatus
, ddcsrsResponseStatus
) where
import Network.AWS.Config.Types
import Network.AWS.Config.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DescribeDeliveryChannelStatus = DescribeDeliveryChannelStatus'
{ _ddcsDeliveryChannelNames :: Maybe [Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeDeliveryChannelStatus
:: DescribeDeliveryChannelStatus
describeDeliveryChannelStatus =
DescribeDeliveryChannelStatus' {_ddcsDeliveryChannelNames = Nothing}
ddcsDeliveryChannelNames :: Lens' DescribeDeliveryChannelStatus [Text]
ddcsDeliveryChannelNames = lens _ddcsDeliveryChannelNames (\ s a -> s{_ddcsDeliveryChannelNames = a}) . _Default . _Coerce
instance AWSRequest DescribeDeliveryChannelStatus
where
type Rs DescribeDeliveryChannelStatus =
DescribeDeliveryChannelStatusResponse
request = postJSON config
response
= receiveJSON
(\ s h x ->
DescribeDeliveryChannelStatusResponse' <$>
(x .?> "DeliveryChannelsStatus" .!@ mempty) <*>
(pure (fromEnum s)))
instance Hashable DescribeDeliveryChannelStatus where
instance NFData DescribeDeliveryChannelStatus where
instance ToHeaders DescribeDeliveryChannelStatus
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StarlingDoveService.DescribeDeliveryChannelStatus"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeDeliveryChannelStatus where
toJSON DescribeDeliveryChannelStatus'{..}
= object
(catMaybes
[("DeliveryChannelNames" .=) <$>
_ddcsDeliveryChannelNames])
instance ToPath DescribeDeliveryChannelStatus where
toPath = const "/"
instance ToQuery DescribeDeliveryChannelStatus where
toQuery = const mempty
data DescribeDeliveryChannelStatusResponse = DescribeDeliveryChannelStatusResponse'
{ _ddcsrsDeliveryChannelsStatus :: !(Maybe [DeliveryChannelStatus])
, _ddcsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeDeliveryChannelStatusResponse
:: Int
-> DescribeDeliveryChannelStatusResponse
describeDeliveryChannelStatusResponse pResponseStatus_ =
DescribeDeliveryChannelStatusResponse'
{ _ddcsrsDeliveryChannelsStatus = Nothing
, _ddcsrsResponseStatus = pResponseStatus_
}
ddcsrsDeliveryChannelsStatus :: Lens' DescribeDeliveryChannelStatusResponse [DeliveryChannelStatus]
ddcsrsDeliveryChannelsStatus = lens _ddcsrsDeliveryChannelsStatus (\ s a -> s{_ddcsrsDeliveryChannelsStatus = a}) . _Default . _Coerce
ddcsrsResponseStatus :: Lens' DescribeDeliveryChannelStatusResponse Int
ddcsrsResponseStatus = lens _ddcsrsResponseStatus (\ s a -> s{_ddcsrsResponseStatus = a})
instance NFData DescribeDeliveryChannelStatusResponse
where