{-# 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.MQ.ListConfigurations
(
listConfigurations
, ListConfigurations
, lcNextToken
, lcMaxResults
, listConfigurationsResponse
, ListConfigurationsResponse
, lcrsConfigurations
, lcrsNextToken
, lcrsMaxResults
, lcrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.MQ.Types
import Network.AWS.MQ.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListConfigurations = ListConfigurations'
{ _lcNextToken :: !(Maybe Text)
, _lcMaxResults :: !(Maybe Nat)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listConfigurations
:: ListConfigurations
listConfigurations =
ListConfigurations' {_lcNextToken = Nothing, _lcMaxResults = Nothing}
lcNextToken :: Lens' ListConfigurations (Maybe Text)
lcNextToken = lens _lcNextToken (\ s a -> s{_lcNextToken = a})
lcMaxResults :: Lens' ListConfigurations (Maybe Natural)
lcMaxResults = lens _lcMaxResults (\ s a -> s{_lcMaxResults = a}) . mapping _Nat
instance AWSRequest ListConfigurations where
type Rs ListConfigurations =
ListConfigurationsResponse
request = get mq
response
= receiveJSON
(\ s h x ->
ListConfigurationsResponse' <$>
(x .?> "configurations" .!@ mempty) <*>
(x .?> "nextToken")
<*> (x .?> "maxResults")
<*> (pure (fromEnum s)))
instance Hashable ListConfigurations where
instance NFData ListConfigurations where
instance ToHeaders ListConfigurations where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath ListConfigurations where
toPath = const "/v1/configurations"
instance ToQuery ListConfigurations where
toQuery ListConfigurations'{..}
= mconcat
["nextToken" =: _lcNextToken,
"maxResults" =: _lcMaxResults]
data ListConfigurationsResponse = ListConfigurationsResponse'
{ _lcrsConfigurations :: !(Maybe [Configuration])
, _lcrsNextToken :: !(Maybe Text)
, _lcrsMaxResults :: !(Maybe Int)
, _lcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listConfigurationsResponse
:: Int
-> ListConfigurationsResponse
listConfigurationsResponse pResponseStatus_ =
ListConfigurationsResponse'
{ _lcrsConfigurations = Nothing
, _lcrsNextToken = Nothing
, _lcrsMaxResults = Nothing
, _lcrsResponseStatus = pResponseStatus_
}
lcrsConfigurations :: Lens' ListConfigurationsResponse [Configuration]
lcrsConfigurations = lens _lcrsConfigurations (\ s a -> s{_lcrsConfigurations = a}) . _Default . _Coerce
lcrsNextToken :: Lens' ListConfigurationsResponse (Maybe Text)
lcrsNextToken = lens _lcrsNextToken (\ s a -> s{_lcrsNextToken = a})
lcrsMaxResults :: Lens' ListConfigurationsResponse (Maybe Int)
lcrsMaxResults = lens _lcrsMaxResults (\ s a -> s{_lcrsMaxResults = a})
lcrsResponseStatus :: Lens' ListConfigurationsResponse Int
lcrsResponseStatus = lens _lcrsResponseStatus (\ s a -> s{_lcrsResponseStatus = a})
instance NFData ListConfigurationsResponse where