module Network.AWS.Config.DescribeDeliveryChannels
(
DescribeDeliveryChannels
, describeDeliveryChannels
, ddcDeliveryChannelNames
, DescribeDeliveryChannelsResponse
, describeDeliveryChannelsResponse
, ddcrDeliveryChannels
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.Config.Types
import qualified GHC.Exts
newtype DescribeDeliveryChannels = DescribeDeliveryChannels
{ _ddcDeliveryChannelNames :: List "DeliveryChannelNames" Text
} deriving (Eq, Ord, Show, Monoid, Semigroup)
instance GHC.Exts.IsList DescribeDeliveryChannels where
type Item DescribeDeliveryChannels = Text
fromList = DescribeDeliveryChannels . GHC.Exts.fromList
toList = GHC.Exts.toList . _ddcDeliveryChannelNames
describeDeliveryChannels :: DescribeDeliveryChannels
describeDeliveryChannels = DescribeDeliveryChannels
{ _ddcDeliveryChannelNames = mempty
}
ddcDeliveryChannelNames :: Lens' DescribeDeliveryChannels [Text]
ddcDeliveryChannelNames =
lens _ddcDeliveryChannelNames (\s a -> s { _ddcDeliveryChannelNames = a })
. _List
newtype DescribeDeliveryChannelsResponse = DescribeDeliveryChannelsResponse
{ _ddcrDeliveryChannels :: List "DeliveryChannels" DeliveryChannel
} deriving (Eq, Show, Monoid, Semigroup)
instance GHC.Exts.IsList DescribeDeliveryChannelsResponse where
type Item DescribeDeliveryChannelsResponse = DeliveryChannel
fromList = DescribeDeliveryChannelsResponse . GHC.Exts.fromList
toList = GHC.Exts.toList . _ddcrDeliveryChannels
describeDeliveryChannelsResponse :: DescribeDeliveryChannelsResponse
describeDeliveryChannelsResponse = DescribeDeliveryChannelsResponse
{ _ddcrDeliveryChannels = mempty
}
ddcrDeliveryChannels :: Lens' DescribeDeliveryChannelsResponse [DeliveryChannel]
ddcrDeliveryChannels =
lens _ddcrDeliveryChannels (\s a -> s { _ddcrDeliveryChannels = a })
. _List
instance ToPath DescribeDeliveryChannels where
toPath = const "/"
instance ToQuery DescribeDeliveryChannels where
toQuery = const mempty
instance ToHeaders DescribeDeliveryChannels
instance ToJSON DescribeDeliveryChannels where
toJSON DescribeDeliveryChannels{..} = object
[ "DeliveryChannelNames" .= _ddcDeliveryChannelNames
]
instance AWSRequest DescribeDeliveryChannels where
type Sv DescribeDeliveryChannels = Config
type Rs DescribeDeliveryChannels = DescribeDeliveryChannelsResponse
request = post "DescribeDeliveryChannels"
response = jsonResponse
instance FromJSON DescribeDeliveryChannelsResponse where
parseJSON = withObject "DescribeDeliveryChannelsResponse" $ \o -> DescribeDeliveryChannelsResponse
<$> o .:? "DeliveryChannels" .!= mempty