{-# 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.SageMaker.ListNotebookInstances
(
listNotebookInstances
, ListNotebookInstances
, lniNameContains
, lniLastModifiedTimeBefore
, lniNotebookInstanceLifecycleConfigNameContains
, lniCreationTimeAfter
, lniNextToken
, lniSortOrder
, lniLastModifiedTimeAfter
, lniCreationTimeBefore
, lniStatusEquals
, lniMaxResults
, lniSortBy
, listNotebookInstancesResponse
, ListNotebookInstancesResponse
, lnirsNotebookInstances
, lnirsNextToken
, lnirsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SageMaker.Types
import Network.AWS.SageMaker.Types.Product
data ListNotebookInstances = ListNotebookInstances'
{ _lniNameContains :: !(Maybe Text)
, _lniLastModifiedTimeBefore :: !(Maybe POSIX)
, _lniNotebookInstanceLifecycleConfigNameContains :: !(Maybe Text)
, _lniCreationTimeAfter :: !(Maybe POSIX)
, _lniNextToken :: !(Maybe Text)
, _lniSortOrder :: !(Maybe NotebookInstanceSortOrder)
, _lniLastModifiedTimeAfter :: !(Maybe POSIX)
, _lniCreationTimeBefore :: !(Maybe POSIX)
, _lniStatusEquals :: !(Maybe NotebookInstanceStatus)
, _lniMaxResults :: !(Maybe Nat)
, _lniSortBy :: !(Maybe NotebookInstanceSortKey)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listNotebookInstances
:: ListNotebookInstances
listNotebookInstances =
ListNotebookInstances'
{ _lniNameContains = Nothing
, _lniLastModifiedTimeBefore = Nothing
, _lniNotebookInstanceLifecycleConfigNameContains = Nothing
, _lniCreationTimeAfter = Nothing
, _lniNextToken = Nothing
, _lniSortOrder = Nothing
, _lniLastModifiedTimeAfter = Nothing
, _lniCreationTimeBefore = Nothing
, _lniStatusEquals = Nothing
, _lniMaxResults = Nothing
, _lniSortBy = Nothing
}
lniNameContains :: Lens' ListNotebookInstances (Maybe Text)
lniNameContains = lens _lniNameContains (\ s a -> s{_lniNameContains = a})
lniLastModifiedTimeBefore :: Lens' ListNotebookInstances (Maybe UTCTime)
lniLastModifiedTimeBefore = lens _lniLastModifiedTimeBefore (\ s a -> s{_lniLastModifiedTimeBefore = a}) . mapping _Time
lniNotebookInstanceLifecycleConfigNameContains :: Lens' ListNotebookInstances (Maybe Text)
lniNotebookInstanceLifecycleConfigNameContains = lens _lniNotebookInstanceLifecycleConfigNameContains (\ s a -> s{_lniNotebookInstanceLifecycleConfigNameContains = a})
lniCreationTimeAfter :: Lens' ListNotebookInstances (Maybe UTCTime)
lniCreationTimeAfter = lens _lniCreationTimeAfter (\ s a -> s{_lniCreationTimeAfter = a}) . mapping _Time
lniNextToken :: Lens' ListNotebookInstances (Maybe Text)
lniNextToken = lens _lniNextToken (\ s a -> s{_lniNextToken = a})
lniSortOrder :: Lens' ListNotebookInstances (Maybe NotebookInstanceSortOrder)
lniSortOrder = lens _lniSortOrder (\ s a -> s{_lniSortOrder = a})
lniLastModifiedTimeAfter :: Lens' ListNotebookInstances (Maybe UTCTime)
lniLastModifiedTimeAfter = lens _lniLastModifiedTimeAfter (\ s a -> s{_lniLastModifiedTimeAfter = a}) . mapping _Time
lniCreationTimeBefore :: Lens' ListNotebookInstances (Maybe UTCTime)
lniCreationTimeBefore = lens _lniCreationTimeBefore (\ s a -> s{_lniCreationTimeBefore = a}) . mapping _Time
lniStatusEquals :: Lens' ListNotebookInstances (Maybe NotebookInstanceStatus)
lniStatusEquals = lens _lniStatusEquals (\ s a -> s{_lniStatusEquals = a})
lniMaxResults :: Lens' ListNotebookInstances (Maybe Natural)
lniMaxResults = lens _lniMaxResults (\ s a -> s{_lniMaxResults = a}) . mapping _Nat
lniSortBy :: Lens' ListNotebookInstances (Maybe NotebookInstanceSortKey)
lniSortBy = lens _lniSortBy (\ s a -> s{_lniSortBy = a})
instance AWSPager ListNotebookInstances where
page rq rs
| stop (rs ^. lnirsNextToken) = Nothing
| stop (rs ^. lnirsNotebookInstances) = Nothing
| otherwise =
Just $ rq & lniNextToken .~ rs ^. lnirsNextToken
instance AWSRequest ListNotebookInstances where
type Rs ListNotebookInstances =
ListNotebookInstancesResponse
request = postJSON sageMaker
response
= receiveJSON
(\ s h x ->
ListNotebookInstancesResponse' <$>
(x .?> "NotebookInstances" .!@ mempty) <*>
(x .?> "NextToken")
<*> (pure (fromEnum s)))
instance Hashable ListNotebookInstances where
instance NFData ListNotebookInstances where
instance ToHeaders ListNotebookInstances where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("SageMaker.ListNotebookInstances" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListNotebookInstances where
toJSON ListNotebookInstances'{..}
= object
(catMaybes
[("NameContains" .=) <$> _lniNameContains,
("LastModifiedTimeBefore" .=) <$>
_lniLastModifiedTimeBefore,
("NotebookInstanceLifecycleConfigNameContains" .=)
<$> _lniNotebookInstanceLifecycleConfigNameContains,
("CreationTimeAfter" .=) <$> _lniCreationTimeAfter,
("NextToken" .=) <$> _lniNextToken,
("SortOrder" .=) <$> _lniSortOrder,
("LastModifiedTimeAfter" .=) <$>
_lniLastModifiedTimeAfter,
("CreationTimeBefore" .=) <$> _lniCreationTimeBefore,
("StatusEquals" .=) <$> _lniStatusEquals,
("MaxResults" .=) <$> _lniMaxResults,
("SortBy" .=) <$> _lniSortBy])
instance ToPath ListNotebookInstances where
toPath = const "/"
instance ToQuery ListNotebookInstances where
toQuery = const mempty
data ListNotebookInstancesResponse = ListNotebookInstancesResponse'
{ _lnirsNotebookInstances :: !(Maybe [NotebookInstanceSummary])
, _lnirsNextToken :: !(Maybe Text)
, _lnirsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listNotebookInstancesResponse
:: Int
-> ListNotebookInstancesResponse
listNotebookInstancesResponse pResponseStatus_ =
ListNotebookInstancesResponse'
{ _lnirsNotebookInstances = Nothing
, _lnirsNextToken = Nothing
, _lnirsResponseStatus = pResponseStatus_
}
lnirsNotebookInstances :: Lens' ListNotebookInstancesResponse [NotebookInstanceSummary]
lnirsNotebookInstances = lens _lnirsNotebookInstances (\ s a -> s{_lnirsNotebookInstances = a}) . _Default . _Coerce
lnirsNextToken :: Lens' ListNotebookInstancesResponse (Maybe Text)
lnirsNextToken = lens _lnirsNextToken (\ s a -> s{_lnirsNextToken = a})
lnirsResponseStatus :: Lens' ListNotebookInstancesResponse Int
lnirsResponseStatus = lens _lnirsResponseStatus (\ s a -> s{_lnirsResponseStatus = a})
instance NFData ListNotebookInstancesResponse where