module Network.AWS.CloudHSM.ModifyHAPG
(
modifyHAPG
, ModifyHAPG
, mhPartitionSerialList
, mhLabel
, mhHAPGARN
, modifyHAPGResponse
, ModifyHAPGResponse
, mhrsHAPGARN
, mhrsResponseStatus
) where
import Network.AWS.CloudHSM.Types
import Network.AWS.CloudHSM.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ModifyHAPG = ModifyHAPG'
{ _mhPartitionSerialList :: !(Maybe [Text])
, _mhLabel :: !(Maybe Text)
, _mhHAPGARN :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyHAPG
:: Text
-> ModifyHAPG
modifyHAPG pHAPGARN_ =
ModifyHAPG'
{ _mhPartitionSerialList = Nothing
, _mhLabel = Nothing
, _mhHAPGARN = pHAPGARN_
}
mhPartitionSerialList :: Lens' ModifyHAPG [Text]
mhPartitionSerialList = lens _mhPartitionSerialList (\ s a -> s{_mhPartitionSerialList = a}) . _Default . _Coerce;
mhLabel :: Lens' ModifyHAPG (Maybe Text)
mhLabel = lens _mhLabel (\ s a -> s{_mhLabel = a});
mhHAPGARN :: Lens' ModifyHAPG Text
mhHAPGARN = lens _mhHAPGARN (\ s a -> s{_mhHAPGARN = a});
instance AWSRequest ModifyHAPG where
type Rs ModifyHAPG = ModifyHAPGResponse
request = postJSON cloudHSM
response
= receiveJSON
(\ s h x ->
ModifyHAPGResponse' <$>
(x .?> "HapgArn") <*> (pure (fromEnum s)))
instance Hashable ModifyHAPG
instance NFData ModifyHAPG
instance ToHeaders ModifyHAPG where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CloudHsmFrontendService.ModifyHapg" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ModifyHAPG where
toJSON ModifyHAPG'{..}
= object
(catMaybes
[("PartitionSerialList" .=) <$>
_mhPartitionSerialList,
("Label" .=) <$> _mhLabel,
Just ("HapgArn" .= _mhHAPGARN)])
instance ToPath ModifyHAPG where
toPath = const "/"
instance ToQuery ModifyHAPG where
toQuery = const mempty
data ModifyHAPGResponse = ModifyHAPGResponse'
{ _mhrsHAPGARN :: !(Maybe Text)
, _mhrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyHAPGResponse
:: Int
-> ModifyHAPGResponse
modifyHAPGResponse pResponseStatus_ =
ModifyHAPGResponse'
{ _mhrsHAPGARN = Nothing
, _mhrsResponseStatus = pResponseStatus_
}
mhrsHAPGARN :: Lens' ModifyHAPGResponse (Maybe Text)
mhrsHAPGARN = lens _mhrsHAPGARN (\ s a -> s{_mhrsHAPGARN = a});
mhrsResponseStatus :: Lens' ModifyHAPGResponse Int
mhrsResponseStatus = lens _mhrsResponseStatus (\ s a -> s{_mhrsResponseStatus = a});
instance NFData ModifyHAPGResponse