{-# 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.ListV2LoggingLevels
(
listV2LoggingLevels
, ListV2LoggingLevels
, lvllTargetType
, lvllNextToken
, lvllMaxResults
, listV2LoggingLevelsResponse
, ListV2LoggingLevelsResponse
, lvllrsLogTargetConfigurations
, lvllrsNextToken
, lvllrsResponseStatus
) 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 ListV2LoggingLevels = ListV2LoggingLevels'
{ _lvllTargetType :: !(Maybe LogTargetType)
, _lvllNextToken :: !(Maybe Text)
, _lvllMaxResults :: !(Maybe Nat)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listV2LoggingLevels
:: ListV2LoggingLevels
listV2LoggingLevels =
ListV2LoggingLevels'
{ _lvllTargetType = Nothing
, _lvllNextToken = Nothing
, _lvllMaxResults = Nothing
}
lvllTargetType :: Lens' ListV2LoggingLevels (Maybe LogTargetType)
lvllTargetType = lens _lvllTargetType (\ s a -> s{_lvllTargetType = a})
lvllNextToken :: Lens' ListV2LoggingLevels (Maybe Text)
lvllNextToken = lens _lvllNextToken (\ s a -> s{_lvllNextToken = a})
lvllMaxResults :: Lens' ListV2LoggingLevels (Maybe Natural)
lvllMaxResults = lens _lvllMaxResults (\ s a -> s{_lvllMaxResults = a}) . mapping _Nat
instance AWSRequest ListV2LoggingLevels where
type Rs ListV2LoggingLevels =
ListV2LoggingLevelsResponse
request = get ioT
response
= receiveJSON
(\ s h x ->
ListV2LoggingLevelsResponse' <$>
(x .?> "logTargetConfigurations" .!@ mempty) <*>
(x .?> "nextToken")
<*> (pure (fromEnum s)))
instance Hashable ListV2LoggingLevels where
instance NFData ListV2LoggingLevels where
instance ToHeaders ListV2LoggingLevels where
toHeaders = const mempty
instance ToPath ListV2LoggingLevels where
toPath = const "/v2LoggingLevel"
instance ToQuery ListV2LoggingLevels where
toQuery ListV2LoggingLevels'{..}
= mconcat
["targetType" =: _lvllTargetType,
"nextToken" =: _lvllNextToken,
"maxResults" =: _lvllMaxResults]
data ListV2LoggingLevelsResponse = ListV2LoggingLevelsResponse'
{ _lvllrsLogTargetConfigurations :: !(Maybe [LogTargetConfiguration])
, _lvllrsNextToken :: !(Maybe Text)
, _lvllrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listV2LoggingLevelsResponse
:: Int
-> ListV2LoggingLevelsResponse
listV2LoggingLevelsResponse pResponseStatus_ =
ListV2LoggingLevelsResponse'
{ _lvllrsLogTargetConfigurations = Nothing
, _lvllrsNextToken = Nothing
, _lvllrsResponseStatus = pResponseStatus_
}
lvllrsLogTargetConfigurations :: Lens' ListV2LoggingLevelsResponse [LogTargetConfiguration]
lvllrsLogTargetConfigurations = lens _lvllrsLogTargetConfigurations (\ s a -> s{_lvllrsLogTargetConfigurations = a}) . _Default . _Coerce
lvllrsNextToken :: Lens' ListV2LoggingLevelsResponse (Maybe Text)
lvllrsNextToken = lens _lvllrsNextToken (\ s a -> s{_lvllrsNextToken = a})
lvllrsResponseStatus :: Lens' ListV2LoggingLevelsResponse Int
lvllrsResponseStatus = lens _lvllrsResponseStatus (\ s a -> s{_lvllrsResponseStatus = a})
instance NFData ListV2LoggingLevelsResponse where