module Network.AWS.DAX.DecreaseReplicationFactor
(
decreaseReplicationFactor
, DecreaseReplicationFactor
, drfNodeIdsToRemove
, drfAvailabilityZones
, drfClusterName
, drfNewReplicationFactor
, decreaseReplicationFactorResponse
, DecreaseReplicationFactorResponse
, drfrsCluster
, drfrsResponseStatus
) where
import Network.AWS.DAX.Types
import Network.AWS.DAX.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DecreaseReplicationFactor = DecreaseReplicationFactor'
{ _drfNodeIdsToRemove :: !(Maybe [Text])
, _drfAvailabilityZones :: !(Maybe [Text])
, _drfClusterName :: !Text
, _drfNewReplicationFactor :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
decreaseReplicationFactor
:: Text
-> Int
-> DecreaseReplicationFactor
decreaseReplicationFactor pClusterName_ pNewReplicationFactor_ =
DecreaseReplicationFactor'
{ _drfNodeIdsToRemove = Nothing
, _drfAvailabilityZones = Nothing
, _drfClusterName = pClusterName_
, _drfNewReplicationFactor = pNewReplicationFactor_
}
drfNodeIdsToRemove :: Lens' DecreaseReplicationFactor [Text]
drfNodeIdsToRemove = lens _drfNodeIdsToRemove (\ s a -> s{_drfNodeIdsToRemove = a}) . _Default . _Coerce;
drfAvailabilityZones :: Lens' DecreaseReplicationFactor [Text]
drfAvailabilityZones = lens _drfAvailabilityZones (\ s a -> s{_drfAvailabilityZones = a}) . _Default . _Coerce;
drfClusterName :: Lens' DecreaseReplicationFactor Text
drfClusterName = lens _drfClusterName (\ s a -> s{_drfClusterName = a});
drfNewReplicationFactor :: Lens' DecreaseReplicationFactor Int
drfNewReplicationFactor = lens _drfNewReplicationFactor (\ s a -> s{_drfNewReplicationFactor = a});
instance AWSRequest DecreaseReplicationFactor where
type Rs DecreaseReplicationFactor =
DecreaseReplicationFactorResponse
request = postJSON dax
response
= receiveJSON
(\ s h x ->
DecreaseReplicationFactorResponse' <$>
(x .?> "Cluster") <*> (pure (fromEnum s)))
instance Hashable DecreaseReplicationFactor where
instance NFData DecreaseReplicationFactor where
instance ToHeaders DecreaseReplicationFactor where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDAXV3.DecreaseReplicationFactor" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DecreaseReplicationFactor where
toJSON DecreaseReplicationFactor'{..}
= object
(catMaybes
[("NodeIdsToRemove" .=) <$> _drfNodeIdsToRemove,
("AvailabilityZones" .=) <$> _drfAvailabilityZones,
Just ("ClusterName" .= _drfClusterName),
Just
("NewReplicationFactor" .=
_drfNewReplicationFactor)])
instance ToPath DecreaseReplicationFactor where
toPath = const "/"
instance ToQuery DecreaseReplicationFactor where
toQuery = const mempty
data DecreaseReplicationFactorResponse = DecreaseReplicationFactorResponse'
{ _drfrsCluster :: !(Maybe Cluster)
, _drfrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
decreaseReplicationFactorResponse
:: Int
-> DecreaseReplicationFactorResponse
decreaseReplicationFactorResponse pResponseStatus_ =
DecreaseReplicationFactorResponse'
{_drfrsCluster = Nothing, _drfrsResponseStatus = pResponseStatus_}
drfrsCluster :: Lens' DecreaseReplicationFactorResponse (Maybe Cluster)
drfrsCluster = lens _drfrsCluster (\ s a -> s{_drfrsCluster = a});
drfrsResponseStatus :: Lens' DecreaseReplicationFactorResponse Int
drfrsResponseStatus = lens _drfrsResponseStatus (\ s a -> s{_drfrsResponseStatus = a});
instance NFData DecreaseReplicationFactorResponse
where