module Network.AWS.Config.GetResourceConfigHistory
(
GetResourceConfigHistory
, getResourceConfigHistory
, grchChronologicalOrder
, grchEarlierTime
, grchLaterTime
, grchLimit
, grchNextToken
, grchResourceId
, grchResourceType
, GetResourceConfigHistoryResponse
, getResourceConfigHistoryResponse
, grchrConfigurationItems
, grchrNextToken
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.Config.Types
import qualified GHC.Exts
data GetResourceConfigHistory = GetResourceConfigHistory
{ _grchChronologicalOrder :: Maybe ChronologicalOrder
, _grchEarlierTime :: Maybe POSIX
, _grchLaterTime :: Maybe POSIX
, _grchLimit :: Maybe Nat
, _grchNextToken :: Maybe Text
, _grchResourceId :: Text
, _grchResourceType :: ResourceType
} deriving (Eq, Read, Show)
getResourceConfigHistory :: ResourceType
-> Text
-> GetResourceConfigHistory
getResourceConfigHistory p1 p2 = GetResourceConfigHistory
{ _grchResourceType = p1
, _grchResourceId = p2
, _grchLaterTime = Nothing
, _grchEarlierTime = Nothing
, _grchChronologicalOrder = Nothing
, _grchLimit = Nothing
, _grchNextToken = Nothing
}
grchChronologicalOrder :: Lens' GetResourceConfigHistory (Maybe ChronologicalOrder)
grchChronologicalOrder =
lens _grchChronologicalOrder (\s a -> s { _grchChronologicalOrder = a })
grchEarlierTime :: Lens' GetResourceConfigHistory (Maybe UTCTime)
grchEarlierTime = lens _grchEarlierTime (\s a -> s { _grchEarlierTime = a }) . mapping _Time
grchLaterTime :: Lens' GetResourceConfigHistory (Maybe UTCTime)
grchLaterTime = lens _grchLaterTime (\s a -> s { _grchLaterTime = a }) . mapping _Time
grchLimit :: Lens' GetResourceConfigHistory (Maybe Natural)
grchLimit = lens _grchLimit (\s a -> s { _grchLimit = a }) . mapping _Nat
grchNextToken :: Lens' GetResourceConfigHistory (Maybe Text)
grchNextToken = lens _grchNextToken (\s a -> s { _grchNextToken = a })
grchResourceId :: Lens' GetResourceConfigHistory Text
grchResourceId = lens _grchResourceId (\s a -> s { _grchResourceId = a })
grchResourceType :: Lens' GetResourceConfigHistory ResourceType
grchResourceType = lens _grchResourceType (\s a -> s { _grchResourceType = a })
data GetResourceConfigHistoryResponse = GetResourceConfigHistoryResponse
{ _grchrConfigurationItems :: List "configurationItems" ConfigurationItem
, _grchrNextToken :: Maybe Text
} deriving (Eq, Read, Show)
getResourceConfigHistoryResponse :: GetResourceConfigHistoryResponse
getResourceConfigHistoryResponse = GetResourceConfigHistoryResponse
{ _grchrConfigurationItems = mempty
, _grchrNextToken = Nothing
}
grchrConfigurationItems :: Lens' GetResourceConfigHistoryResponse [ConfigurationItem]
grchrConfigurationItems =
lens _grchrConfigurationItems (\s a -> s { _grchrConfigurationItems = a })
. _List
grchrNextToken :: Lens' GetResourceConfigHistoryResponse (Maybe Text)
grchrNextToken = lens _grchrNextToken (\s a -> s { _grchrNextToken = a })
instance ToPath GetResourceConfigHistory where
toPath = const "/"
instance ToQuery GetResourceConfigHistory where
toQuery = const mempty
instance ToHeaders GetResourceConfigHistory
instance ToJSON GetResourceConfigHistory where
toJSON GetResourceConfigHistory{..} = object
[ "resourceType" .= _grchResourceType
, "resourceId" .= _grchResourceId
, "laterTime" .= _grchLaterTime
, "earlierTime" .= _grchEarlierTime
, "chronologicalOrder" .= _grchChronologicalOrder
, "limit" .= _grchLimit
, "nextToken" .= _grchNextToken
]
instance AWSRequest GetResourceConfigHistory where
type Sv GetResourceConfigHistory = Config
type Rs GetResourceConfigHistory = GetResourceConfigHistoryResponse
request = post "GetResourceConfigHistory"
response = jsonResponse
instance FromJSON GetResourceConfigHistoryResponse where
parseJSON = withObject "GetResourceConfigHistoryResponse" $ \o -> GetResourceConfigHistoryResponse
<$> o .:? "configurationItems" .!= mempty
<*> o .:? "nextToken"