{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SageMaker.CreateNotebookInstanceLifecycleConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a lifecycle configuration that you can associate with a notebook
-- instance. A /lifecycle configuration/ is a collection of shell scripts
-- that run when you create or start a notebook instance.
--
-- Each lifecycle configuration script has a limit of 16384 characters.
--
-- The value of the @$PATH@ environment variable that is available to both
-- scripts is @\/sbin:bin:\/usr\/sbin:\/usr\/bin@.
--
-- View CloudWatch Logs for notebook instance lifecycle configurations in
-- log group @\/aws\/sagemaker\/NotebookInstances@ in log stream
-- @[notebook-instance-name]\/[LifecycleConfigHook]@.
--
-- Lifecycle configuration scripts cannot run for longer than 5 minutes. If
-- a script runs for longer than 5 minutes, it fails and the notebook
-- instance is not created or started.
--
-- For information about notebook instance lifestyle configurations, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html Step 2.1: (Optional) Customize a Notebook Instance>.
module Amazonka.SageMaker.CreateNotebookInstanceLifecycleConfig
  ( -- * Creating a Request
    CreateNotebookInstanceLifecycleConfig (..),
    newCreateNotebookInstanceLifecycleConfig,

    -- * Request Lenses
    createNotebookInstanceLifecycleConfig_onCreate,
    createNotebookInstanceLifecycleConfig_onStart,
    createNotebookInstanceLifecycleConfig_notebookInstanceLifecycleConfigName,

    -- * Destructuring the Response
    CreateNotebookInstanceLifecycleConfigResponse (..),
    newCreateNotebookInstanceLifecycleConfigResponse,

    -- * Response Lenses
    createNotebookInstanceLifecycleConfigResponse_notebookInstanceLifecycleConfigArn,
    createNotebookInstanceLifecycleConfigResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types

-- | /See:/ 'newCreateNotebookInstanceLifecycleConfig' smart constructor.
data CreateNotebookInstanceLifecycleConfig = CreateNotebookInstanceLifecycleConfig'
  { -- | A shell script that runs only once, when you create a notebook instance.
    -- The shell script must be a base64-encoded string.
    CreateNotebookInstanceLifecycleConfig
-> Maybe [NotebookInstanceLifecycleHook]
onCreate :: Prelude.Maybe [NotebookInstanceLifecycleHook],
    -- | A shell script that runs every time you start a notebook instance,
    -- including when you create the notebook instance. The shell script must
    -- be a base64-encoded string.
    CreateNotebookInstanceLifecycleConfig
-> Maybe [NotebookInstanceLifecycleHook]
onStart :: Prelude.Maybe [NotebookInstanceLifecycleHook],
    -- | The name of the lifecycle configuration.
    CreateNotebookInstanceLifecycleConfig -> Text
notebookInstanceLifecycleConfigName :: Prelude.Text
  }
  deriving (CreateNotebookInstanceLifecycleConfig
-> CreateNotebookInstanceLifecycleConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNotebookInstanceLifecycleConfig
-> CreateNotebookInstanceLifecycleConfig -> Bool
$c/= :: CreateNotebookInstanceLifecycleConfig
-> CreateNotebookInstanceLifecycleConfig -> Bool
== :: CreateNotebookInstanceLifecycleConfig
-> CreateNotebookInstanceLifecycleConfig -> Bool
$c== :: CreateNotebookInstanceLifecycleConfig
-> CreateNotebookInstanceLifecycleConfig -> Bool
Prelude.Eq, ReadPrec [CreateNotebookInstanceLifecycleConfig]
ReadPrec CreateNotebookInstanceLifecycleConfig
Int -> ReadS CreateNotebookInstanceLifecycleConfig
ReadS [CreateNotebookInstanceLifecycleConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateNotebookInstanceLifecycleConfig]
$creadListPrec :: ReadPrec [CreateNotebookInstanceLifecycleConfig]
readPrec :: ReadPrec CreateNotebookInstanceLifecycleConfig
$creadPrec :: ReadPrec CreateNotebookInstanceLifecycleConfig
readList :: ReadS [CreateNotebookInstanceLifecycleConfig]
$creadList :: ReadS [CreateNotebookInstanceLifecycleConfig]
readsPrec :: Int -> ReadS CreateNotebookInstanceLifecycleConfig
$creadsPrec :: Int -> ReadS CreateNotebookInstanceLifecycleConfig
Prelude.Read, Int -> CreateNotebookInstanceLifecycleConfig -> ShowS
[CreateNotebookInstanceLifecycleConfig] -> ShowS
CreateNotebookInstanceLifecycleConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNotebookInstanceLifecycleConfig] -> ShowS
$cshowList :: [CreateNotebookInstanceLifecycleConfig] -> ShowS
show :: CreateNotebookInstanceLifecycleConfig -> String
$cshow :: CreateNotebookInstanceLifecycleConfig -> String
showsPrec :: Int -> CreateNotebookInstanceLifecycleConfig -> ShowS
$cshowsPrec :: Int -> CreateNotebookInstanceLifecycleConfig -> ShowS
Prelude.Show, forall x.
Rep CreateNotebookInstanceLifecycleConfig x
-> CreateNotebookInstanceLifecycleConfig
forall x.
CreateNotebookInstanceLifecycleConfig
-> Rep CreateNotebookInstanceLifecycleConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateNotebookInstanceLifecycleConfig x
-> CreateNotebookInstanceLifecycleConfig
$cfrom :: forall x.
CreateNotebookInstanceLifecycleConfig
-> Rep CreateNotebookInstanceLifecycleConfig x
Prelude.Generic)

-- |
-- Create a value of 'CreateNotebookInstanceLifecycleConfig' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'onCreate', 'createNotebookInstanceLifecycleConfig_onCreate' - A shell script that runs only once, when you create a notebook instance.
-- The shell script must be a base64-encoded string.
--
-- 'onStart', 'createNotebookInstanceLifecycleConfig_onStart' - A shell script that runs every time you start a notebook instance,
-- including when you create the notebook instance. The shell script must
-- be a base64-encoded string.
--
-- 'notebookInstanceLifecycleConfigName', 'createNotebookInstanceLifecycleConfig_notebookInstanceLifecycleConfigName' - The name of the lifecycle configuration.
newCreateNotebookInstanceLifecycleConfig ::
  -- | 'notebookInstanceLifecycleConfigName'
  Prelude.Text ->
  CreateNotebookInstanceLifecycleConfig
newCreateNotebookInstanceLifecycleConfig :: Text -> CreateNotebookInstanceLifecycleConfig
newCreateNotebookInstanceLifecycleConfig
  Text
pNotebookInstanceLifecycleConfigName_ =
    CreateNotebookInstanceLifecycleConfig'
      { $sel:onCreate:CreateNotebookInstanceLifecycleConfig' :: Maybe [NotebookInstanceLifecycleHook]
onCreate =
          forall a. Maybe a
Prelude.Nothing,
        $sel:onStart:CreateNotebookInstanceLifecycleConfig' :: Maybe [NotebookInstanceLifecycleHook]
onStart = forall a. Maybe a
Prelude.Nothing,
        $sel:notebookInstanceLifecycleConfigName:CreateNotebookInstanceLifecycleConfig' :: Text
notebookInstanceLifecycleConfigName =
          Text
pNotebookInstanceLifecycleConfigName_
      }

-- | A shell script that runs only once, when you create a notebook instance.
-- The shell script must be a base64-encoded string.
createNotebookInstanceLifecycleConfig_onCreate :: Lens.Lens' CreateNotebookInstanceLifecycleConfig (Prelude.Maybe [NotebookInstanceLifecycleHook])
createNotebookInstanceLifecycleConfig_onCreate :: Lens'
  CreateNotebookInstanceLifecycleConfig
  (Maybe [NotebookInstanceLifecycleHook])
createNotebookInstanceLifecycleConfig_onCreate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstanceLifecycleConfig' {Maybe [NotebookInstanceLifecycleHook]
onCreate :: Maybe [NotebookInstanceLifecycleHook]
$sel:onCreate:CreateNotebookInstanceLifecycleConfig' :: CreateNotebookInstanceLifecycleConfig
-> Maybe [NotebookInstanceLifecycleHook]
onCreate} -> Maybe [NotebookInstanceLifecycleHook]
onCreate) (\s :: CreateNotebookInstanceLifecycleConfig
s@CreateNotebookInstanceLifecycleConfig' {} Maybe [NotebookInstanceLifecycleHook]
a -> CreateNotebookInstanceLifecycleConfig
s {$sel:onCreate:CreateNotebookInstanceLifecycleConfig' :: Maybe [NotebookInstanceLifecycleHook]
onCreate = Maybe [NotebookInstanceLifecycleHook]
a} :: CreateNotebookInstanceLifecycleConfig) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A shell script that runs every time you start a notebook instance,
-- including when you create the notebook instance. The shell script must
-- be a base64-encoded string.
createNotebookInstanceLifecycleConfig_onStart :: Lens.Lens' CreateNotebookInstanceLifecycleConfig (Prelude.Maybe [NotebookInstanceLifecycleHook])
createNotebookInstanceLifecycleConfig_onStart :: Lens'
  CreateNotebookInstanceLifecycleConfig
  (Maybe [NotebookInstanceLifecycleHook])
createNotebookInstanceLifecycleConfig_onStart = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstanceLifecycleConfig' {Maybe [NotebookInstanceLifecycleHook]
onStart :: Maybe [NotebookInstanceLifecycleHook]
$sel:onStart:CreateNotebookInstanceLifecycleConfig' :: CreateNotebookInstanceLifecycleConfig
-> Maybe [NotebookInstanceLifecycleHook]
onStart} -> Maybe [NotebookInstanceLifecycleHook]
onStart) (\s :: CreateNotebookInstanceLifecycleConfig
s@CreateNotebookInstanceLifecycleConfig' {} Maybe [NotebookInstanceLifecycleHook]
a -> CreateNotebookInstanceLifecycleConfig
s {$sel:onStart:CreateNotebookInstanceLifecycleConfig' :: Maybe [NotebookInstanceLifecycleHook]
onStart = Maybe [NotebookInstanceLifecycleHook]
a} :: CreateNotebookInstanceLifecycleConfig) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the lifecycle configuration.
createNotebookInstanceLifecycleConfig_notebookInstanceLifecycleConfigName :: Lens.Lens' CreateNotebookInstanceLifecycleConfig Prelude.Text
createNotebookInstanceLifecycleConfig_notebookInstanceLifecycleConfigName :: Lens' CreateNotebookInstanceLifecycleConfig Text
createNotebookInstanceLifecycleConfig_notebookInstanceLifecycleConfigName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstanceLifecycleConfig' {Text
notebookInstanceLifecycleConfigName :: Text
$sel:notebookInstanceLifecycleConfigName:CreateNotebookInstanceLifecycleConfig' :: CreateNotebookInstanceLifecycleConfig -> Text
notebookInstanceLifecycleConfigName} -> Text
notebookInstanceLifecycleConfigName) (\s :: CreateNotebookInstanceLifecycleConfig
s@CreateNotebookInstanceLifecycleConfig' {} Text
a -> CreateNotebookInstanceLifecycleConfig
s {$sel:notebookInstanceLifecycleConfigName:CreateNotebookInstanceLifecycleConfig' :: Text
notebookInstanceLifecycleConfigName = Text
a} :: CreateNotebookInstanceLifecycleConfig)

instance
  Core.AWSRequest
    CreateNotebookInstanceLifecycleConfig
  where
  type
    AWSResponse
      CreateNotebookInstanceLifecycleConfig =
      CreateNotebookInstanceLifecycleConfigResponse
  request :: (Service -> Service)
-> CreateNotebookInstanceLifecycleConfig
-> Request CreateNotebookInstanceLifecycleConfig
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateNotebookInstanceLifecycleConfig
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateNotebookInstanceLifecycleConfig)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateNotebookInstanceLifecycleConfigResponse
CreateNotebookInstanceLifecycleConfigResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NotebookInstanceLifecycleConfigArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    CreateNotebookInstanceLifecycleConfig
  where
  hashWithSalt :: Int -> CreateNotebookInstanceLifecycleConfig -> Int
hashWithSalt
    Int
_salt
    CreateNotebookInstanceLifecycleConfig' {Maybe [NotebookInstanceLifecycleHook]
Text
notebookInstanceLifecycleConfigName :: Text
onStart :: Maybe [NotebookInstanceLifecycleHook]
onCreate :: Maybe [NotebookInstanceLifecycleHook]
$sel:notebookInstanceLifecycleConfigName:CreateNotebookInstanceLifecycleConfig' :: CreateNotebookInstanceLifecycleConfig -> Text
$sel:onStart:CreateNotebookInstanceLifecycleConfig' :: CreateNotebookInstanceLifecycleConfig
-> Maybe [NotebookInstanceLifecycleHook]
$sel:onCreate:CreateNotebookInstanceLifecycleConfig' :: CreateNotebookInstanceLifecycleConfig
-> Maybe [NotebookInstanceLifecycleHook]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [NotebookInstanceLifecycleHook]
onCreate
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [NotebookInstanceLifecycleHook]
onStart
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
notebookInstanceLifecycleConfigName

instance
  Prelude.NFData
    CreateNotebookInstanceLifecycleConfig
  where
  rnf :: CreateNotebookInstanceLifecycleConfig -> ()
rnf CreateNotebookInstanceLifecycleConfig' {Maybe [NotebookInstanceLifecycleHook]
Text
notebookInstanceLifecycleConfigName :: Text
onStart :: Maybe [NotebookInstanceLifecycleHook]
onCreate :: Maybe [NotebookInstanceLifecycleHook]
$sel:notebookInstanceLifecycleConfigName:CreateNotebookInstanceLifecycleConfig' :: CreateNotebookInstanceLifecycleConfig -> Text
$sel:onStart:CreateNotebookInstanceLifecycleConfig' :: CreateNotebookInstanceLifecycleConfig
-> Maybe [NotebookInstanceLifecycleHook]
$sel:onCreate:CreateNotebookInstanceLifecycleConfig' :: CreateNotebookInstanceLifecycleConfig
-> Maybe [NotebookInstanceLifecycleHook]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [NotebookInstanceLifecycleHook]
onCreate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [NotebookInstanceLifecycleHook]
onStart
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
notebookInstanceLifecycleConfigName

instance
  Data.ToHeaders
    CreateNotebookInstanceLifecycleConfig
  where
  toHeaders :: CreateNotebookInstanceLifecycleConfig -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"SageMaker.CreateNotebookInstanceLifecycleConfig" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Data.ToJSON
    CreateNotebookInstanceLifecycleConfig
  where
  toJSON :: CreateNotebookInstanceLifecycleConfig -> Value
toJSON CreateNotebookInstanceLifecycleConfig' {Maybe [NotebookInstanceLifecycleHook]
Text
notebookInstanceLifecycleConfigName :: Text
onStart :: Maybe [NotebookInstanceLifecycleHook]
onCreate :: Maybe [NotebookInstanceLifecycleHook]
$sel:notebookInstanceLifecycleConfigName:CreateNotebookInstanceLifecycleConfig' :: CreateNotebookInstanceLifecycleConfig -> Text
$sel:onStart:CreateNotebookInstanceLifecycleConfig' :: CreateNotebookInstanceLifecycleConfig
-> Maybe [NotebookInstanceLifecycleHook]
$sel:onCreate:CreateNotebookInstanceLifecycleConfig' :: CreateNotebookInstanceLifecycleConfig
-> Maybe [NotebookInstanceLifecycleHook]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"OnCreate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [NotebookInstanceLifecycleHook]
onCreate,
            (Key
"OnStart" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [NotebookInstanceLifecycleHook]
onStart,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"NotebookInstanceLifecycleConfigName"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
notebookInstanceLifecycleConfigName
              )
          ]
      )

instance
  Data.ToPath
    CreateNotebookInstanceLifecycleConfig
  where
  toPath :: CreateNotebookInstanceLifecycleConfig -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance
  Data.ToQuery
    CreateNotebookInstanceLifecycleConfig
  where
  toQuery :: CreateNotebookInstanceLifecycleConfig -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateNotebookInstanceLifecycleConfigResponse' smart constructor.
data CreateNotebookInstanceLifecycleConfigResponse = CreateNotebookInstanceLifecycleConfigResponse'
  { -- | The Amazon Resource Name (ARN) of the lifecycle configuration.
    CreateNotebookInstanceLifecycleConfigResponse -> Maybe Text
notebookInstanceLifecycleConfigArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateNotebookInstanceLifecycleConfigResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateNotebookInstanceLifecycleConfigResponse
-> CreateNotebookInstanceLifecycleConfigResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNotebookInstanceLifecycleConfigResponse
-> CreateNotebookInstanceLifecycleConfigResponse -> Bool
$c/= :: CreateNotebookInstanceLifecycleConfigResponse
-> CreateNotebookInstanceLifecycleConfigResponse -> Bool
== :: CreateNotebookInstanceLifecycleConfigResponse
-> CreateNotebookInstanceLifecycleConfigResponse -> Bool
$c== :: CreateNotebookInstanceLifecycleConfigResponse
-> CreateNotebookInstanceLifecycleConfigResponse -> Bool
Prelude.Eq, ReadPrec [CreateNotebookInstanceLifecycleConfigResponse]
ReadPrec CreateNotebookInstanceLifecycleConfigResponse
Int -> ReadS CreateNotebookInstanceLifecycleConfigResponse
ReadS [CreateNotebookInstanceLifecycleConfigResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateNotebookInstanceLifecycleConfigResponse]
$creadListPrec :: ReadPrec [CreateNotebookInstanceLifecycleConfigResponse]
readPrec :: ReadPrec CreateNotebookInstanceLifecycleConfigResponse
$creadPrec :: ReadPrec CreateNotebookInstanceLifecycleConfigResponse
readList :: ReadS [CreateNotebookInstanceLifecycleConfigResponse]
$creadList :: ReadS [CreateNotebookInstanceLifecycleConfigResponse]
readsPrec :: Int -> ReadS CreateNotebookInstanceLifecycleConfigResponse
$creadsPrec :: Int -> ReadS CreateNotebookInstanceLifecycleConfigResponse
Prelude.Read, Int -> CreateNotebookInstanceLifecycleConfigResponse -> ShowS
[CreateNotebookInstanceLifecycleConfigResponse] -> ShowS
CreateNotebookInstanceLifecycleConfigResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNotebookInstanceLifecycleConfigResponse] -> ShowS
$cshowList :: [CreateNotebookInstanceLifecycleConfigResponse] -> ShowS
show :: CreateNotebookInstanceLifecycleConfigResponse -> String
$cshow :: CreateNotebookInstanceLifecycleConfigResponse -> String
showsPrec :: Int -> CreateNotebookInstanceLifecycleConfigResponse -> ShowS
$cshowsPrec :: Int -> CreateNotebookInstanceLifecycleConfigResponse -> ShowS
Prelude.Show, forall x.
Rep CreateNotebookInstanceLifecycleConfigResponse x
-> CreateNotebookInstanceLifecycleConfigResponse
forall x.
CreateNotebookInstanceLifecycleConfigResponse
-> Rep CreateNotebookInstanceLifecycleConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateNotebookInstanceLifecycleConfigResponse x
-> CreateNotebookInstanceLifecycleConfigResponse
$cfrom :: forall x.
CreateNotebookInstanceLifecycleConfigResponse
-> Rep CreateNotebookInstanceLifecycleConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateNotebookInstanceLifecycleConfigResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'notebookInstanceLifecycleConfigArn', 'createNotebookInstanceLifecycleConfigResponse_notebookInstanceLifecycleConfigArn' - The Amazon Resource Name (ARN) of the lifecycle configuration.
--
-- 'httpStatus', 'createNotebookInstanceLifecycleConfigResponse_httpStatus' - The response's http status code.
newCreateNotebookInstanceLifecycleConfigResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateNotebookInstanceLifecycleConfigResponse
newCreateNotebookInstanceLifecycleConfigResponse :: Int -> CreateNotebookInstanceLifecycleConfigResponse
newCreateNotebookInstanceLifecycleConfigResponse
  Int
pHttpStatus_ =
    CreateNotebookInstanceLifecycleConfigResponse'
      { $sel:notebookInstanceLifecycleConfigArn:CreateNotebookInstanceLifecycleConfigResponse' :: Maybe Text
notebookInstanceLifecycleConfigArn =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateNotebookInstanceLifecycleConfigResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The Amazon Resource Name (ARN) of the lifecycle configuration.
createNotebookInstanceLifecycleConfigResponse_notebookInstanceLifecycleConfigArn :: Lens.Lens' CreateNotebookInstanceLifecycleConfigResponse (Prelude.Maybe Prelude.Text)
createNotebookInstanceLifecycleConfigResponse_notebookInstanceLifecycleConfigArn :: Lens' CreateNotebookInstanceLifecycleConfigResponse (Maybe Text)
createNotebookInstanceLifecycleConfigResponse_notebookInstanceLifecycleConfigArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstanceLifecycleConfigResponse' {Maybe Text
notebookInstanceLifecycleConfigArn :: Maybe Text
$sel:notebookInstanceLifecycleConfigArn:CreateNotebookInstanceLifecycleConfigResponse' :: CreateNotebookInstanceLifecycleConfigResponse -> Maybe Text
notebookInstanceLifecycleConfigArn} -> Maybe Text
notebookInstanceLifecycleConfigArn) (\s :: CreateNotebookInstanceLifecycleConfigResponse
s@CreateNotebookInstanceLifecycleConfigResponse' {} Maybe Text
a -> CreateNotebookInstanceLifecycleConfigResponse
s {$sel:notebookInstanceLifecycleConfigArn:CreateNotebookInstanceLifecycleConfigResponse' :: Maybe Text
notebookInstanceLifecycleConfigArn = Maybe Text
a} :: CreateNotebookInstanceLifecycleConfigResponse)

-- | The response's http status code.
createNotebookInstanceLifecycleConfigResponse_httpStatus :: Lens.Lens' CreateNotebookInstanceLifecycleConfigResponse Prelude.Int
createNotebookInstanceLifecycleConfigResponse_httpStatus :: Lens' CreateNotebookInstanceLifecycleConfigResponse Int
createNotebookInstanceLifecycleConfigResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstanceLifecycleConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateNotebookInstanceLifecycleConfigResponse' :: CreateNotebookInstanceLifecycleConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateNotebookInstanceLifecycleConfigResponse
s@CreateNotebookInstanceLifecycleConfigResponse' {} Int
a -> CreateNotebookInstanceLifecycleConfigResponse
s {$sel:httpStatus:CreateNotebookInstanceLifecycleConfigResponse' :: Int
httpStatus = Int
a} :: CreateNotebookInstanceLifecycleConfigResponse)

instance
  Prelude.NFData
    CreateNotebookInstanceLifecycleConfigResponse
  where
  rnf :: CreateNotebookInstanceLifecycleConfigResponse -> ()
rnf
    CreateNotebookInstanceLifecycleConfigResponse' {Int
Maybe Text
httpStatus :: Int
notebookInstanceLifecycleConfigArn :: Maybe Text
$sel:httpStatus:CreateNotebookInstanceLifecycleConfigResponse' :: CreateNotebookInstanceLifecycleConfigResponse -> Int
$sel:notebookInstanceLifecycleConfigArn:CreateNotebookInstanceLifecycleConfigResponse' :: CreateNotebookInstanceLifecycleConfigResponse -> Maybe Text
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notebookInstanceLifecycleConfigArn
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus