{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.OpsWorksCM.DisassociateNode
(
disassociateNode
, DisassociateNode
, dnEngineAttributes
, dnServerName
, dnNodeName
, disassociateNodeResponse
, DisassociateNodeResponse
, dnrsNodeAssociationStatusToken
, dnrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.OpsWorksCM.Types
import Network.AWS.OpsWorksCM.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DisassociateNode = DisassociateNode'
{ _dnEngineAttributes :: !(Maybe [EngineAttribute])
, _dnServerName :: !Text
, _dnNodeName :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
disassociateNode
:: Text
-> Text
-> DisassociateNode
disassociateNode pServerName_ pNodeName_ =
DisassociateNode'
{ _dnEngineAttributes = Nothing
, _dnServerName = pServerName_
, _dnNodeName = pNodeName_
}
dnEngineAttributes :: Lens' DisassociateNode [EngineAttribute]
dnEngineAttributes = lens _dnEngineAttributes (\ s a -> s{_dnEngineAttributes = a}) . _Default . _Coerce
dnServerName :: Lens' DisassociateNode Text
dnServerName = lens _dnServerName (\ s a -> s{_dnServerName = a})
dnNodeName :: Lens' DisassociateNode Text
dnNodeName = lens _dnNodeName (\ s a -> s{_dnNodeName = a})
instance AWSRequest DisassociateNode where
type Rs DisassociateNode = DisassociateNodeResponse
request = postJSON opsWorksCM
response
= receiveJSON
(\ s h x ->
DisassociateNodeResponse' <$>
(x .?> "NodeAssociationStatusToken") <*>
(pure (fromEnum s)))
instance Hashable DisassociateNode where
instance NFData DisassociateNode where
instance ToHeaders DisassociateNode where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OpsWorksCM_V2016_11_01.DisassociateNode" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DisassociateNode where
toJSON DisassociateNode'{..}
= object
(catMaybes
[("EngineAttributes" .=) <$> _dnEngineAttributes,
Just ("ServerName" .= _dnServerName),
Just ("NodeName" .= _dnNodeName)])
instance ToPath DisassociateNode where
toPath = const "/"
instance ToQuery DisassociateNode where
toQuery = const mempty
data DisassociateNodeResponse = DisassociateNodeResponse'
{ _dnrsNodeAssociationStatusToken :: !(Maybe Text)
, _dnrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
disassociateNodeResponse
:: Int
-> DisassociateNodeResponse
disassociateNodeResponse pResponseStatus_ =
DisassociateNodeResponse'
{ _dnrsNodeAssociationStatusToken = Nothing
, _dnrsResponseStatus = pResponseStatus_
}
dnrsNodeAssociationStatusToken :: Lens' DisassociateNodeResponse (Maybe Text)
dnrsNodeAssociationStatusToken = lens _dnrsNodeAssociationStatusToken (\ s a -> s{_dnrsNodeAssociationStatusToken = a})
dnrsResponseStatus :: Lens' DisassociateNodeResponse Int
dnrsResponseStatus = lens _dnrsResponseStatus (\ s a -> s{_dnrsResponseStatus = a})
instance NFData DisassociateNodeResponse where