{-# 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.AssociateNode
(
associateNode
, AssociateNode
, anEngineAttributes
, anServerName
, anNodeName
, associateNodeResponse
, AssociateNodeResponse
, anrsNodeAssociationStatusToken
, anrsResponseStatus
) 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 AssociateNode = AssociateNode'
{ _anEngineAttributes :: !(Maybe [EngineAttribute])
, _anServerName :: !Text
, _anNodeName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
associateNode
:: Text
-> Text
-> AssociateNode
associateNode pServerName_ pNodeName_ =
AssociateNode'
{ _anEngineAttributes = Nothing
, _anServerName = pServerName_
, _anNodeName = pNodeName_
}
anEngineAttributes :: Lens' AssociateNode [EngineAttribute]
anEngineAttributes = lens _anEngineAttributes (\ s a -> s{_anEngineAttributes = a}) . _Default . _Coerce;
anServerName :: Lens' AssociateNode Text
anServerName = lens _anServerName (\ s a -> s{_anServerName = a});
anNodeName :: Lens' AssociateNode Text
anNodeName = lens _anNodeName (\ s a -> s{_anNodeName = a});
instance AWSRequest AssociateNode where
type Rs AssociateNode = AssociateNodeResponse
request = postJSON opsWorksCM
response
= receiveJSON
(\ s h x ->
AssociateNodeResponse' <$>
(x .?> "NodeAssociationStatusToken") <*>
(pure (fromEnum s)))
instance Hashable AssociateNode
instance NFData AssociateNode
instance ToHeaders AssociateNode where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OpsWorksCM_V2016_11_01.AssociateNode" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AssociateNode where
toJSON AssociateNode'{..}
= object
(catMaybes
[("EngineAttributes" .=) <$> _anEngineAttributes,
Just ("ServerName" .= _anServerName),
Just ("NodeName" .= _anNodeName)])
instance ToPath AssociateNode where
toPath = const "/"
instance ToQuery AssociateNode where
toQuery = const mempty
data AssociateNodeResponse = AssociateNodeResponse'
{ _anrsNodeAssociationStatusToken :: !(Maybe Text)
, _anrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
associateNodeResponse
:: Int
-> AssociateNodeResponse
associateNodeResponse pResponseStatus_ =
AssociateNodeResponse'
{ _anrsNodeAssociationStatusToken = Nothing
, _anrsResponseStatus = pResponseStatus_
}
anrsNodeAssociationStatusToken :: Lens' AssociateNodeResponse (Maybe Text)
anrsNodeAssociationStatusToken = lens _anrsNodeAssociationStatusToken (\ s a -> s{_anrsNodeAssociationStatusToken = a});
anrsResponseStatus :: Lens' AssociateNodeResponse Int
anrsResponseStatus = lens _anrsResponseStatus (\ s a -> s{_anrsResponseStatus = a});
instance NFData AssociateNodeResponse