module Network.AWS.DAX.UpdateSubnetGroup
(
updateSubnetGroup
, UpdateSubnetGroup
, usgSubnetIds
, usgDescription
, usgSubnetGroupName
, updateSubnetGroupResponse
, UpdateSubnetGroupResponse
, usgrsSubnetGroup
, usgrsResponseStatus
) 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 UpdateSubnetGroup = UpdateSubnetGroup'
{ _usgSubnetIds :: !(Maybe [Text])
, _usgDescription :: !(Maybe Text)
, _usgSubnetGroupName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateSubnetGroup
:: Text
-> UpdateSubnetGroup
updateSubnetGroup pSubnetGroupName_ =
UpdateSubnetGroup'
{ _usgSubnetIds = Nothing
, _usgDescription = Nothing
, _usgSubnetGroupName = pSubnetGroupName_
}
usgSubnetIds :: Lens' UpdateSubnetGroup [Text]
usgSubnetIds = lens _usgSubnetIds (\ s a -> s{_usgSubnetIds = a}) . _Default . _Coerce;
usgDescription :: Lens' UpdateSubnetGroup (Maybe Text)
usgDescription = lens _usgDescription (\ s a -> s{_usgDescription = a});
usgSubnetGroupName :: Lens' UpdateSubnetGroup Text
usgSubnetGroupName = lens _usgSubnetGroupName (\ s a -> s{_usgSubnetGroupName = a});
instance AWSRequest UpdateSubnetGroup where
type Rs UpdateSubnetGroup = UpdateSubnetGroupResponse
request = postJSON dax
response
= receiveJSON
(\ s h x ->
UpdateSubnetGroupResponse' <$>
(x .?> "SubnetGroup") <*> (pure (fromEnum s)))
instance Hashable UpdateSubnetGroup where
instance NFData UpdateSubnetGroup where
instance ToHeaders UpdateSubnetGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDAXV3.UpdateSubnetGroup" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateSubnetGroup where
toJSON UpdateSubnetGroup'{..}
= object
(catMaybes
[("SubnetIds" .=) <$> _usgSubnetIds,
("Description" .=) <$> _usgDescription,
Just ("SubnetGroupName" .= _usgSubnetGroupName)])
instance ToPath UpdateSubnetGroup where
toPath = const "/"
instance ToQuery UpdateSubnetGroup where
toQuery = const mempty
data UpdateSubnetGroupResponse = UpdateSubnetGroupResponse'
{ _usgrsSubnetGroup :: !(Maybe SubnetGroup)
, _usgrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateSubnetGroupResponse
:: Int
-> UpdateSubnetGroupResponse
updateSubnetGroupResponse pResponseStatus_ =
UpdateSubnetGroupResponse'
{_usgrsSubnetGroup = Nothing, _usgrsResponseStatus = pResponseStatus_}
usgrsSubnetGroup :: Lens' UpdateSubnetGroupResponse (Maybe SubnetGroup)
usgrsSubnetGroup = lens _usgrsSubnetGroup (\ s a -> s{_usgrsSubnetGroup = a});
usgrsResponseStatus :: Lens' UpdateSubnetGroupResponse Int
usgrsResponseStatus = lens _usgrsResponseStatus (\ s a -> s{_usgrsResponseStatus = a});
instance NFData UpdateSubnetGroupResponse where