{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Session = Session'
{
Session -> Maybe Text
streamUrl :: Prelude.Maybe Prelude.Text,
Session -> Maybe (Sensitive Text)
tokenValue :: Prelude.Maybe (Core.Sensitive Prelude.Text),
Session -> Maybe Text
sessionId :: Prelude.Maybe Prelude.Text
}
deriving (Session -> Session -> Bool
(Session -> Session -> Bool)
-> (Session -> Session -> Bool) -> Eq Session
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
(Int -> Session -> ShowS)
-> (Session -> String) -> ([Session] -> ShowS) -> Show Session
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. Session -> Rep Session x)
-> (forall x. Rep Session x -> Session) -> Generic Session
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' :: Maybe Text -> Maybe (Sensitive Text) -> Maybe Text -> Session
Session'
{ $sel:streamUrl:Session' :: Maybe Text
streamUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tokenValue:Session' :: Maybe (Sensitive Text)
tokenValue = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:sessionId:Session' :: Maybe Text
sessionId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
session_streamUrl :: Lens.Lens' Session (Prelude.Maybe Prelude.Text)
session_streamUrl :: (Maybe Text -> f (Maybe Text)) -> Session -> f Session
session_streamUrl = (Session -> Maybe Text)
-> (Session -> Maybe Text -> Session)
-> Lens Session Session (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> Session -> f Session
session_tokenValue = (Session -> Maybe (Sensitive Text))
-> (Session -> Maybe (Sensitive Text) -> Session)
-> Lens
Session Session (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
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) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> Session -> f Session)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Session
-> f Session
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
session_sessionId :: Lens.Lens' Session (Prelude.Maybe Prelude.Text)
session_sessionId :: (Maybe Text -> f (Maybe Text)) -> Session -> f Session
session_sessionId = (Session -> Maybe Text)
-> (Session -> Maybe Text -> Session)
-> Lens Session Session (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON Session where
parseJSON :: Value -> Parser Session
parseJSON =
String -> (Object -> Parser Session) -> Value -> Parser Session
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Session"
( \Object
x ->
Maybe Text -> Maybe (Sensitive Text) -> Maybe Text -> Session
Session'
(Maybe Text -> Maybe (Sensitive Text) -> Maybe Text -> Session)
-> Parser (Maybe Text)
-> Parser (Maybe (Sensitive Text) -> Maybe Text -> Session)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"streamUrl")
Parser (Maybe (Sensitive Text) -> Maybe Text -> Session)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Text -> Session)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tokenValue")
Parser (Maybe Text -> Session)
-> Parser (Maybe Text) -> Parser Session
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sessionId")
)
instance Prelude.Hashable Session
instance Prelude.NFData Session