{-# 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.UpdateNotebookInstanceLifecycleConfig
(
updateNotebookInstanceLifecycleConfig
, UpdateNotebookInstanceLifecycleConfig
, unilcOnCreate
, unilcOnStart
, unilcNotebookInstanceLifecycleConfigName
, updateNotebookInstanceLifecycleConfigResponse
, UpdateNotebookInstanceLifecycleConfigResponse
, unilcrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SageMaker.Types
import Network.AWS.SageMaker.Types.Product
data UpdateNotebookInstanceLifecycleConfig = UpdateNotebookInstanceLifecycleConfig'
{ _unilcOnCreate :: !(Maybe [NotebookInstanceLifecycleHook])
, _unilcOnStart :: !(Maybe [NotebookInstanceLifecycleHook])
, _unilcNotebookInstanceLifecycleConfigName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateNotebookInstanceLifecycleConfig
:: Text
-> UpdateNotebookInstanceLifecycleConfig
updateNotebookInstanceLifecycleConfig pNotebookInstanceLifecycleConfigName_ =
UpdateNotebookInstanceLifecycleConfig'
{ _unilcOnCreate = Nothing
, _unilcOnStart = Nothing
, _unilcNotebookInstanceLifecycleConfigName =
pNotebookInstanceLifecycleConfigName_
}
unilcOnCreate :: Lens' UpdateNotebookInstanceLifecycleConfig [NotebookInstanceLifecycleHook]
unilcOnCreate = lens _unilcOnCreate (\ s a -> s{_unilcOnCreate = a}) . _Default . _Coerce
unilcOnStart :: Lens' UpdateNotebookInstanceLifecycleConfig [NotebookInstanceLifecycleHook]
unilcOnStart = lens _unilcOnStart (\ s a -> s{_unilcOnStart = a}) . _Default . _Coerce
unilcNotebookInstanceLifecycleConfigName :: Lens' UpdateNotebookInstanceLifecycleConfig Text
unilcNotebookInstanceLifecycleConfigName = lens _unilcNotebookInstanceLifecycleConfigName (\ s a -> s{_unilcNotebookInstanceLifecycleConfigName = a})
instance AWSRequest
UpdateNotebookInstanceLifecycleConfig
where
type Rs UpdateNotebookInstanceLifecycleConfig =
UpdateNotebookInstanceLifecycleConfigResponse
request = postJSON sageMaker
response
= receiveEmpty
(\ s h x ->
UpdateNotebookInstanceLifecycleConfigResponse' <$>
(pure (fromEnum s)))
instance Hashable
UpdateNotebookInstanceLifecycleConfig
where
instance NFData UpdateNotebookInstanceLifecycleConfig
where
instance ToHeaders
UpdateNotebookInstanceLifecycleConfig
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("SageMaker.UpdateNotebookInstanceLifecycleConfig" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateNotebookInstanceLifecycleConfig
where
toJSON UpdateNotebookInstanceLifecycleConfig'{..}
= object
(catMaybes
[("OnCreate" .=) <$> _unilcOnCreate,
("OnStart" .=) <$> _unilcOnStart,
Just
("NotebookInstanceLifecycleConfigName" .=
_unilcNotebookInstanceLifecycleConfigName)])
instance ToPath UpdateNotebookInstanceLifecycleConfig
where
toPath = const "/"
instance ToQuery
UpdateNotebookInstanceLifecycleConfig
where
toQuery = const mempty
newtype UpdateNotebookInstanceLifecycleConfigResponse = UpdateNotebookInstanceLifecycleConfigResponse'
{ _unilcrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateNotebookInstanceLifecycleConfigResponse
:: Int
-> UpdateNotebookInstanceLifecycleConfigResponse
updateNotebookInstanceLifecycleConfigResponse pResponseStatus_ =
UpdateNotebookInstanceLifecycleConfigResponse'
{_unilcrsResponseStatus = pResponseStatus_}
unilcrsResponseStatus :: Lens' UpdateNotebookInstanceLifecycleConfigResponse Int
unilcrsResponseStatus = lens _unilcrsResponseStatus (\ s a -> s{_unilcrsResponseStatus = a})
instance NFData
UpdateNotebookInstanceLifecycleConfigResponse
where