{-# 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.SSM.StartSession
-- 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)
--
-- Initiates a connection to a target (for example, an instance) for a
-- Session Manager session. Returns a URL and token that can be used to
-- open a WebSocket connection for sending input and receiving outputs.
--
-- Amazon Web Services CLI usage: @start-session@ is an interactive command
-- that requires the Session Manager plugin to be installed on the client
-- machine making the call. For information, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html Install the Session Manager plugin for the Amazon Web Services CLI>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- Amazon Web Services Tools for PowerShell usage: Start-SSMSession isn\'t
-- currently supported by Amazon Web Services Tools for PowerShell on
-- Windows local machines.
module Amazonka.SSM.StartSession
  ( -- * Creating a Request
    StartSession (..),
    newStartSession,

    -- * Request Lenses
    startSession_documentName,
    startSession_parameters,
    startSession_target,

    -- * Destructuring the Response
    StartSessionResponse (..),
    newStartSessionResponse,

    -- * Response Lenses
    startSessionResponse_streamUrl,
    startSessionResponse_tokenValue,
    startSessionResponse_sessionId,
    startSessionResponse_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.SSM.Types

-- | /See:/ 'newStartSession' smart constructor.
data StartSession = StartSession'
  { -- | The name of the SSM document to define the parameters and plugin
    -- settings for the session. For example, @SSM-SessionManagerRunShell@. You
    -- can call the GetDocument API to verify the document exists before
    -- attempting to start a session. If no document name is provided, a shell
    -- to the instance is launched by default.
    StartSession -> Maybe Text
documentName :: Prelude.Maybe Prelude.Text,
    -- | Reserved for future use.
    StartSession -> Maybe (HashMap Text [Text])
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | The instance to connect to for the session.
    StartSession -> Text
target :: Prelude.Text
  }
  deriving (StartSession -> StartSession -> Bool
(StartSession -> StartSession -> Bool)
-> (StartSession -> StartSession -> Bool) -> Eq StartSession
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartSession -> StartSession -> Bool
$c/= :: StartSession -> StartSession -> Bool
== :: StartSession -> StartSession -> Bool
$c== :: StartSession -> StartSession -> Bool
Prelude.Eq, ReadPrec [StartSession]
ReadPrec StartSession
Int -> ReadS StartSession
ReadS [StartSession]
(Int -> ReadS StartSession)
-> ReadS [StartSession]
-> ReadPrec StartSession
-> ReadPrec [StartSession]
-> Read StartSession
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartSession]
$creadListPrec :: ReadPrec [StartSession]
readPrec :: ReadPrec StartSession
$creadPrec :: ReadPrec StartSession
readList :: ReadS [StartSession]
$creadList :: ReadS [StartSession]
readsPrec :: Int -> ReadS StartSession
$creadsPrec :: Int -> ReadS StartSession
Prelude.Read, Int -> StartSession -> ShowS
[StartSession] -> ShowS
StartSession -> String
(Int -> StartSession -> ShowS)
-> (StartSession -> String)
-> ([StartSession] -> ShowS)
-> Show StartSession
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartSession] -> ShowS
$cshowList :: [StartSession] -> ShowS
show :: StartSession -> String
$cshow :: StartSession -> String
showsPrec :: Int -> StartSession -> ShowS
$cshowsPrec :: Int -> StartSession -> ShowS
Prelude.Show, (forall x. StartSession -> Rep StartSession x)
-> (forall x. Rep StartSession x -> StartSession)
-> Generic StartSession
forall x. Rep StartSession x -> StartSession
forall x. StartSession -> Rep StartSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartSession x -> StartSession
$cfrom :: forall x. StartSession -> Rep StartSession x
Prelude.Generic)

-- |
-- Create a value of 'StartSession' 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:
--
-- 'documentName', 'startSession_documentName' - The name of the SSM document to define the parameters and plugin
-- settings for the session. For example, @SSM-SessionManagerRunShell@. You
-- can call the GetDocument API to verify the document exists before
-- attempting to start a session. If no document name is provided, a shell
-- to the instance is launched by default.
--
-- 'parameters', 'startSession_parameters' - Reserved for future use.
--
-- 'target', 'startSession_target' - The instance to connect to for the session.
newStartSession ::
  -- | 'target'
  Prelude.Text ->
  StartSession
newStartSession :: Text -> StartSession
newStartSession Text
pTarget_ =
  StartSession' :: Maybe Text -> Maybe (HashMap Text [Text]) -> Text -> StartSession
StartSession'
    { $sel:documentName:StartSession' :: Maybe Text
documentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:StartSession' :: Maybe (HashMap Text [Text])
parameters = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
      $sel:target:StartSession' :: Text
target = Text
pTarget_
    }

-- | The name of the SSM document to define the parameters and plugin
-- settings for the session. For example, @SSM-SessionManagerRunShell@. You
-- can call the GetDocument API to verify the document exists before
-- attempting to start a session. If no document name is provided, a shell
-- to the instance is launched by default.
startSession_documentName :: Lens.Lens' StartSession (Prelude.Maybe Prelude.Text)
startSession_documentName :: (Maybe Text -> f (Maybe Text)) -> StartSession -> f StartSession
startSession_documentName = (StartSession -> Maybe Text)
-> (StartSession -> Maybe Text -> StartSession)
-> Lens StartSession StartSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSession' {Maybe Text
documentName :: Maybe Text
$sel:documentName:StartSession' :: StartSession -> Maybe Text
documentName} -> Maybe Text
documentName) (\s :: StartSession
s@StartSession' {} Maybe Text
a -> StartSession
s {$sel:documentName:StartSession' :: Maybe Text
documentName = Maybe Text
a} :: StartSession)

-- | Reserved for future use.
startSession_parameters :: Lens.Lens' StartSession (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
startSession_parameters :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> StartSession -> f StartSession
startSession_parameters = (StartSession -> Maybe (HashMap Text [Text]))
-> (StartSession -> Maybe (HashMap Text [Text]) -> StartSession)
-> Lens
     StartSession
     StartSession
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSession' {Maybe (HashMap Text [Text])
parameters :: Maybe (HashMap Text [Text])
$sel:parameters:StartSession' :: StartSession -> Maybe (HashMap Text [Text])
parameters} -> Maybe (HashMap Text [Text])
parameters) (\s :: StartSession
s@StartSession' {} Maybe (HashMap Text [Text])
a -> StartSession
s {$sel:parameters:StartSession' :: Maybe (HashMap Text [Text])
parameters = Maybe (HashMap Text [Text])
a} :: StartSession) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
 -> StartSession -> f StartSession)
-> ((Maybe (HashMap Text [Text])
     -> f (Maybe (HashMap Text [Text])))
    -> Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> StartSession
-> f StartSession
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
-> Iso
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
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 AnIso
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The instance to connect to for the session.
startSession_target :: Lens.Lens' StartSession Prelude.Text
startSession_target :: (Text -> f Text) -> StartSession -> f StartSession
startSession_target = (StartSession -> Text)
-> (StartSession -> Text -> StartSession)
-> Lens StartSession StartSession Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSession' {Text
target :: Text
$sel:target:StartSession' :: StartSession -> Text
target} -> Text
target) (\s :: StartSession
s@StartSession' {} Text
a -> StartSession
s {$sel:target:StartSession' :: Text
target = Text
a} :: StartSession)

instance Core.AWSRequest StartSession where
  type AWSResponse StartSession = StartSessionResponse
  request :: StartSession -> Request StartSession
request = Service -> StartSession -> Request StartSession
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartSession
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartSession)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartSession))
-> Logger
-> Service
-> Proxy StartSession
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartSession)))
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
-> Maybe Text -> Maybe Text -> Int -> StartSessionResponse
StartSessionResponse'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Int -> StartSessionResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe Text -> Int -> StartSessionResponse)
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
"StreamUrl")
            Either
  String (Maybe Text -> Maybe Text -> Int -> StartSessionResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> StartSessionResponse)
forall (f :: * -> *) a b. Applicative f => 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
"TokenValue")
            Either String (Maybe Text -> Int -> StartSessionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartSessionResponse)
forall (f :: * -> *) a b. Applicative f => 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
"SessionId")
            Either String (Int -> StartSessionResponse)
-> Either String Int -> Either String StartSessionResponse
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 StartSession

instance Prelude.NFData StartSession

instance Core.ToHeaders StartSession where
  toHeaders :: StartSession -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartSession -> 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
"AmazonSSM.StartSession" :: 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 StartSession where
  toJSON :: StartSession -> Value
toJSON StartSession' {Maybe Text
Maybe (HashMap Text [Text])
Text
target :: Text
parameters :: Maybe (HashMap Text [Text])
documentName :: Maybe Text
$sel:target:StartSession' :: StartSession -> Text
$sel:parameters:StartSession' :: StartSession -> Maybe (HashMap Text [Text])
$sel:documentName:StartSession' :: StartSession -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DocumentName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
documentName,
            (Text
"Parameters" Text -> HashMap Text [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text [Text] -> Pair)
-> Maybe (HashMap Text [Text]) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text [Text])
parameters,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Target" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
target)
          ]
      )

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

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

-- | /See:/ 'newStartSessionResponse' smart constructor.
data StartSessionResponse = StartSessionResponse'
  { -- | A URL back to SSM Agent on the instance that the Session Manager client
    -- uses to send commands and receive output from the instance. Format:
    -- @wss:\/\/ssmmessages.region.amazonaws.com\/v1\/data-channel\/session-id?stream=(input|output)@
    --
    -- __region__ represents the Region identifier for an Amazon Web Services
    -- Region supported by Amazon Web Services Systems Manager, such as
    -- @us-east-2@ for the US East (Ohio) Region. For a list of supported
    -- __region__ values, see the __Region__ column in
    -- <https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region Systems Manager service endpoints>
    -- in the /Amazon Web Services General Reference/.
    --
    -- __session-id__ represents the ID of a Session Manager session, such as
    -- @1a2b3c4dEXAMPLE@.
    StartSessionResponse -> Maybe Text
streamUrl :: Prelude.Maybe Prelude.Text,
    -- | An encrypted token value containing session and caller information. Used
    -- to authenticate the connection to the instance.
    StartSessionResponse -> Maybe Text
tokenValue :: Prelude.Maybe Prelude.Text,
    -- | The ID of the session.
    StartSessionResponse -> Maybe Text
sessionId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    StartSessionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartSessionResponse -> StartSessionResponse -> Bool
(StartSessionResponse -> StartSessionResponse -> Bool)
-> (StartSessionResponse -> StartSessionResponse -> Bool)
-> Eq StartSessionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartSessionResponse -> StartSessionResponse -> Bool
$c/= :: StartSessionResponse -> StartSessionResponse -> Bool
== :: StartSessionResponse -> StartSessionResponse -> Bool
$c== :: StartSessionResponse -> StartSessionResponse -> Bool
Prelude.Eq, ReadPrec [StartSessionResponse]
ReadPrec StartSessionResponse
Int -> ReadS StartSessionResponse
ReadS [StartSessionResponse]
(Int -> ReadS StartSessionResponse)
-> ReadS [StartSessionResponse]
-> ReadPrec StartSessionResponse
-> ReadPrec [StartSessionResponse]
-> Read StartSessionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartSessionResponse]
$creadListPrec :: ReadPrec [StartSessionResponse]
readPrec :: ReadPrec StartSessionResponse
$creadPrec :: ReadPrec StartSessionResponse
readList :: ReadS [StartSessionResponse]
$creadList :: ReadS [StartSessionResponse]
readsPrec :: Int -> ReadS StartSessionResponse
$creadsPrec :: Int -> ReadS StartSessionResponse
Prelude.Read, Int -> StartSessionResponse -> ShowS
[StartSessionResponse] -> ShowS
StartSessionResponse -> String
(Int -> StartSessionResponse -> ShowS)
-> (StartSessionResponse -> String)
-> ([StartSessionResponse] -> ShowS)
-> Show StartSessionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartSessionResponse] -> ShowS
$cshowList :: [StartSessionResponse] -> ShowS
show :: StartSessionResponse -> String
$cshow :: StartSessionResponse -> String
showsPrec :: Int -> StartSessionResponse -> ShowS
$cshowsPrec :: Int -> StartSessionResponse -> ShowS
Prelude.Show, (forall x. StartSessionResponse -> Rep StartSessionResponse x)
-> (forall x. Rep StartSessionResponse x -> StartSessionResponse)
-> Generic StartSessionResponse
forall x. Rep StartSessionResponse x -> StartSessionResponse
forall x. StartSessionResponse -> Rep StartSessionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartSessionResponse x -> StartSessionResponse
$cfrom :: forall x. StartSessionResponse -> Rep StartSessionResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartSessionResponse' 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:
--
-- 'streamUrl', 'startSessionResponse_streamUrl' - A URL back to SSM Agent on the instance that the Session Manager client
-- uses to send commands and receive output from the instance. Format:
-- @wss:\/\/ssmmessages.region.amazonaws.com\/v1\/data-channel\/session-id?stream=(input|output)@
--
-- __region__ represents the Region identifier for an Amazon Web Services
-- Region supported by Amazon Web Services Systems Manager, such as
-- @us-east-2@ for the US East (Ohio) Region. For a list of supported
-- __region__ values, see the __Region__ column in
-- <https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region Systems Manager service endpoints>
-- in the /Amazon Web Services General Reference/.
--
-- __session-id__ represents the ID of a Session Manager session, such as
-- @1a2b3c4dEXAMPLE@.
--
-- 'tokenValue', 'startSessionResponse_tokenValue' - An encrypted token value containing session and caller information. Used
-- to authenticate the connection to the instance.
--
-- 'sessionId', 'startSessionResponse_sessionId' - The ID of the session.
--
-- 'httpStatus', 'startSessionResponse_httpStatus' - The response's http status code.
newStartSessionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartSessionResponse
newStartSessionResponse :: Int -> StartSessionResponse
newStartSessionResponse Int
pHttpStatus_ =
  StartSessionResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> StartSessionResponse
StartSessionResponse'
    { $sel:streamUrl:StartSessionResponse' :: Maybe Text
streamUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tokenValue:StartSessionResponse' :: Maybe Text
tokenValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sessionId:StartSessionResponse' :: Maybe Text
sessionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartSessionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A URL back to SSM Agent on the instance that the Session Manager client
-- uses to send commands and receive output from the instance. Format:
-- @wss:\/\/ssmmessages.region.amazonaws.com\/v1\/data-channel\/session-id?stream=(input|output)@
--
-- __region__ represents the Region identifier for an Amazon Web Services
-- Region supported by Amazon Web Services Systems Manager, such as
-- @us-east-2@ for the US East (Ohio) Region. For a list of supported
-- __region__ values, see the __Region__ column in
-- <https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region Systems Manager service endpoints>
-- in the /Amazon Web Services General Reference/.
--
-- __session-id__ represents the ID of a Session Manager session, such as
-- @1a2b3c4dEXAMPLE@.
startSessionResponse_streamUrl :: Lens.Lens' StartSessionResponse (Prelude.Maybe Prelude.Text)
startSessionResponse_streamUrl :: (Maybe Text -> f (Maybe Text))
-> StartSessionResponse -> f StartSessionResponse
startSessionResponse_streamUrl = (StartSessionResponse -> Maybe Text)
-> (StartSessionResponse -> Maybe Text -> StartSessionResponse)
-> Lens
     StartSessionResponse StartSessionResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSessionResponse' {Maybe Text
streamUrl :: Maybe Text
$sel:streamUrl:StartSessionResponse' :: StartSessionResponse -> Maybe Text
streamUrl} -> Maybe Text
streamUrl) (\s :: StartSessionResponse
s@StartSessionResponse' {} Maybe Text
a -> StartSessionResponse
s {$sel:streamUrl:StartSessionResponse' :: Maybe Text
streamUrl = Maybe Text
a} :: StartSessionResponse)

-- | An encrypted token value containing session and caller information. Used
-- to authenticate the connection to the instance.
startSessionResponse_tokenValue :: Lens.Lens' StartSessionResponse (Prelude.Maybe Prelude.Text)
startSessionResponse_tokenValue :: (Maybe Text -> f (Maybe Text))
-> StartSessionResponse -> f StartSessionResponse
startSessionResponse_tokenValue = (StartSessionResponse -> Maybe Text)
-> (StartSessionResponse -> Maybe Text -> StartSessionResponse)
-> Lens
     StartSessionResponse StartSessionResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSessionResponse' {Maybe Text
tokenValue :: Maybe Text
$sel:tokenValue:StartSessionResponse' :: StartSessionResponse -> Maybe Text
tokenValue} -> Maybe Text
tokenValue) (\s :: StartSessionResponse
s@StartSessionResponse' {} Maybe Text
a -> StartSessionResponse
s {$sel:tokenValue:StartSessionResponse' :: Maybe Text
tokenValue = Maybe Text
a} :: StartSessionResponse)

-- | The ID of the session.
startSessionResponse_sessionId :: Lens.Lens' StartSessionResponse (Prelude.Maybe Prelude.Text)
startSessionResponse_sessionId :: (Maybe Text -> f (Maybe Text))
-> StartSessionResponse -> f StartSessionResponse
startSessionResponse_sessionId = (StartSessionResponse -> Maybe Text)
-> (StartSessionResponse -> Maybe Text -> StartSessionResponse)
-> Lens
     StartSessionResponse StartSessionResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSessionResponse' {Maybe Text
sessionId :: Maybe Text
$sel:sessionId:StartSessionResponse' :: StartSessionResponse -> Maybe Text
sessionId} -> Maybe Text
sessionId) (\s :: StartSessionResponse
s@StartSessionResponse' {} Maybe Text
a -> StartSessionResponse
s {$sel:sessionId:StartSessionResponse' :: Maybe Text
sessionId = Maybe Text
a} :: StartSessionResponse)

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

instance Prelude.NFData StartSessionResponse