{-# 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.CloudWatch.GetDashboard
(
getDashboard
, GetDashboard
, gdDashboardName
, getDashboardResponse
, GetDashboardResponse
, gdrsDashboardName
, gdrsDashboardBody
, gdrsDashboardARN
, gdrsResponseStatus
) where
import Network.AWS.CloudWatch.Types
import Network.AWS.CloudWatch.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetDashboard = GetDashboard'
{ _gdDashboardName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDashboard
:: Text
-> GetDashboard
getDashboard pDashboardName_ =
GetDashboard' {_gdDashboardName = pDashboardName_}
gdDashboardName :: Lens' GetDashboard Text
gdDashboardName = lens _gdDashboardName (\ s a -> s{_gdDashboardName = a})
instance AWSRequest GetDashboard where
type Rs GetDashboard = GetDashboardResponse
request = postQuery cloudWatch
response
= receiveXMLWrapper "GetDashboardResult"
(\ s h x ->
GetDashboardResponse' <$>
(x .@? "DashboardName") <*> (x .@? "DashboardBody")
<*> (x .@? "DashboardArn")
<*> (pure (fromEnum s)))
instance Hashable GetDashboard where
instance NFData GetDashboard where
instance ToHeaders GetDashboard where
toHeaders = const mempty
instance ToPath GetDashboard where
toPath = const "/"
instance ToQuery GetDashboard where
toQuery GetDashboard'{..}
= mconcat
["Action" =: ("GetDashboard" :: ByteString),
"Version" =: ("2010-08-01" :: ByteString),
"DashboardName" =: _gdDashboardName]
data GetDashboardResponse = GetDashboardResponse'
{ _gdrsDashboardName :: !(Maybe Text)
, _gdrsDashboardBody :: !(Maybe Text)
, _gdrsDashboardARN :: !(Maybe Text)
, _gdrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDashboardResponse
:: Int
-> GetDashboardResponse
getDashboardResponse pResponseStatus_ =
GetDashboardResponse'
{ _gdrsDashboardName = Nothing
, _gdrsDashboardBody = Nothing
, _gdrsDashboardARN = Nothing
, _gdrsResponseStatus = pResponseStatus_
}
gdrsDashboardName :: Lens' GetDashboardResponse (Maybe Text)
gdrsDashboardName = lens _gdrsDashboardName (\ s a -> s{_gdrsDashboardName = a})
gdrsDashboardBody :: Lens' GetDashboardResponse (Maybe Text)
gdrsDashboardBody = lens _gdrsDashboardBody (\ s a -> s{_gdrsDashboardBody = a})
gdrsDashboardARN :: Lens' GetDashboardResponse (Maybe Text)
gdrsDashboardARN = lens _gdrsDashboardARN (\ s a -> s{_gdrsDashboardARN = a})
gdrsResponseStatus :: Lens' GetDashboardResponse Int
gdrsResponseStatus = lens _gdrsResponseStatus (\ s a -> s{_gdrsResponseStatus = a})
instance NFData GetDashboardResponse where