{-# 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.OpsWorks.DescribeStackSummary
(
describeStackSummary
, DescribeStackSummary
, dssStackId
, describeStackSummaryResponse
, DescribeStackSummaryResponse
, dssrsStackSummary
, dssrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.OpsWorks.Types
import Network.AWS.OpsWorks.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DescribeStackSummary = DescribeStackSummary'
{ _dssStackId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeStackSummary
:: Text
-> DescribeStackSummary
describeStackSummary pStackId_ =
DescribeStackSummary'
{ _dssStackId = pStackId_
}
dssStackId :: Lens' DescribeStackSummary Text
dssStackId = lens _dssStackId (\ s a -> s{_dssStackId = a});
instance AWSRequest DescribeStackSummary where
type Rs DescribeStackSummary =
DescribeStackSummaryResponse
request = postJSON opsWorks
response
= receiveJSON
(\ s h x ->
DescribeStackSummaryResponse' <$>
(x .?> "StackSummary") <*> (pure (fromEnum s)))
instance Hashable DescribeStackSummary
instance NFData DescribeStackSummary
instance ToHeaders DescribeStackSummary where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OpsWorks_20130218.DescribeStackSummary" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeStackSummary where
toJSON DescribeStackSummary'{..}
= object
(catMaybes [Just ("StackId" .= _dssStackId)])
instance ToPath DescribeStackSummary where
toPath = const "/"
instance ToQuery DescribeStackSummary where
toQuery = const mempty
data DescribeStackSummaryResponse = DescribeStackSummaryResponse'
{ _dssrsStackSummary :: !(Maybe StackSummary)
, _dssrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeStackSummaryResponse
:: Int
-> DescribeStackSummaryResponse
describeStackSummaryResponse pResponseStatus_ =
DescribeStackSummaryResponse'
{ _dssrsStackSummary = Nothing
, _dssrsResponseStatus = pResponseStatus_
}
dssrsStackSummary :: Lens' DescribeStackSummaryResponse (Maybe StackSummary)
dssrsStackSummary = lens _dssrsStackSummary (\ s a -> s{_dssrsStackSummary = a});
dssrsResponseStatus :: Lens' DescribeStackSummaryResponse Int
dssrsResponseStatus = lens _dssrsResponseStatus (\ s a -> s{_dssrsResponseStatus = a});
instance NFData DescribeStackSummaryResponse