module Network.AWS.CloudHSM.DescribeHAPG
(
describeHAPG
, DescribeHAPG
, dhapgHAPGARN
, describeHAPGResponse
, DescribeHAPGResponse
, dhapgrsState
, dhapgrsLastModifiedTimestamp
, dhapgrsHSMsPendingRegistration
, dhapgrsHAPGSerial
, dhapgrsHSMsPendingDeletion
, dhapgrsHSMsLastActionFailed
, dhapgrsPartitionSerialList
, dhapgrsHAPGARN
, dhapgrsLabel
, dhapgrsStatus
) where
import Network.AWS.CloudHSM.Types
import Network.AWS.CloudHSM.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DescribeHAPG = DescribeHAPG'
{ _dhapgHAPGARN :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeHAPG
:: Text
-> DescribeHAPG
describeHAPG pHAPGARN_ =
DescribeHAPG'
{ _dhapgHAPGARN = pHAPGARN_
}
dhapgHAPGARN :: Lens' DescribeHAPG Text
dhapgHAPGARN = lens _dhapgHAPGARN (\ s a -> s{_dhapgHAPGARN = a});
instance AWSRequest DescribeHAPG where
type Sv DescribeHAPG = CloudHSM
type Rs DescribeHAPG = DescribeHAPGResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
DescribeHAPGResponse' <$>
(x .?> "State") <*> (x .?> "LastModifiedTimestamp")
<*> (x .?> "HsmsPendingRegistration" .!@ mempty)
<*> (x .?> "HapgSerial")
<*> (x .?> "HsmsPendingDeletion" .!@ mempty)
<*> (x .?> "HsmsLastActionFailed" .!@ mempty)
<*> (x .?> "PartitionSerialList" .!@ mempty)
<*> (x .?> "HapgArn")
<*> (x .?> "Label")
<*> (pure (fromEnum s)))
instance ToHeaders DescribeHAPG where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CloudHsmFrontendService.DescribeHapg" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeHAPG where
toJSON DescribeHAPG'{..}
= object ["HapgArn" .= _dhapgHAPGARN]
instance ToPath DescribeHAPG where
toPath = const "/"
instance ToQuery DescribeHAPG where
toQuery = const mempty
data DescribeHAPGResponse = DescribeHAPGResponse'
{ _dhapgrsState :: !(Maybe CloudHSMObjectState)
, _dhapgrsLastModifiedTimestamp :: !(Maybe Text)
, _dhapgrsHSMsPendingRegistration :: !(Maybe [Text])
, _dhapgrsHAPGSerial :: !(Maybe Text)
, _dhapgrsHSMsPendingDeletion :: !(Maybe [Text])
, _dhapgrsHSMsLastActionFailed :: !(Maybe [Text])
, _dhapgrsPartitionSerialList :: !(Maybe [Text])
, _dhapgrsHAPGARN :: !(Maybe Text)
, _dhapgrsLabel :: !(Maybe Text)
, _dhapgrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeHAPGResponse
:: Int
-> DescribeHAPGResponse
describeHAPGResponse pStatus_ =
DescribeHAPGResponse'
{ _dhapgrsState = Nothing
, _dhapgrsLastModifiedTimestamp = Nothing
, _dhapgrsHSMsPendingRegistration = Nothing
, _dhapgrsHAPGSerial = Nothing
, _dhapgrsHSMsPendingDeletion = Nothing
, _dhapgrsHSMsLastActionFailed = Nothing
, _dhapgrsPartitionSerialList = Nothing
, _dhapgrsHAPGARN = Nothing
, _dhapgrsLabel = Nothing
, _dhapgrsStatus = pStatus_
}
dhapgrsState :: Lens' DescribeHAPGResponse (Maybe CloudHSMObjectState)
dhapgrsState = lens _dhapgrsState (\ s a -> s{_dhapgrsState = a});
dhapgrsLastModifiedTimestamp :: Lens' DescribeHAPGResponse (Maybe Text)
dhapgrsLastModifiedTimestamp = lens _dhapgrsLastModifiedTimestamp (\ s a -> s{_dhapgrsLastModifiedTimestamp = a});
dhapgrsHSMsPendingRegistration :: Lens' DescribeHAPGResponse [Text]
dhapgrsHSMsPendingRegistration = lens _dhapgrsHSMsPendingRegistration (\ s a -> s{_dhapgrsHSMsPendingRegistration = a}) . _Default . _Coerce;
dhapgrsHAPGSerial :: Lens' DescribeHAPGResponse (Maybe Text)
dhapgrsHAPGSerial = lens _dhapgrsHAPGSerial (\ s a -> s{_dhapgrsHAPGSerial = a});
dhapgrsHSMsPendingDeletion :: Lens' DescribeHAPGResponse [Text]
dhapgrsHSMsPendingDeletion = lens _dhapgrsHSMsPendingDeletion (\ s a -> s{_dhapgrsHSMsPendingDeletion = a}) . _Default . _Coerce;
dhapgrsHSMsLastActionFailed :: Lens' DescribeHAPGResponse [Text]
dhapgrsHSMsLastActionFailed = lens _dhapgrsHSMsLastActionFailed (\ s a -> s{_dhapgrsHSMsLastActionFailed = a}) . _Default . _Coerce;
dhapgrsPartitionSerialList :: Lens' DescribeHAPGResponse [Text]
dhapgrsPartitionSerialList = lens _dhapgrsPartitionSerialList (\ s a -> s{_dhapgrsPartitionSerialList = a}) . _Default . _Coerce;
dhapgrsHAPGARN :: Lens' DescribeHAPGResponse (Maybe Text)
dhapgrsHAPGARN = lens _dhapgrsHAPGARN (\ s a -> s{_dhapgrsHAPGARN = a});
dhapgrsLabel :: Lens' DescribeHAPGResponse (Maybe Text)
dhapgrsLabel = lens _dhapgrsLabel (\ s a -> s{_dhapgrsLabel = a});
dhapgrsStatus :: Lens' DescribeHAPGResponse Int
dhapgrsStatus = lens _dhapgrsStatus (\ s a -> s{_dhapgrsStatus = a});