{-# 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 #-}
module Amazonka.ECS.Types.Session 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
data Session = Session'
{
Session -> Maybe Text
sessionId :: Prelude.Maybe Prelude.Text,
Session -> Maybe Text
streamUrl :: Prelude.Maybe Prelude.Text,
Session -> Maybe (Sensitive Text)
tokenValue :: Prelude.Maybe (Data.Sensitive Prelude.Text)
}
deriving (Session -> Session -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Session -> Session -> Bool
$c/= :: Session -> Session -> Bool
== :: Session -> Session -> Bool
$c== :: Session -> Session -> Bool
Prelude.Eq, Int -> Session -> ShowS
[Session] -> ShowS
Session -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Session] -> ShowS
$cshowList :: [Session] -> ShowS
show :: Session -> String
$cshow :: Session -> String
showsPrec :: Int -> Session -> ShowS
$cshowsPrec :: Int -> Session -> ShowS
Prelude.Show, forall x. Rep Session x -> Session
forall x. Session -> Rep Session x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Session x -> Session
$cfrom :: forall x. Session -> Rep Session x
Prelude.Generic)
newSession ::
Session
newSession :: Session
newSession =
Session'
{ $sel:sessionId:Session' :: Maybe Text
sessionId = forall a. Maybe a
Prelude.Nothing,
$sel:streamUrl:Session' :: Maybe Text
streamUrl = forall a. Maybe a
Prelude.Nothing,
$sel:tokenValue:Session' :: Maybe (Sensitive Text)
tokenValue = forall a. Maybe a
Prelude.Nothing
}
session_sessionId :: Lens.Lens' Session (Prelude.Maybe Prelude.Text)
session_sessionId :: Lens' Session (Maybe Text)
session_sessionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Session' {Maybe Text
sessionId :: Maybe Text
$sel:sessionId:Session' :: Session -> Maybe Text
sessionId} -> Maybe Text
sessionId) (\s :: Session
s@Session' {} Maybe Text
a -> Session
s {$sel:sessionId:Session' :: Maybe Text
sessionId = Maybe Text
a} :: Session)
session_streamUrl :: Lens.Lens' Session (Prelude.Maybe Prelude.Text)
session_streamUrl :: Lens' Session (Maybe Text)
session_streamUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Session' {Maybe Text
streamUrl :: Maybe Text
$sel:streamUrl:Session' :: Session -> Maybe Text
streamUrl} -> Maybe Text
streamUrl) (\s :: Session
s@Session' {} Maybe Text
a -> Session
s {$sel:streamUrl:Session' :: Maybe Text
streamUrl = Maybe Text
a} :: Session)
session_tokenValue :: Lens.Lens' Session (Prelude.Maybe Prelude.Text)
session_tokenValue :: Lens' Session (Maybe Text)
session_tokenValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Session' {Maybe (Sensitive Text)
tokenValue :: Maybe (Sensitive Text)
$sel:tokenValue:Session' :: Session -> Maybe (Sensitive Text)
tokenValue} -> Maybe (Sensitive Text)
tokenValue) (\s :: Session
s@Session' {} Maybe (Sensitive Text)
a -> Session
s {$sel:tokenValue:Session' :: Maybe (Sensitive Text)
tokenValue = Maybe (Sensitive Text)
a} :: Session) 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 Session where
parseJSON :: Value -> Parser Session
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Session"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe (Sensitive Text) -> Session
Session'
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
"sessionId")
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
"streamUrl")
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
"tokenValue")
)
instance Prelude.Hashable Session where
hashWithSalt :: Int -> Session -> Int
hashWithSalt Int
_salt Session' {Maybe Text
Maybe (Sensitive Text)
tokenValue :: Maybe (Sensitive Text)
streamUrl :: Maybe Text
sessionId :: Maybe Text
$sel:tokenValue:Session' :: Session -> Maybe (Sensitive Text)
$sel:streamUrl:Session' :: Session -> Maybe Text
$sel:sessionId:Session' :: Session -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sessionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamUrl
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
tokenValue
instance Prelude.NFData Session where
rnf :: Session -> ()
rnf Session' {Maybe Text
Maybe (Sensitive Text)
tokenValue :: Maybe (Sensitive Text)
streamUrl :: Maybe Text
sessionId :: Maybe Text
$sel:tokenValue:Session' :: Session -> Maybe (Sensitive Text)
$sel:streamUrl:Session' :: Session -> Maybe Text
$sel:sessionId:Session' :: Session -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sessionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
tokenValue