{-# 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.ListConstraintsForPortfolio
(
listConstraintsForPortfolio
, ListConstraintsForPortfolio
, lcfpAcceptLanguage
, lcfpPageToken
, lcfpPageSize
, lcfpProductId
, lcfpPortfolioId
, listConstraintsForPortfolioResponse
, ListConstraintsForPortfolioResponse
, lcfprsNextPageToken
, lcfprsConstraintDetails
, lcfprsResponseStatus
) 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 ListConstraintsForPortfolio = ListConstraintsForPortfolio'
{ _lcfpAcceptLanguage :: !(Maybe Text)
, _lcfpPageToken :: !(Maybe Text)
, _lcfpPageSize :: !(Maybe Nat)
, _lcfpProductId :: !(Maybe Text)
, _lcfpPortfolioId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listConstraintsForPortfolio
:: Text
-> ListConstraintsForPortfolio
listConstraintsForPortfolio pPortfolioId_ =
ListConstraintsForPortfolio'
{ _lcfpAcceptLanguage = Nothing
, _lcfpPageToken = Nothing
, _lcfpPageSize = Nothing
, _lcfpProductId = Nothing
, _lcfpPortfolioId = pPortfolioId_
}
lcfpAcceptLanguage :: Lens' ListConstraintsForPortfolio (Maybe Text)
lcfpAcceptLanguage = lens _lcfpAcceptLanguage (\ s a -> s{_lcfpAcceptLanguage = a});
lcfpPageToken :: Lens' ListConstraintsForPortfolio (Maybe Text)
lcfpPageToken = lens _lcfpPageToken (\ s a -> s{_lcfpPageToken = a});
lcfpPageSize :: Lens' ListConstraintsForPortfolio (Maybe Natural)
lcfpPageSize = lens _lcfpPageSize (\ s a -> s{_lcfpPageSize = a}) . mapping _Nat;
lcfpProductId :: Lens' ListConstraintsForPortfolio (Maybe Text)
lcfpProductId = lens _lcfpProductId (\ s a -> s{_lcfpProductId = a});
lcfpPortfolioId :: Lens' ListConstraintsForPortfolio Text
lcfpPortfolioId = lens _lcfpPortfolioId (\ s a -> s{_lcfpPortfolioId = a});
instance AWSRequest ListConstraintsForPortfolio where
type Rs ListConstraintsForPortfolio =
ListConstraintsForPortfolioResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
ListConstraintsForPortfolioResponse' <$>
(x .?> "NextPageToken") <*>
(x .?> "ConstraintDetails" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable ListConstraintsForPortfolio
instance NFData ListConstraintsForPortfolio
instance ToHeaders ListConstraintsForPortfolio where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.ListConstraintsForPortfolio"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListConstraintsForPortfolio where
toJSON ListConstraintsForPortfolio'{..}
= object
(catMaybes
[("AcceptLanguage" .=) <$> _lcfpAcceptLanguage,
("PageToken" .=) <$> _lcfpPageToken,
("PageSize" .=) <$> _lcfpPageSize,
("ProductId" .=) <$> _lcfpProductId,
Just ("PortfolioId" .= _lcfpPortfolioId)])
instance ToPath ListConstraintsForPortfolio where
toPath = const "/"
instance ToQuery ListConstraintsForPortfolio where
toQuery = const mempty
data ListConstraintsForPortfolioResponse = ListConstraintsForPortfolioResponse'
{ _lcfprsNextPageToken :: !(Maybe Text)
, _lcfprsConstraintDetails :: !(Maybe [ConstraintDetail])
, _lcfprsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listConstraintsForPortfolioResponse
:: Int
-> ListConstraintsForPortfolioResponse
listConstraintsForPortfolioResponse pResponseStatus_ =
ListConstraintsForPortfolioResponse'
{ _lcfprsNextPageToken = Nothing
, _lcfprsConstraintDetails = Nothing
, _lcfprsResponseStatus = pResponseStatus_
}
lcfprsNextPageToken :: Lens' ListConstraintsForPortfolioResponse (Maybe Text)
lcfprsNextPageToken = lens _lcfprsNextPageToken (\ s a -> s{_lcfprsNextPageToken = a});
lcfprsConstraintDetails :: Lens' ListConstraintsForPortfolioResponse [ConstraintDetail]
lcfprsConstraintDetails = lens _lcfprsConstraintDetails (\ s a -> s{_lcfprsConstraintDetails = a}) . _Default . _Coerce;
lcfprsResponseStatus :: Lens' ListConstraintsForPortfolioResponse Int
lcfprsResponseStatus = lens _lcfprsResponseStatus (\ s a -> s{_lcfprsResponseStatus = a});
instance NFData ListConstraintsForPortfolioResponse