{-# 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.XRay.GetTraceGraph
(
getTraceGraph
, GetTraceGraph
, gtgNextToken
, gtgTraceIds
, getTraceGraphResponse
, GetTraceGraphResponse
, gtgrsNextToken
, gtgrsServices
, gtgrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.XRay.Types
import Network.AWS.XRay.Types.Product
data GetTraceGraph = GetTraceGraph'
{ _gtgNextToken :: !(Maybe Text)
, _gtgTraceIds :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getTraceGraph
:: GetTraceGraph
getTraceGraph =
GetTraceGraph'
{ _gtgNextToken = Nothing
, _gtgTraceIds = mempty
}
gtgNextToken :: Lens' GetTraceGraph (Maybe Text)
gtgNextToken = lens _gtgNextToken (\ s a -> s{_gtgNextToken = a});
gtgTraceIds :: Lens' GetTraceGraph [Text]
gtgTraceIds = lens _gtgTraceIds (\ s a -> s{_gtgTraceIds = a}) . _Coerce;
instance AWSRequest GetTraceGraph where
type Rs GetTraceGraph = GetTraceGraphResponse
request = postJSON xRay
response
= receiveJSON
(\ s h x ->
GetTraceGraphResponse' <$>
(x .?> "NextToken") <*> (x .?> "Services" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable GetTraceGraph
instance NFData GetTraceGraph
instance ToHeaders GetTraceGraph where
toHeaders = const mempty
instance ToJSON GetTraceGraph where
toJSON GetTraceGraph'{..}
= object
(catMaybes
[("NextToken" .=) <$> _gtgNextToken,
Just ("TraceIds" .= _gtgTraceIds)])
instance ToPath GetTraceGraph where
toPath = const "/TraceGraph"
instance ToQuery GetTraceGraph where
toQuery = const mempty
data GetTraceGraphResponse = GetTraceGraphResponse'
{ _gtgrsNextToken :: !(Maybe Text)
, _gtgrsServices :: !(Maybe [ServiceInfo])
, _gtgrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getTraceGraphResponse
:: Int
-> GetTraceGraphResponse
getTraceGraphResponse pResponseStatus_ =
GetTraceGraphResponse'
{ _gtgrsNextToken = Nothing
, _gtgrsServices = Nothing
, _gtgrsResponseStatus = pResponseStatus_
}
gtgrsNextToken :: Lens' GetTraceGraphResponse (Maybe Text)
gtgrsNextToken = lens _gtgrsNextToken (\ s a -> s{_gtgrsNextToken = a});
gtgrsServices :: Lens' GetTraceGraphResponse [ServiceInfo]
gtgrsServices = lens _gtgrsServices (\ s a -> s{_gtgrsServices = a}) . _Default . _Coerce;
gtgrsResponseStatus :: Lens' GetTraceGraphResponse Int
gtgrsResponseStatus = lens _gtgrsResponseStatus (\ s a -> s{_gtgrsResponseStatus = a});
instance NFData GetTraceGraphResponse