{-# 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.CreateNotebookInstanceLifecycleConfig
(
createNotebookInstanceLifecycleConfig
, CreateNotebookInstanceLifecycleConfig
, cnilcOnCreate
, cnilcOnStart
, cnilcNotebookInstanceLifecycleConfigName
, createNotebookInstanceLifecycleConfigResponse
, CreateNotebookInstanceLifecycleConfigResponse
, cnilcrsNotebookInstanceLifecycleConfigARN
, cnilcrsResponseStatus
) 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 CreateNotebookInstanceLifecycleConfig = CreateNotebookInstanceLifecycleConfig'
{ _cnilcOnCreate :: !(Maybe [NotebookInstanceLifecycleHook])
, _cnilcOnStart :: !(Maybe [NotebookInstanceLifecycleHook])
, _cnilcNotebookInstanceLifecycleConfigName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createNotebookInstanceLifecycleConfig
:: Text
-> CreateNotebookInstanceLifecycleConfig
createNotebookInstanceLifecycleConfig pNotebookInstanceLifecycleConfigName_ =
CreateNotebookInstanceLifecycleConfig'
{ _cnilcOnCreate = Nothing
, _cnilcOnStart = Nothing
, _cnilcNotebookInstanceLifecycleConfigName =
pNotebookInstanceLifecycleConfigName_
}
cnilcOnCreate :: Lens' CreateNotebookInstanceLifecycleConfig [NotebookInstanceLifecycleHook]
cnilcOnCreate = lens _cnilcOnCreate (\ s a -> s{_cnilcOnCreate = a}) . _Default . _Coerce
cnilcOnStart :: Lens' CreateNotebookInstanceLifecycleConfig [NotebookInstanceLifecycleHook]
cnilcOnStart = lens _cnilcOnStart (\ s a -> s{_cnilcOnStart = a}) . _Default . _Coerce
cnilcNotebookInstanceLifecycleConfigName :: Lens' CreateNotebookInstanceLifecycleConfig Text
cnilcNotebookInstanceLifecycleConfigName = lens _cnilcNotebookInstanceLifecycleConfigName (\ s a -> s{_cnilcNotebookInstanceLifecycleConfigName = a})
instance AWSRequest
CreateNotebookInstanceLifecycleConfig
where
type Rs CreateNotebookInstanceLifecycleConfig =
CreateNotebookInstanceLifecycleConfigResponse
request = postJSON sageMaker
response
= receiveJSON
(\ s h x ->
CreateNotebookInstanceLifecycleConfigResponse' <$>
(x .?> "NotebookInstanceLifecycleConfigArn") <*>
(pure (fromEnum s)))
instance Hashable
CreateNotebookInstanceLifecycleConfig
where
instance NFData CreateNotebookInstanceLifecycleConfig
where
instance ToHeaders
CreateNotebookInstanceLifecycleConfig
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("SageMaker.CreateNotebookInstanceLifecycleConfig" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateNotebookInstanceLifecycleConfig
where
toJSON CreateNotebookInstanceLifecycleConfig'{..}
= object
(catMaybes
[("OnCreate" .=) <$> _cnilcOnCreate,
("OnStart" .=) <$> _cnilcOnStart,
Just
("NotebookInstanceLifecycleConfigName" .=
_cnilcNotebookInstanceLifecycleConfigName)])
instance ToPath CreateNotebookInstanceLifecycleConfig
where
toPath = const "/"
instance ToQuery
CreateNotebookInstanceLifecycleConfig
where
toQuery = const mempty
data CreateNotebookInstanceLifecycleConfigResponse = CreateNotebookInstanceLifecycleConfigResponse'
{ _cnilcrsNotebookInstanceLifecycleConfigARN :: !(Maybe Text)
, _cnilcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createNotebookInstanceLifecycleConfigResponse
:: Int
-> CreateNotebookInstanceLifecycleConfigResponse
createNotebookInstanceLifecycleConfigResponse pResponseStatus_ =
CreateNotebookInstanceLifecycleConfigResponse'
{ _cnilcrsNotebookInstanceLifecycleConfigARN = Nothing
, _cnilcrsResponseStatus = pResponseStatus_
}
cnilcrsNotebookInstanceLifecycleConfigARN :: Lens' CreateNotebookInstanceLifecycleConfigResponse (Maybe Text)
cnilcrsNotebookInstanceLifecycleConfigARN = lens _cnilcrsNotebookInstanceLifecycleConfigARN (\ s a -> s{_cnilcrsNotebookInstanceLifecycleConfigARN = a})
cnilcrsResponseStatus :: Lens' CreateNotebookInstanceLifecycleConfigResponse Int
cnilcrsResponseStatus = lens _cnilcrsResponseStatus (\ s a -> s{_cnilcrsResponseStatus = a})
instance NFData
CreateNotebookInstanceLifecycleConfigResponse
where