{-# 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.Redshift.DescribeHSMConfigurations
(
describeHSMConfigurations
, DescribeHSMConfigurations
, dhsmcTagValues
, dhsmcHSMConfigurationIdentifier
, dhsmcTagKeys
, dhsmcMarker
, dhsmcMaxRecords
, describeHSMConfigurationsResponse
, DescribeHSMConfigurationsResponse
, dhcrsMarker
, dhcrsHSMConfigurations
, dhcrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.Redshift.Types
import Network.AWS.Redshift.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data DescribeHSMConfigurations = DescribeHSMConfigurations'
{ _dhsmcTagValues :: !(Maybe [Text])
, _dhsmcHSMConfigurationIdentifier :: !(Maybe Text)
, _dhsmcTagKeys :: !(Maybe [Text])
, _dhsmcMarker :: !(Maybe Text)
, _dhsmcMaxRecords :: !(Maybe Int)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeHSMConfigurations
:: DescribeHSMConfigurations
describeHSMConfigurations =
DescribeHSMConfigurations'
{ _dhsmcTagValues = Nothing
, _dhsmcHSMConfigurationIdentifier = Nothing
, _dhsmcTagKeys = Nothing
, _dhsmcMarker = Nothing
, _dhsmcMaxRecords = Nothing
}
dhsmcTagValues :: Lens' DescribeHSMConfigurations [Text]
dhsmcTagValues = lens _dhsmcTagValues (\ s a -> s{_dhsmcTagValues = a}) . _Default . _Coerce;
dhsmcHSMConfigurationIdentifier :: Lens' DescribeHSMConfigurations (Maybe Text)
dhsmcHSMConfigurationIdentifier = lens _dhsmcHSMConfigurationIdentifier (\ s a -> s{_dhsmcHSMConfigurationIdentifier = a});
dhsmcTagKeys :: Lens' DescribeHSMConfigurations [Text]
dhsmcTagKeys = lens _dhsmcTagKeys (\ s a -> s{_dhsmcTagKeys = a}) . _Default . _Coerce;
dhsmcMarker :: Lens' DescribeHSMConfigurations (Maybe Text)
dhsmcMarker = lens _dhsmcMarker (\ s a -> s{_dhsmcMarker = a});
dhsmcMaxRecords :: Lens' DescribeHSMConfigurations (Maybe Int)
dhsmcMaxRecords = lens _dhsmcMaxRecords (\ s a -> s{_dhsmcMaxRecords = a});
instance AWSPager DescribeHSMConfigurations where
page rq rs
| stop (rs ^. dhcrsMarker) = Nothing
| stop (rs ^. dhcrsHSMConfigurations) = Nothing
| otherwise =
Just $ rq & dhsmcMarker .~ rs ^. dhcrsMarker
instance AWSRequest DescribeHSMConfigurations where
type Rs DescribeHSMConfigurations =
DescribeHSMConfigurationsResponse
request = postQuery redshift
response
= receiveXMLWrapper "DescribeHsmConfigurationsResult"
(\ s h x ->
DescribeHSMConfigurationsResponse' <$>
(x .@? "Marker") <*>
(x .@? "HsmConfigurations" .!@ mempty >>=
may (parseXMLList "HsmConfiguration"))
<*> (pure (fromEnum s)))
instance Hashable DescribeHSMConfigurations
instance NFData DescribeHSMConfigurations
instance ToHeaders DescribeHSMConfigurations where
toHeaders = const mempty
instance ToPath DescribeHSMConfigurations where
toPath = const "/"
instance ToQuery DescribeHSMConfigurations where
toQuery DescribeHSMConfigurations'{..}
= mconcat
["Action" =:
("DescribeHsmConfigurations" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"TagValues" =:
toQuery (toQueryList "TagValue" <$> _dhsmcTagValues),
"HsmConfigurationIdentifier" =:
_dhsmcHSMConfigurationIdentifier,
"TagKeys" =:
toQuery (toQueryList "TagKey" <$> _dhsmcTagKeys),
"Marker" =: _dhsmcMarker,
"MaxRecords" =: _dhsmcMaxRecords]
data DescribeHSMConfigurationsResponse = DescribeHSMConfigurationsResponse'
{ _dhcrsMarker :: !(Maybe Text)
, _dhcrsHSMConfigurations :: !(Maybe [HSMConfiguration])
, _dhcrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeHSMConfigurationsResponse
:: Int
-> DescribeHSMConfigurationsResponse
describeHSMConfigurationsResponse pResponseStatus_ =
DescribeHSMConfigurationsResponse'
{ _dhcrsMarker = Nothing
, _dhcrsHSMConfigurations = Nothing
, _dhcrsResponseStatus = pResponseStatus_
}
dhcrsMarker :: Lens' DescribeHSMConfigurationsResponse (Maybe Text)
dhcrsMarker = lens _dhcrsMarker (\ s a -> s{_dhcrsMarker = a});
dhcrsHSMConfigurations :: Lens' DescribeHSMConfigurationsResponse [HSMConfiguration]
dhcrsHSMConfigurations = lens _dhcrsHSMConfigurations (\ s a -> s{_dhcrsHSMConfigurations = a}) . _Default . _Coerce;
dhcrsResponseStatus :: Lens' DescribeHSMConfigurationsResponse Int
dhcrsResponseStatus = lens _dhcrsResponseStatus (\ s a -> s{_dhcrsResponseStatus = a});
instance NFData DescribeHSMConfigurationsResponse