module Network.AWS.CloudHSM.CreateHAPG
(
createHAPG
, CreateHAPG
, chLabel
, createHAPGResponse
, CreateHAPGResponse
, chapgrsHAPGARN
, chapgrsResponseStatus
) 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
newtype CreateHAPG = CreateHAPG'
{ _chLabel :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createHAPG
:: Text
-> CreateHAPG
createHAPG pLabel_ =
CreateHAPG'
{ _chLabel = pLabel_
}
chLabel :: Lens' CreateHAPG Text
chLabel = lens _chLabel (\ s a -> s{_chLabel = a});
instance AWSRequest CreateHAPG where
type Rs CreateHAPG = CreateHAPGResponse
request = postJSON cloudHSM
response
= receiveJSON
(\ s h x ->
CreateHAPGResponse' <$>
(x .?> "HapgArn") <*> (pure (fromEnum s)))
instance Hashable CreateHAPG
instance NFData CreateHAPG
instance ToHeaders CreateHAPG where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CloudHsmFrontendService.CreateHapg" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateHAPG where
toJSON CreateHAPG'{..}
= object (catMaybes [Just ("Label" .= _chLabel)])
instance ToPath CreateHAPG where
toPath = const "/"
instance ToQuery CreateHAPG where
toQuery = const mempty
data CreateHAPGResponse = CreateHAPGResponse'
{ _chapgrsHAPGARN :: !(Maybe Text)
, _chapgrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createHAPGResponse
:: Int
-> CreateHAPGResponse
createHAPGResponse pResponseStatus_ =
CreateHAPGResponse'
{ _chapgrsHAPGARN = Nothing
, _chapgrsResponseStatus = pResponseStatus_
}
chapgrsHAPGARN :: Lens' CreateHAPGResponse (Maybe Text)
chapgrsHAPGARN = lens _chapgrsHAPGARN (\ s a -> s{_chapgrsHAPGARN = a});
chapgrsResponseStatus :: Lens' CreateHAPGResponse Int
chapgrsResponseStatus = lens _chapgrsResponseStatus (\ s a -> s{_chapgrsResponseStatus = a});
instance NFData CreateHAPGResponse