module Network.AWS.DAX.UpdateCluster
(
updateCluster
, UpdateCluster
, ucSecurityGroupIds
, ucPreferredMaintenanceWindow
, ucNotificationTopicStatus
, ucDescription
, ucNotificationTopicARN
, ucParameterGroupName
, ucClusterName
, updateClusterResponse
, UpdateClusterResponse
, ucrsCluster
, ucrsResponseStatus
) 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 UpdateCluster = UpdateCluster'
{ _ucSecurityGroupIds :: !(Maybe [Text])
, _ucPreferredMaintenanceWindow :: !(Maybe Text)
, _ucNotificationTopicStatus :: !(Maybe Text)
, _ucDescription :: !(Maybe Text)
, _ucNotificationTopicARN :: !(Maybe Text)
, _ucParameterGroupName :: !(Maybe Text)
, _ucClusterName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateCluster
:: Text
-> UpdateCluster
updateCluster pClusterName_ =
UpdateCluster'
{ _ucSecurityGroupIds = Nothing
, _ucPreferredMaintenanceWindow = Nothing
, _ucNotificationTopicStatus = Nothing
, _ucDescription = Nothing
, _ucNotificationTopicARN = Nothing
, _ucParameterGroupName = Nothing
, _ucClusterName = pClusterName_
}
ucSecurityGroupIds :: Lens' UpdateCluster [Text]
ucSecurityGroupIds = lens _ucSecurityGroupIds (\ s a -> s{_ucSecurityGroupIds = a}) . _Default . _Coerce;
ucPreferredMaintenanceWindow :: Lens' UpdateCluster (Maybe Text)
ucPreferredMaintenanceWindow = lens _ucPreferredMaintenanceWindow (\ s a -> s{_ucPreferredMaintenanceWindow = a});
ucNotificationTopicStatus :: Lens' UpdateCluster (Maybe Text)
ucNotificationTopicStatus = lens _ucNotificationTopicStatus (\ s a -> s{_ucNotificationTopicStatus = a});
ucDescription :: Lens' UpdateCluster (Maybe Text)
ucDescription = lens _ucDescription (\ s a -> s{_ucDescription = a});
ucNotificationTopicARN :: Lens' UpdateCluster (Maybe Text)
ucNotificationTopicARN = lens _ucNotificationTopicARN (\ s a -> s{_ucNotificationTopicARN = a});
ucParameterGroupName :: Lens' UpdateCluster (Maybe Text)
ucParameterGroupName = lens _ucParameterGroupName (\ s a -> s{_ucParameterGroupName = a});
ucClusterName :: Lens' UpdateCluster Text
ucClusterName = lens _ucClusterName (\ s a -> s{_ucClusterName = a});
instance AWSRequest UpdateCluster where
type Rs UpdateCluster = UpdateClusterResponse
request = postJSON dax
response
= receiveJSON
(\ s h x ->
UpdateClusterResponse' <$>
(x .?> "Cluster") <*> (pure (fromEnum s)))
instance Hashable UpdateCluster where
instance NFData UpdateCluster where
instance ToHeaders UpdateCluster where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDAXV3.UpdateCluster" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateCluster where
toJSON UpdateCluster'{..}
= object
(catMaybes
[("SecurityGroupIds" .=) <$> _ucSecurityGroupIds,
("PreferredMaintenanceWindow" .=) <$>
_ucPreferredMaintenanceWindow,
("NotificationTopicStatus" .=) <$>
_ucNotificationTopicStatus,
("Description" .=) <$> _ucDescription,
("NotificationTopicArn" .=) <$>
_ucNotificationTopicARN,
("ParameterGroupName" .=) <$> _ucParameterGroupName,
Just ("ClusterName" .= _ucClusterName)])
instance ToPath UpdateCluster where
toPath = const "/"
instance ToQuery UpdateCluster where
toQuery = const mempty
data UpdateClusterResponse = UpdateClusterResponse'
{ _ucrsCluster :: !(Maybe Cluster)
, _ucrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateClusterResponse
:: Int
-> UpdateClusterResponse
updateClusterResponse pResponseStatus_ =
UpdateClusterResponse'
{_ucrsCluster = Nothing, _ucrsResponseStatus = pResponseStatus_}
ucrsCluster :: Lens' UpdateClusterResponse (Maybe Cluster)
ucrsCluster = lens _ucrsCluster (\ s a -> s{_ucrsCluster = a});
ucrsResponseStatus :: Lens' UpdateClusterResponse Int
ucrsResponseStatus = lens _ucrsResponseStatus (\ s a -> s{_ucrsResponseStatus = a});
instance NFData UpdateClusterResponse where