{-# 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.IoT.ListThingRegistrationTaskReports
(
listThingRegistrationTaskReports
, ListThingRegistrationTaskReports
, ltrtrNextToken
, ltrtrMaxResults
, ltrtrTaskId
, ltrtrReportType
, listThingRegistrationTaskReportsResponse
, ListThingRegistrationTaskReportsResponse
, ltrtrrsResourceLinks
, ltrtrrsNextToken
, ltrtrrsReportType
, ltrtrrsResponseStatus
) where
import Network.AWS.IoT.Types
import Network.AWS.IoT.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListThingRegistrationTaskReports = ListThingRegistrationTaskReports'
{ _ltrtrNextToken :: !(Maybe Text)
, _ltrtrMaxResults :: !(Maybe Nat)
, _ltrtrTaskId :: !Text
, _ltrtrReportType :: !ReportType
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listThingRegistrationTaskReports
:: Text
-> ReportType
-> ListThingRegistrationTaskReports
listThingRegistrationTaskReports pTaskId_ pReportType_ =
ListThingRegistrationTaskReports'
{ _ltrtrNextToken = Nothing
, _ltrtrMaxResults = Nothing
, _ltrtrTaskId = pTaskId_
, _ltrtrReportType = pReportType_
}
ltrtrNextToken :: Lens' ListThingRegistrationTaskReports (Maybe Text)
ltrtrNextToken = lens _ltrtrNextToken (\ s a -> s{_ltrtrNextToken = a})
ltrtrMaxResults :: Lens' ListThingRegistrationTaskReports (Maybe Natural)
ltrtrMaxResults = lens _ltrtrMaxResults (\ s a -> s{_ltrtrMaxResults = a}) . mapping _Nat
ltrtrTaskId :: Lens' ListThingRegistrationTaskReports Text
ltrtrTaskId = lens _ltrtrTaskId (\ s a -> s{_ltrtrTaskId = a})
ltrtrReportType :: Lens' ListThingRegistrationTaskReports ReportType
ltrtrReportType = lens _ltrtrReportType (\ s a -> s{_ltrtrReportType = a})
instance AWSRequest ListThingRegistrationTaskReports
where
type Rs ListThingRegistrationTaskReports =
ListThingRegistrationTaskReportsResponse
request = get ioT
response
= receiveJSON
(\ s h x ->
ListThingRegistrationTaskReportsResponse' <$>
(x .?> "resourceLinks" .!@ mempty) <*>
(x .?> "nextToken")
<*> (x .?> "reportType")
<*> (pure (fromEnum s)))
instance Hashable ListThingRegistrationTaskReports
where
instance NFData ListThingRegistrationTaskReports
where
instance ToHeaders ListThingRegistrationTaskReports
where
toHeaders = const mempty
instance ToPath ListThingRegistrationTaskReports
where
toPath ListThingRegistrationTaskReports'{..}
= mconcat
["/thing-registration-tasks/", toBS _ltrtrTaskId,
"/reports"]
instance ToQuery ListThingRegistrationTaskReports
where
toQuery ListThingRegistrationTaskReports'{..}
= mconcat
["nextToken" =: _ltrtrNextToken,
"maxResults" =: _ltrtrMaxResults,
"reportType" =: _ltrtrReportType]
data ListThingRegistrationTaskReportsResponse = ListThingRegistrationTaskReportsResponse'
{ _ltrtrrsResourceLinks :: !(Maybe [Text])
, _ltrtrrsNextToken :: !(Maybe Text)
, _ltrtrrsReportType :: !(Maybe ReportType)
, _ltrtrrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listThingRegistrationTaskReportsResponse
:: Int
-> ListThingRegistrationTaskReportsResponse
listThingRegistrationTaskReportsResponse pResponseStatus_ =
ListThingRegistrationTaskReportsResponse'
{ _ltrtrrsResourceLinks = Nothing
, _ltrtrrsNextToken = Nothing
, _ltrtrrsReportType = Nothing
, _ltrtrrsResponseStatus = pResponseStatus_
}
ltrtrrsResourceLinks :: Lens' ListThingRegistrationTaskReportsResponse [Text]
ltrtrrsResourceLinks = lens _ltrtrrsResourceLinks (\ s a -> s{_ltrtrrsResourceLinks = a}) . _Default . _Coerce
ltrtrrsNextToken :: Lens' ListThingRegistrationTaskReportsResponse (Maybe Text)
ltrtrrsNextToken = lens _ltrtrrsNextToken (\ s a -> s{_ltrtrrsNextToken = a})
ltrtrrsReportType :: Lens' ListThingRegistrationTaskReportsResponse (Maybe ReportType)
ltrtrrsReportType = lens _ltrtrrsReportType (\ s a -> s{_ltrtrrsReportType = a})
ltrtrrsResponseStatus :: Lens' ListThingRegistrationTaskReportsResponse Int
ltrtrrsResponseStatus = lens _ltrtrrsResponseStatus (\ s a -> s{_ltrtrrsResponseStatus = a})
instance NFData
ListThingRegistrationTaskReportsResponse
where