{-# 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.ServiceCatalog.ListRecordHistory
(
listRecordHistory
, ListRecordHistory
, lrhSearchFilter
, lrhAcceptLanguage
, lrhAccessLevelFilter
, lrhPageToken
, lrhPageSize
, listRecordHistoryResponse
, ListRecordHistoryResponse
, lrhrsNextPageToken
, lrhrsRecordDetails
, lrhrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.ServiceCatalog.Types
import Network.AWS.ServiceCatalog.Types.Product
data ListRecordHistory = ListRecordHistory'
{ _lrhSearchFilter :: !(Maybe ListRecordHistorySearchFilter)
, _lrhAcceptLanguage :: !(Maybe Text)
, _lrhAccessLevelFilter :: !(Maybe AccessLevelFilter)
, _lrhPageToken :: !(Maybe Text)
, _lrhPageSize :: !(Maybe Nat)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listRecordHistory
:: ListRecordHistory
listRecordHistory =
ListRecordHistory'
{ _lrhSearchFilter = Nothing
, _lrhAcceptLanguage = Nothing
, _lrhAccessLevelFilter = Nothing
, _lrhPageToken = Nothing
, _lrhPageSize = Nothing
}
lrhSearchFilter :: Lens' ListRecordHistory (Maybe ListRecordHistorySearchFilter)
lrhSearchFilter = lens _lrhSearchFilter (\ s a -> s{_lrhSearchFilter = a});
lrhAcceptLanguage :: Lens' ListRecordHistory (Maybe Text)
lrhAcceptLanguage = lens _lrhAcceptLanguage (\ s a -> s{_lrhAcceptLanguage = a});
lrhAccessLevelFilter :: Lens' ListRecordHistory (Maybe AccessLevelFilter)
lrhAccessLevelFilter = lens _lrhAccessLevelFilter (\ s a -> s{_lrhAccessLevelFilter = a});
lrhPageToken :: Lens' ListRecordHistory (Maybe Text)
lrhPageToken = lens _lrhPageToken (\ s a -> s{_lrhPageToken = a});
lrhPageSize :: Lens' ListRecordHistory (Maybe Natural)
lrhPageSize = lens _lrhPageSize (\ s a -> s{_lrhPageSize = a}) . mapping _Nat;
instance AWSRequest ListRecordHistory where
type Rs ListRecordHistory = ListRecordHistoryResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
ListRecordHistoryResponse' <$>
(x .?> "NextPageToken") <*>
(x .?> "RecordDetails" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable ListRecordHistory
instance NFData ListRecordHistory
instance ToHeaders ListRecordHistory where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.ListRecordHistory" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListRecordHistory where
toJSON ListRecordHistory'{..}
= object
(catMaybes
[("SearchFilter" .=) <$> _lrhSearchFilter,
("AcceptLanguage" .=) <$> _lrhAcceptLanguage,
("AccessLevelFilter" .=) <$> _lrhAccessLevelFilter,
("PageToken" .=) <$> _lrhPageToken,
("PageSize" .=) <$> _lrhPageSize])
instance ToPath ListRecordHistory where
toPath = const "/"
instance ToQuery ListRecordHistory where
toQuery = const mempty
data ListRecordHistoryResponse = ListRecordHistoryResponse'
{ _lrhrsNextPageToken :: !(Maybe Text)
, _lrhrsRecordDetails :: !(Maybe [RecordDetail])
, _lrhrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listRecordHistoryResponse
:: Int
-> ListRecordHistoryResponse
listRecordHistoryResponse pResponseStatus_ =
ListRecordHistoryResponse'
{ _lrhrsNextPageToken = Nothing
, _lrhrsRecordDetails = Nothing
, _lrhrsResponseStatus = pResponseStatus_
}
lrhrsNextPageToken :: Lens' ListRecordHistoryResponse (Maybe Text)
lrhrsNextPageToken = lens _lrhrsNextPageToken (\ s a -> s{_lrhrsNextPageToken = a});
lrhrsRecordDetails :: Lens' ListRecordHistoryResponse [RecordDetail]
lrhrsRecordDetails = lens _lrhrsRecordDetails (\ s a -> s{_lrhrsRecordDetails = a}) . _Default . _Coerce;
lrhrsResponseStatus :: Lens' ListRecordHistoryResponse Int
lrhrsResponseStatus = lens _lrhrsResponseStatus (\ s a -> s{_lrhrsResponseStatus = a});
instance NFData ListRecordHistoryResponse