{-# 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.CreatePresignedNotebookInstanceUrl
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a URL that you can use to connect to the Jupyter server from a
-- notebook instance. In the Amazon SageMaker console, when you choose
-- @Open@ next to a notebook instance, Amazon SageMaker opens a new tab
-- showing the Jupyter server home page from the notebook instance. The
-- console uses this API to get the URL and show the page.
--
-- The IAM role or user used to call this API defines the permissions to
-- access the notebook instance. Once the presigned URL is created, no
-- additional permission is required to access this URL. IAM authorization
-- policies for this API are also enforced for every HTTP request and
-- WebSocket frame that attempts to connect to the notebook instance.
--
-- You can restrict access to this API and to the URL that it returns to a
-- list of IP addresses that you specify. Use the @NotIpAddress@ condition
-- operator and the @aws:SourceIP@ condition context key to specify the
-- list of IP addresses that you want to have access to the notebook
-- instance. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/security_iam_id-based-policy-examples.html#nbi-ip-filter Limit Access to a Notebook Instance by IP Address>.
--
-- The URL that you get from a call to CreatePresignedNotebookInstanceUrl
-- is valid only for 5 minutes. If you try to use the URL after the
-- 5-minute limit expires, you are directed to the Amazon Web Services
-- console sign-in page.
module Amazonka.SageMaker.CreatePresignedNotebookInstanceUrl
  ( -- * Creating a Request
    CreatePresignedNotebookInstanceUrl (..),
    newCreatePresignedNotebookInstanceUrl,

    -- * Request Lenses
    createPresignedNotebookInstanceUrl_sessionExpirationDurationInSeconds,
    createPresignedNotebookInstanceUrl_notebookInstanceName,

    -- * Destructuring the Response
    CreatePresignedNotebookInstanceUrlResponse (..),
    newCreatePresignedNotebookInstanceUrlResponse,

    -- * Response Lenses
    createPresignedNotebookInstanceUrlResponse_authorizedUrl,
    createPresignedNotebookInstanceUrlResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreatePresignedNotebookInstanceUrl' smart constructor.
data CreatePresignedNotebookInstanceUrl = CreatePresignedNotebookInstanceUrl'
  { -- | The duration of the session, in seconds. The default is 12 hours.
    CreatePresignedNotebookInstanceUrl -> Maybe Natural
sessionExpirationDurationInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The name of the notebook instance.
    CreatePresignedNotebookInstanceUrl -> Text
notebookInstanceName :: Prelude.Text
  }
  deriving (CreatePresignedNotebookInstanceUrl
-> CreatePresignedNotebookInstanceUrl -> Bool
(CreatePresignedNotebookInstanceUrl
 -> CreatePresignedNotebookInstanceUrl -> Bool)
-> (CreatePresignedNotebookInstanceUrl
    -> CreatePresignedNotebookInstanceUrl -> Bool)
-> Eq CreatePresignedNotebookInstanceUrl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePresignedNotebookInstanceUrl
-> CreatePresignedNotebookInstanceUrl -> Bool
$c/= :: CreatePresignedNotebookInstanceUrl
-> CreatePresignedNotebookInstanceUrl -> Bool
== :: CreatePresignedNotebookInstanceUrl
-> CreatePresignedNotebookInstanceUrl -> Bool
$c== :: CreatePresignedNotebookInstanceUrl
-> CreatePresignedNotebookInstanceUrl -> Bool
Prelude.Eq, ReadPrec [CreatePresignedNotebookInstanceUrl]
ReadPrec CreatePresignedNotebookInstanceUrl
Int -> ReadS CreatePresignedNotebookInstanceUrl
ReadS [CreatePresignedNotebookInstanceUrl]
(Int -> ReadS CreatePresignedNotebookInstanceUrl)
-> ReadS [CreatePresignedNotebookInstanceUrl]
-> ReadPrec CreatePresignedNotebookInstanceUrl
-> ReadPrec [CreatePresignedNotebookInstanceUrl]
-> Read CreatePresignedNotebookInstanceUrl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePresignedNotebookInstanceUrl]
$creadListPrec :: ReadPrec [CreatePresignedNotebookInstanceUrl]
readPrec :: ReadPrec CreatePresignedNotebookInstanceUrl
$creadPrec :: ReadPrec CreatePresignedNotebookInstanceUrl
readList :: ReadS [CreatePresignedNotebookInstanceUrl]
$creadList :: ReadS [CreatePresignedNotebookInstanceUrl]
readsPrec :: Int -> ReadS CreatePresignedNotebookInstanceUrl
$creadsPrec :: Int -> ReadS CreatePresignedNotebookInstanceUrl
Prelude.Read, Int -> CreatePresignedNotebookInstanceUrl -> ShowS
[CreatePresignedNotebookInstanceUrl] -> ShowS
CreatePresignedNotebookInstanceUrl -> String
(Int -> CreatePresignedNotebookInstanceUrl -> ShowS)
-> (CreatePresignedNotebookInstanceUrl -> String)
-> ([CreatePresignedNotebookInstanceUrl] -> ShowS)
-> Show CreatePresignedNotebookInstanceUrl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePresignedNotebookInstanceUrl] -> ShowS
$cshowList :: [CreatePresignedNotebookInstanceUrl] -> ShowS
show :: CreatePresignedNotebookInstanceUrl -> String
$cshow :: CreatePresignedNotebookInstanceUrl -> String
showsPrec :: Int -> CreatePresignedNotebookInstanceUrl -> ShowS
$cshowsPrec :: Int -> CreatePresignedNotebookInstanceUrl -> ShowS
Prelude.Show, (forall x.
 CreatePresignedNotebookInstanceUrl
 -> Rep CreatePresignedNotebookInstanceUrl x)
-> (forall x.
    Rep CreatePresignedNotebookInstanceUrl x
    -> CreatePresignedNotebookInstanceUrl)
-> Generic CreatePresignedNotebookInstanceUrl
forall x.
Rep CreatePresignedNotebookInstanceUrl x
-> CreatePresignedNotebookInstanceUrl
forall x.
CreatePresignedNotebookInstanceUrl
-> Rep CreatePresignedNotebookInstanceUrl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreatePresignedNotebookInstanceUrl x
-> CreatePresignedNotebookInstanceUrl
$cfrom :: forall x.
CreatePresignedNotebookInstanceUrl
-> Rep CreatePresignedNotebookInstanceUrl x
Prelude.Generic)

-- |
-- Create a value of 'CreatePresignedNotebookInstanceUrl' 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:
--
-- 'sessionExpirationDurationInSeconds', 'createPresignedNotebookInstanceUrl_sessionExpirationDurationInSeconds' - The duration of the session, in seconds. The default is 12 hours.
--
-- 'notebookInstanceName', 'createPresignedNotebookInstanceUrl_notebookInstanceName' - The name of the notebook instance.
newCreatePresignedNotebookInstanceUrl ::
  -- | 'notebookInstanceName'
  Prelude.Text ->
  CreatePresignedNotebookInstanceUrl
newCreatePresignedNotebookInstanceUrl :: Text -> CreatePresignedNotebookInstanceUrl
newCreatePresignedNotebookInstanceUrl
  Text
pNotebookInstanceName_ =
    CreatePresignedNotebookInstanceUrl' :: Maybe Natural -> Text -> CreatePresignedNotebookInstanceUrl
CreatePresignedNotebookInstanceUrl'
      { $sel:sessionExpirationDurationInSeconds:CreatePresignedNotebookInstanceUrl' :: Maybe Natural
sessionExpirationDurationInSeconds =
          Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:notebookInstanceName:CreatePresignedNotebookInstanceUrl' :: Text
notebookInstanceName =
          Text
pNotebookInstanceName_
      }

-- | The duration of the session, in seconds. The default is 12 hours.
createPresignedNotebookInstanceUrl_sessionExpirationDurationInSeconds :: Lens.Lens' CreatePresignedNotebookInstanceUrl (Prelude.Maybe Prelude.Natural)
createPresignedNotebookInstanceUrl_sessionExpirationDurationInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> CreatePresignedNotebookInstanceUrl
-> f CreatePresignedNotebookInstanceUrl
createPresignedNotebookInstanceUrl_sessionExpirationDurationInSeconds = (CreatePresignedNotebookInstanceUrl -> Maybe Natural)
-> (CreatePresignedNotebookInstanceUrl
    -> Maybe Natural -> CreatePresignedNotebookInstanceUrl)
-> Lens
     CreatePresignedNotebookInstanceUrl
     CreatePresignedNotebookInstanceUrl
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePresignedNotebookInstanceUrl' {Maybe Natural
sessionExpirationDurationInSeconds :: Maybe Natural
$sel:sessionExpirationDurationInSeconds:CreatePresignedNotebookInstanceUrl' :: CreatePresignedNotebookInstanceUrl -> Maybe Natural
sessionExpirationDurationInSeconds} -> Maybe Natural
sessionExpirationDurationInSeconds) (\s :: CreatePresignedNotebookInstanceUrl
s@CreatePresignedNotebookInstanceUrl' {} Maybe Natural
a -> CreatePresignedNotebookInstanceUrl
s {$sel:sessionExpirationDurationInSeconds:CreatePresignedNotebookInstanceUrl' :: Maybe Natural
sessionExpirationDurationInSeconds = Maybe Natural
a} :: CreatePresignedNotebookInstanceUrl)

-- | The name of the notebook instance.
createPresignedNotebookInstanceUrl_notebookInstanceName :: Lens.Lens' CreatePresignedNotebookInstanceUrl Prelude.Text
createPresignedNotebookInstanceUrl_notebookInstanceName :: (Text -> f Text)
-> CreatePresignedNotebookInstanceUrl
-> f CreatePresignedNotebookInstanceUrl
createPresignedNotebookInstanceUrl_notebookInstanceName = (CreatePresignedNotebookInstanceUrl -> Text)
-> (CreatePresignedNotebookInstanceUrl
    -> Text -> CreatePresignedNotebookInstanceUrl)
-> Lens
     CreatePresignedNotebookInstanceUrl
     CreatePresignedNotebookInstanceUrl
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePresignedNotebookInstanceUrl' {Text
notebookInstanceName :: Text
$sel:notebookInstanceName:CreatePresignedNotebookInstanceUrl' :: CreatePresignedNotebookInstanceUrl -> Text
notebookInstanceName} -> Text
notebookInstanceName) (\s :: CreatePresignedNotebookInstanceUrl
s@CreatePresignedNotebookInstanceUrl' {} Text
a -> CreatePresignedNotebookInstanceUrl
s {$sel:notebookInstanceName:CreatePresignedNotebookInstanceUrl' :: Text
notebookInstanceName = Text
a} :: CreatePresignedNotebookInstanceUrl)

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

instance
  Prelude.Hashable
    CreatePresignedNotebookInstanceUrl

instance
  Prelude.NFData
    CreatePresignedNotebookInstanceUrl

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

instance
  Core.ToJSON
    CreatePresignedNotebookInstanceUrl
  where
  toJSON :: CreatePresignedNotebookInstanceUrl -> Value
toJSON CreatePresignedNotebookInstanceUrl' {Maybe Natural
Text
notebookInstanceName :: Text
sessionExpirationDurationInSeconds :: Maybe Natural
$sel:notebookInstanceName:CreatePresignedNotebookInstanceUrl' :: CreatePresignedNotebookInstanceUrl -> Text
$sel:sessionExpirationDurationInSeconds:CreatePresignedNotebookInstanceUrl' :: CreatePresignedNotebookInstanceUrl -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SessionExpirationDurationInSeconds" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
sessionExpirationDurationInSeconds,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"NotebookInstanceName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
notebookInstanceName
              )
          ]
      )

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

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

-- | /See:/ 'newCreatePresignedNotebookInstanceUrlResponse' smart constructor.
data CreatePresignedNotebookInstanceUrlResponse = CreatePresignedNotebookInstanceUrlResponse'
  { -- | A JSON object that contains the URL string.
    CreatePresignedNotebookInstanceUrlResponse -> Maybe Text
authorizedUrl :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreatePresignedNotebookInstanceUrlResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreatePresignedNotebookInstanceUrlResponse
-> CreatePresignedNotebookInstanceUrlResponse -> Bool
(CreatePresignedNotebookInstanceUrlResponse
 -> CreatePresignedNotebookInstanceUrlResponse -> Bool)
-> (CreatePresignedNotebookInstanceUrlResponse
    -> CreatePresignedNotebookInstanceUrlResponse -> Bool)
-> Eq CreatePresignedNotebookInstanceUrlResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePresignedNotebookInstanceUrlResponse
-> CreatePresignedNotebookInstanceUrlResponse -> Bool
$c/= :: CreatePresignedNotebookInstanceUrlResponse
-> CreatePresignedNotebookInstanceUrlResponse -> Bool
== :: CreatePresignedNotebookInstanceUrlResponse
-> CreatePresignedNotebookInstanceUrlResponse -> Bool
$c== :: CreatePresignedNotebookInstanceUrlResponse
-> CreatePresignedNotebookInstanceUrlResponse -> Bool
Prelude.Eq, ReadPrec [CreatePresignedNotebookInstanceUrlResponse]
ReadPrec CreatePresignedNotebookInstanceUrlResponse
Int -> ReadS CreatePresignedNotebookInstanceUrlResponse
ReadS [CreatePresignedNotebookInstanceUrlResponse]
(Int -> ReadS CreatePresignedNotebookInstanceUrlResponse)
-> ReadS [CreatePresignedNotebookInstanceUrlResponse]
-> ReadPrec CreatePresignedNotebookInstanceUrlResponse
-> ReadPrec [CreatePresignedNotebookInstanceUrlResponse]
-> Read CreatePresignedNotebookInstanceUrlResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePresignedNotebookInstanceUrlResponse]
$creadListPrec :: ReadPrec [CreatePresignedNotebookInstanceUrlResponse]
readPrec :: ReadPrec CreatePresignedNotebookInstanceUrlResponse
$creadPrec :: ReadPrec CreatePresignedNotebookInstanceUrlResponse
readList :: ReadS [CreatePresignedNotebookInstanceUrlResponse]
$creadList :: ReadS [CreatePresignedNotebookInstanceUrlResponse]
readsPrec :: Int -> ReadS CreatePresignedNotebookInstanceUrlResponse
$creadsPrec :: Int -> ReadS CreatePresignedNotebookInstanceUrlResponse
Prelude.Read, Int -> CreatePresignedNotebookInstanceUrlResponse -> ShowS
[CreatePresignedNotebookInstanceUrlResponse] -> ShowS
CreatePresignedNotebookInstanceUrlResponse -> String
(Int -> CreatePresignedNotebookInstanceUrlResponse -> ShowS)
-> (CreatePresignedNotebookInstanceUrlResponse -> String)
-> ([CreatePresignedNotebookInstanceUrlResponse] -> ShowS)
-> Show CreatePresignedNotebookInstanceUrlResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePresignedNotebookInstanceUrlResponse] -> ShowS
$cshowList :: [CreatePresignedNotebookInstanceUrlResponse] -> ShowS
show :: CreatePresignedNotebookInstanceUrlResponse -> String
$cshow :: CreatePresignedNotebookInstanceUrlResponse -> String
showsPrec :: Int -> CreatePresignedNotebookInstanceUrlResponse -> ShowS
$cshowsPrec :: Int -> CreatePresignedNotebookInstanceUrlResponse -> ShowS
Prelude.Show, (forall x.
 CreatePresignedNotebookInstanceUrlResponse
 -> Rep CreatePresignedNotebookInstanceUrlResponse x)
-> (forall x.
    Rep CreatePresignedNotebookInstanceUrlResponse x
    -> CreatePresignedNotebookInstanceUrlResponse)
-> Generic CreatePresignedNotebookInstanceUrlResponse
forall x.
Rep CreatePresignedNotebookInstanceUrlResponse x
-> CreatePresignedNotebookInstanceUrlResponse
forall x.
CreatePresignedNotebookInstanceUrlResponse
-> Rep CreatePresignedNotebookInstanceUrlResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreatePresignedNotebookInstanceUrlResponse x
-> CreatePresignedNotebookInstanceUrlResponse
$cfrom :: forall x.
CreatePresignedNotebookInstanceUrlResponse
-> Rep CreatePresignedNotebookInstanceUrlResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreatePresignedNotebookInstanceUrlResponse' 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:
--
-- 'authorizedUrl', 'createPresignedNotebookInstanceUrlResponse_authorizedUrl' - A JSON object that contains the URL string.
--
-- 'httpStatus', 'createPresignedNotebookInstanceUrlResponse_httpStatus' - The response's http status code.
newCreatePresignedNotebookInstanceUrlResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreatePresignedNotebookInstanceUrlResponse
newCreatePresignedNotebookInstanceUrlResponse :: Int -> CreatePresignedNotebookInstanceUrlResponse
newCreatePresignedNotebookInstanceUrlResponse
  Int
pHttpStatus_ =
    CreatePresignedNotebookInstanceUrlResponse' :: Maybe Text -> Int -> CreatePresignedNotebookInstanceUrlResponse
CreatePresignedNotebookInstanceUrlResponse'
      { $sel:authorizedUrl:CreatePresignedNotebookInstanceUrlResponse' :: Maybe Text
authorizedUrl =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreatePresignedNotebookInstanceUrlResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A JSON object that contains the URL string.
createPresignedNotebookInstanceUrlResponse_authorizedUrl :: Lens.Lens' CreatePresignedNotebookInstanceUrlResponse (Prelude.Maybe Prelude.Text)
createPresignedNotebookInstanceUrlResponse_authorizedUrl :: (Maybe Text -> f (Maybe Text))
-> CreatePresignedNotebookInstanceUrlResponse
-> f CreatePresignedNotebookInstanceUrlResponse
createPresignedNotebookInstanceUrlResponse_authorizedUrl = (CreatePresignedNotebookInstanceUrlResponse -> Maybe Text)
-> (CreatePresignedNotebookInstanceUrlResponse
    -> Maybe Text -> CreatePresignedNotebookInstanceUrlResponse)
-> Lens
     CreatePresignedNotebookInstanceUrlResponse
     CreatePresignedNotebookInstanceUrlResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePresignedNotebookInstanceUrlResponse' {Maybe Text
authorizedUrl :: Maybe Text
$sel:authorizedUrl:CreatePresignedNotebookInstanceUrlResponse' :: CreatePresignedNotebookInstanceUrlResponse -> Maybe Text
authorizedUrl} -> Maybe Text
authorizedUrl) (\s :: CreatePresignedNotebookInstanceUrlResponse
s@CreatePresignedNotebookInstanceUrlResponse' {} Maybe Text
a -> CreatePresignedNotebookInstanceUrlResponse
s {$sel:authorizedUrl:CreatePresignedNotebookInstanceUrlResponse' :: Maybe Text
authorizedUrl = Maybe Text
a} :: CreatePresignedNotebookInstanceUrlResponse)

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

instance
  Prelude.NFData
    CreatePresignedNotebookInstanceUrlResponse