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

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

-- |
-- Module      : Amazonka.Nimble.Types.StreamingSessionStream
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Nimble.Types.StreamingSessionStream where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Nimble.Types.StreamingSessionStreamState
import Amazonka.Nimble.Types.StreamingSessionStreamStatusCode
import qualified Amazonka.Prelude as Prelude

-- | A stream is an active connection to a streaming session, enabling a
-- studio user to control the streaming session using a compatible client.
-- Streaming session streams are compatible with the NICE DCV web client,
-- included in the Nimble Studio portal, or the NICE DCV desktop client.
--
-- /See:/ 'newStreamingSessionStream' smart constructor.
data StreamingSessionStream = StreamingSessionStream'
  { -- | The ISO timestamp in seconds for when the resource was created.
    StreamingSessionStream -> Maybe ISO8601
createdAt :: Prelude.Maybe Data.ISO8601,
    -- | The user ID of the user that created the streaming session stream.
    StreamingSessionStream -> Maybe Text
createdBy :: Prelude.Maybe Prelude.Text,
    -- | The ISO timestamp in seconds for when the resource expires.
    StreamingSessionStream -> Maybe ISO8601
expiresAt :: Prelude.Maybe Data.ISO8601,
    -- | The user ID of the user that owns the streaming session. The user that
    -- owns the session will be logging into the session and interacting with
    -- the virtual workstation.
    StreamingSessionStream -> Maybe Text
ownedBy :: Prelude.Maybe Prelude.Text,
    -- | The current state.
    StreamingSessionStream -> Maybe StreamingSessionStreamState
state :: Prelude.Maybe StreamingSessionStreamState,
    -- | The streaming session stream status code.
    StreamingSessionStream -> Maybe StreamingSessionStreamStatusCode
statusCode :: Prelude.Maybe StreamingSessionStreamStatusCode,
    -- | The stream ID.
    StreamingSessionStream -> Maybe Text
streamId :: Prelude.Maybe Prelude.Text,
    -- | The URL to connect to this stream using the DCV client.
    StreamingSessionStream -> Maybe (Sensitive Text)
url :: Prelude.Maybe (Data.Sensitive Prelude.Text)
  }
  deriving (StreamingSessionStream -> StreamingSessionStream -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamingSessionStream -> StreamingSessionStream -> Bool
$c/= :: StreamingSessionStream -> StreamingSessionStream -> Bool
== :: StreamingSessionStream -> StreamingSessionStream -> Bool
$c== :: StreamingSessionStream -> StreamingSessionStream -> Bool
Prelude.Eq, Int -> StreamingSessionStream -> ShowS
[StreamingSessionStream] -> ShowS
StreamingSessionStream -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamingSessionStream] -> ShowS
$cshowList :: [StreamingSessionStream] -> ShowS
show :: StreamingSessionStream -> String
$cshow :: StreamingSessionStream -> String
showsPrec :: Int -> StreamingSessionStream -> ShowS
$cshowsPrec :: Int -> StreamingSessionStream -> ShowS
Prelude.Show, forall x. Rep StreamingSessionStream x -> StreamingSessionStream
forall x. StreamingSessionStream -> Rep StreamingSessionStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StreamingSessionStream x -> StreamingSessionStream
$cfrom :: forall x. StreamingSessionStream -> Rep StreamingSessionStream x
Prelude.Generic)

-- |
-- Create a value of 'StreamingSessionStream' 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:
--
-- 'createdAt', 'streamingSessionStream_createdAt' - The ISO timestamp in seconds for when the resource was created.
--
-- 'createdBy', 'streamingSessionStream_createdBy' - The user ID of the user that created the streaming session stream.
--
-- 'expiresAt', 'streamingSessionStream_expiresAt' - The ISO timestamp in seconds for when the resource expires.
--
-- 'ownedBy', 'streamingSessionStream_ownedBy' - The user ID of the user that owns the streaming session. The user that
-- owns the session will be logging into the session and interacting with
-- the virtual workstation.
--
-- 'state', 'streamingSessionStream_state' - The current state.
--
-- 'statusCode', 'streamingSessionStream_statusCode' - The streaming session stream status code.
--
-- 'streamId', 'streamingSessionStream_streamId' - The stream ID.
--
-- 'url', 'streamingSessionStream_url' - The URL to connect to this stream using the DCV client.
newStreamingSessionStream ::
  StreamingSessionStream
newStreamingSessionStream :: StreamingSessionStream
newStreamingSessionStream =
  StreamingSessionStream'
    { $sel:createdAt:StreamingSessionStream' :: Maybe ISO8601
createdAt =
        forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:StreamingSessionStream' :: Maybe Text
createdBy = forall a. Maybe a
Prelude.Nothing,
      $sel:expiresAt:StreamingSessionStream' :: Maybe ISO8601
expiresAt = forall a. Maybe a
Prelude.Nothing,
      $sel:ownedBy:StreamingSessionStream' :: Maybe Text
ownedBy = forall a. Maybe a
Prelude.Nothing,
      $sel:state:StreamingSessionStream' :: Maybe StreamingSessionStreamState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:statusCode:StreamingSessionStream' :: Maybe StreamingSessionStreamStatusCode
statusCode = forall a. Maybe a
Prelude.Nothing,
      $sel:streamId:StreamingSessionStream' :: Maybe Text
streamId = forall a. Maybe a
Prelude.Nothing,
      $sel:url:StreamingSessionStream' :: Maybe (Sensitive Text)
url = forall a. Maybe a
Prelude.Nothing
    }

-- | The ISO timestamp in seconds for when the resource was created.
streamingSessionStream_createdAt :: Lens.Lens' StreamingSessionStream (Prelude.Maybe Prelude.UTCTime)
streamingSessionStream_createdAt :: Lens' StreamingSessionStream (Maybe UTCTime)
streamingSessionStream_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingSessionStream' {Maybe ISO8601
createdAt :: Maybe ISO8601
$sel:createdAt:StreamingSessionStream' :: StreamingSessionStream -> Maybe ISO8601
createdAt} -> Maybe ISO8601
createdAt) (\s :: StreamingSessionStream
s@StreamingSessionStream' {} Maybe ISO8601
a -> StreamingSessionStream
s {$sel:createdAt:StreamingSessionStream' :: Maybe ISO8601
createdAt = Maybe ISO8601
a} :: StreamingSessionStream) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The user ID of the user that created the streaming session stream.
streamingSessionStream_createdBy :: Lens.Lens' StreamingSessionStream (Prelude.Maybe Prelude.Text)
streamingSessionStream_createdBy :: Lens' StreamingSessionStream (Maybe Text)
streamingSessionStream_createdBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingSessionStream' {Maybe Text
createdBy :: Maybe Text
$sel:createdBy:StreamingSessionStream' :: StreamingSessionStream -> Maybe Text
createdBy} -> Maybe Text
createdBy) (\s :: StreamingSessionStream
s@StreamingSessionStream' {} Maybe Text
a -> StreamingSessionStream
s {$sel:createdBy:StreamingSessionStream' :: Maybe Text
createdBy = Maybe Text
a} :: StreamingSessionStream)

-- | The ISO timestamp in seconds for when the resource expires.
streamingSessionStream_expiresAt :: Lens.Lens' StreamingSessionStream (Prelude.Maybe Prelude.UTCTime)
streamingSessionStream_expiresAt :: Lens' StreamingSessionStream (Maybe UTCTime)
streamingSessionStream_expiresAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingSessionStream' {Maybe ISO8601
expiresAt :: Maybe ISO8601
$sel:expiresAt:StreamingSessionStream' :: StreamingSessionStream -> Maybe ISO8601
expiresAt} -> Maybe ISO8601
expiresAt) (\s :: StreamingSessionStream
s@StreamingSessionStream' {} Maybe ISO8601
a -> StreamingSessionStream
s {$sel:expiresAt:StreamingSessionStream' :: Maybe ISO8601
expiresAt = Maybe ISO8601
a} :: StreamingSessionStream) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The user ID of the user that owns the streaming session. The user that
-- owns the session will be logging into the session and interacting with
-- the virtual workstation.
streamingSessionStream_ownedBy :: Lens.Lens' StreamingSessionStream (Prelude.Maybe Prelude.Text)
streamingSessionStream_ownedBy :: Lens' StreamingSessionStream (Maybe Text)
streamingSessionStream_ownedBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingSessionStream' {Maybe Text
ownedBy :: Maybe Text
$sel:ownedBy:StreamingSessionStream' :: StreamingSessionStream -> Maybe Text
ownedBy} -> Maybe Text
ownedBy) (\s :: StreamingSessionStream
s@StreamingSessionStream' {} Maybe Text
a -> StreamingSessionStream
s {$sel:ownedBy:StreamingSessionStream' :: Maybe Text
ownedBy = Maybe Text
a} :: StreamingSessionStream)

-- | The current state.
streamingSessionStream_state :: Lens.Lens' StreamingSessionStream (Prelude.Maybe StreamingSessionStreamState)
streamingSessionStream_state :: Lens' StreamingSessionStream (Maybe StreamingSessionStreamState)
streamingSessionStream_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingSessionStream' {Maybe StreamingSessionStreamState
state :: Maybe StreamingSessionStreamState
$sel:state:StreamingSessionStream' :: StreamingSessionStream -> Maybe StreamingSessionStreamState
state} -> Maybe StreamingSessionStreamState
state) (\s :: StreamingSessionStream
s@StreamingSessionStream' {} Maybe StreamingSessionStreamState
a -> StreamingSessionStream
s {$sel:state:StreamingSessionStream' :: Maybe StreamingSessionStreamState
state = Maybe StreamingSessionStreamState
a} :: StreamingSessionStream)

-- | The streaming session stream status code.
streamingSessionStream_statusCode :: Lens.Lens' StreamingSessionStream (Prelude.Maybe StreamingSessionStreamStatusCode)
streamingSessionStream_statusCode :: Lens'
  StreamingSessionStream (Maybe StreamingSessionStreamStatusCode)
streamingSessionStream_statusCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingSessionStream' {Maybe StreamingSessionStreamStatusCode
statusCode :: Maybe StreamingSessionStreamStatusCode
$sel:statusCode:StreamingSessionStream' :: StreamingSessionStream -> Maybe StreamingSessionStreamStatusCode
statusCode} -> Maybe StreamingSessionStreamStatusCode
statusCode) (\s :: StreamingSessionStream
s@StreamingSessionStream' {} Maybe StreamingSessionStreamStatusCode
a -> StreamingSessionStream
s {$sel:statusCode:StreamingSessionStream' :: Maybe StreamingSessionStreamStatusCode
statusCode = Maybe StreamingSessionStreamStatusCode
a} :: StreamingSessionStream)

-- | The stream ID.
streamingSessionStream_streamId :: Lens.Lens' StreamingSessionStream (Prelude.Maybe Prelude.Text)
streamingSessionStream_streamId :: Lens' StreamingSessionStream (Maybe Text)
streamingSessionStream_streamId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingSessionStream' {Maybe Text
streamId :: Maybe Text
$sel:streamId:StreamingSessionStream' :: StreamingSessionStream -> Maybe Text
streamId} -> Maybe Text
streamId) (\s :: StreamingSessionStream
s@StreamingSessionStream' {} Maybe Text
a -> StreamingSessionStream
s {$sel:streamId:StreamingSessionStream' :: Maybe Text
streamId = Maybe Text
a} :: StreamingSessionStream)

-- | The URL to connect to this stream using the DCV client.
streamingSessionStream_url :: Lens.Lens' StreamingSessionStream (Prelude.Maybe Prelude.Text)
streamingSessionStream_url :: Lens' StreamingSessionStream (Maybe Text)
streamingSessionStream_url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingSessionStream' {Maybe (Sensitive Text)
url :: Maybe (Sensitive Text)
$sel:url:StreamingSessionStream' :: StreamingSessionStream -> Maybe (Sensitive Text)
url} -> Maybe (Sensitive Text)
url) (\s :: StreamingSessionStream
s@StreamingSessionStream' {} Maybe (Sensitive Text)
a -> StreamingSessionStream
s {$sel:url:StreamingSessionStream' :: Maybe (Sensitive Text)
url = Maybe (Sensitive Text)
a} :: StreamingSessionStream) 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 a. Iso' (Sensitive a) a
Data._Sensitive

instance Data.FromJSON StreamingSessionStream where
  parseJSON :: Value -> Parser StreamingSessionStream
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StreamingSessionStream"
      ( \Object
x ->
          Maybe ISO8601
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe StreamingSessionStreamState
-> Maybe StreamingSessionStreamStatusCode
-> Maybe Text
-> Maybe (Sensitive Text)
-> StreamingSessionStream
StreamingSessionStream'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"createdAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"createdBy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"expiresAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ownedBy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"state")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"statusCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"streamId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"url")
      )

instance Prelude.Hashable StreamingSessionStream where
  hashWithSalt :: Int -> StreamingSessionStream -> Int
hashWithSalt Int
_salt StreamingSessionStream' {Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
Maybe StreamingSessionStreamState
Maybe StreamingSessionStreamStatusCode
url :: Maybe (Sensitive Text)
streamId :: Maybe Text
statusCode :: Maybe StreamingSessionStreamStatusCode
state :: Maybe StreamingSessionStreamState
ownedBy :: Maybe Text
expiresAt :: Maybe ISO8601
createdBy :: Maybe Text
createdAt :: Maybe ISO8601
$sel:url:StreamingSessionStream' :: StreamingSessionStream -> Maybe (Sensitive Text)
$sel:streamId:StreamingSessionStream' :: StreamingSessionStream -> Maybe Text
$sel:statusCode:StreamingSessionStream' :: StreamingSessionStream -> Maybe StreamingSessionStreamStatusCode
$sel:state:StreamingSessionStream' :: StreamingSessionStream -> Maybe StreamingSessionStreamState
$sel:ownedBy:StreamingSessionStream' :: StreamingSessionStream -> Maybe Text
$sel:expiresAt:StreamingSessionStream' :: StreamingSessionStream -> Maybe ISO8601
$sel:createdBy:StreamingSessionStream' :: StreamingSessionStream -> Maybe Text
$sel:createdAt:StreamingSessionStream' :: StreamingSessionStream -> Maybe ISO8601
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
createdBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
expiresAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ownedBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StreamingSessionStreamState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StreamingSessionStreamStatusCode
statusCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
url

instance Prelude.NFData StreamingSessionStream where
  rnf :: StreamingSessionStream -> ()
rnf StreamingSessionStream' {Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
Maybe StreamingSessionStreamState
Maybe StreamingSessionStreamStatusCode
url :: Maybe (Sensitive Text)
streamId :: Maybe Text
statusCode :: Maybe StreamingSessionStreamStatusCode
state :: Maybe StreamingSessionStreamState
ownedBy :: Maybe Text
expiresAt :: Maybe ISO8601
createdBy :: Maybe Text
createdAt :: Maybe ISO8601
$sel:url:StreamingSessionStream' :: StreamingSessionStream -> Maybe (Sensitive Text)
$sel:streamId:StreamingSessionStream' :: StreamingSessionStream -> Maybe Text
$sel:statusCode:StreamingSessionStream' :: StreamingSessionStream -> Maybe StreamingSessionStreamStatusCode
$sel:state:StreamingSessionStream' :: StreamingSessionStream -> Maybe StreamingSessionStreamState
$sel:ownedBy:StreamingSessionStream' :: StreamingSessionStream -> Maybe Text
$sel:expiresAt:StreamingSessionStream' :: StreamingSessionStream -> Maybe ISO8601
$sel:createdBy:StreamingSessionStream' :: StreamingSessionStream -> Maybe Text
$sel:createdAt:StreamingSessionStream' :: StreamingSessionStream -> Maybe ISO8601
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
createdBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
expiresAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownedBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamingSessionStreamState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamingSessionStreamStatusCode
statusCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
url