module Network.AWS.Config.DescribeDeliveryChannels
(
describeDeliveryChannels
, DescribeDeliveryChannels
, ddcDeliveryChannelNames
, describeDeliveryChannelsResponse
, DescribeDeliveryChannelsResponse
, ddcrsDeliveryChannels
, ddcrsStatus
) where
import Network.AWS.Config.Types
import Network.AWS.Config.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DescribeDeliveryChannels = DescribeDeliveryChannels'
{ _ddcDeliveryChannelNames :: Maybe [Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeDeliveryChannels
:: DescribeDeliveryChannels
describeDeliveryChannels =
DescribeDeliveryChannels'
{ _ddcDeliveryChannelNames = Nothing
}
ddcDeliveryChannelNames :: Lens' DescribeDeliveryChannels [Text]
ddcDeliveryChannelNames = lens _ddcDeliveryChannelNames (\ s a -> s{_ddcDeliveryChannelNames = a}) . _Default . _Coerce;
instance AWSRequest DescribeDeliveryChannels where
type Rs DescribeDeliveryChannels =
DescribeDeliveryChannelsResponse
request = postJSON config
response
= receiveJSON
(\ s h x ->
DescribeDeliveryChannelsResponse' <$>
(x .?> "DeliveryChannels" .!@ mempty) <*>
(pure (fromEnum s)))
instance ToHeaders DescribeDeliveryChannels where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StarlingDoveService.DescribeDeliveryChannels" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeDeliveryChannels where
toJSON DescribeDeliveryChannels'{..}
= object
(catMaybes
[("DeliveryChannelNames" .=) <$>
_ddcDeliveryChannelNames])
instance ToPath DescribeDeliveryChannels where
toPath = const "/"
instance ToQuery DescribeDeliveryChannels where
toQuery = const mempty
data DescribeDeliveryChannelsResponse = DescribeDeliveryChannelsResponse'
{ _ddcrsDeliveryChannels :: !(Maybe [DeliveryChannel])
, _ddcrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeDeliveryChannelsResponse
:: Int
-> DescribeDeliveryChannelsResponse
describeDeliveryChannelsResponse pStatus_ =
DescribeDeliveryChannelsResponse'
{ _ddcrsDeliveryChannels = Nothing
, _ddcrsStatus = pStatus_
}
ddcrsDeliveryChannels :: Lens' DescribeDeliveryChannelsResponse [DeliveryChannel]
ddcrsDeliveryChannels = lens _ddcrsDeliveryChannels (\ s a -> s{_ddcrsDeliveryChannels = a}) . _Default . _Coerce;
ddcrsStatus :: Lens' DescribeDeliveryChannelsResponse Int
ddcrsStatus = lens _ddcrsStatus (\ s a -> s{_ddcrsStatus = a});