{-# 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.ListLaunchPaths
(
listLaunchPaths
, ListLaunchPaths
, llpAcceptLanguage
, llpPageToken
, llpPageSize
, llpProductId
, listLaunchPathsResponse
, ListLaunchPathsResponse
, llprsNextPageToken
, llprsLaunchPathSummaries
, llprsResponseStatus
) 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 ListLaunchPaths = ListLaunchPaths'
{ _llpAcceptLanguage :: !(Maybe Text)
, _llpPageToken :: !(Maybe Text)
, _llpPageSize :: !(Maybe Nat)
, _llpProductId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listLaunchPaths
:: Text
-> ListLaunchPaths
listLaunchPaths pProductId_ =
ListLaunchPaths'
{ _llpAcceptLanguage = Nothing
, _llpPageToken = Nothing
, _llpPageSize = Nothing
, _llpProductId = pProductId_
}
llpAcceptLanguage :: Lens' ListLaunchPaths (Maybe Text)
llpAcceptLanguage = lens _llpAcceptLanguage (\ s a -> s{_llpAcceptLanguage = a});
llpPageToken :: Lens' ListLaunchPaths (Maybe Text)
llpPageToken = lens _llpPageToken (\ s a -> s{_llpPageToken = a});
llpPageSize :: Lens' ListLaunchPaths (Maybe Natural)
llpPageSize = lens _llpPageSize (\ s a -> s{_llpPageSize = a}) . mapping _Nat;
llpProductId :: Lens' ListLaunchPaths Text
llpProductId = lens _llpProductId (\ s a -> s{_llpProductId = a});
instance AWSRequest ListLaunchPaths where
type Rs ListLaunchPaths = ListLaunchPathsResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
ListLaunchPathsResponse' <$>
(x .?> "NextPageToken") <*>
(x .?> "LaunchPathSummaries" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable ListLaunchPaths
instance NFData ListLaunchPaths
instance ToHeaders ListLaunchPaths where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.ListLaunchPaths" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListLaunchPaths where
toJSON ListLaunchPaths'{..}
= object
(catMaybes
[("AcceptLanguage" .=) <$> _llpAcceptLanguage,
("PageToken" .=) <$> _llpPageToken,
("PageSize" .=) <$> _llpPageSize,
Just ("ProductId" .= _llpProductId)])
instance ToPath ListLaunchPaths where
toPath = const "/"
instance ToQuery ListLaunchPaths where
toQuery = const mempty
data ListLaunchPathsResponse = ListLaunchPathsResponse'
{ _llprsNextPageToken :: !(Maybe Text)
, _llprsLaunchPathSummaries :: !(Maybe [LaunchPathSummary])
, _llprsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listLaunchPathsResponse
:: Int
-> ListLaunchPathsResponse
listLaunchPathsResponse pResponseStatus_ =
ListLaunchPathsResponse'
{ _llprsNextPageToken = Nothing
, _llprsLaunchPathSummaries = Nothing
, _llprsResponseStatus = pResponseStatus_
}
llprsNextPageToken :: Lens' ListLaunchPathsResponse (Maybe Text)
llprsNextPageToken = lens _llprsNextPageToken (\ s a -> s{_llprsNextPageToken = a});
llprsLaunchPathSummaries :: Lens' ListLaunchPathsResponse [LaunchPathSummary]
llprsLaunchPathSummaries = lens _llprsLaunchPathSummaries (\ s a -> s{_llprsLaunchPathSummaries = a}) . _Default . _Coerce;
llprsResponseStatus :: Lens' ListLaunchPathsResponse Int
llprsResponseStatus = lens _llprsResponseStatus (\ s a -> s{_llprsResponseStatus = a});
instance NFData ListLaunchPathsResponse