{-# 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.MacieV2.Types.SessionIssuer where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SessionIssuer = SessionIssuer'
{
SessionIssuer -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text,
SessionIssuer -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
SessionIssuer -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
SessionIssuer -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
SessionIssuer -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (SessionIssuer -> SessionIssuer -> Bool
(SessionIssuer -> SessionIssuer -> Bool)
-> (SessionIssuer -> SessionIssuer -> Bool) -> Eq SessionIssuer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SessionIssuer -> SessionIssuer -> Bool
$c/= :: SessionIssuer -> SessionIssuer -> Bool
== :: SessionIssuer -> SessionIssuer -> Bool
$c== :: SessionIssuer -> SessionIssuer -> Bool
Prelude.Eq, ReadPrec [SessionIssuer]
ReadPrec SessionIssuer
Int -> ReadS SessionIssuer
ReadS [SessionIssuer]
(Int -> ReadS SessionIssuer)
-> ReadS [SessionIssuer]
-> ReadPrec SessionIssuer
-> ReadPrec [SessionIssuer]
-> Read SessionIssuer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SessionIssuer]
$creadListPrec :: ReadPrec [SessionIssuer]
readPrec :: ReadPrec SessionIssuer
$creadPrec :: ReadPrec SessionIssuer
readList :: ReadS [SessionIssuer]
$creadList :: ReadS [SessionIssuer]
readsPrec :: Int -> ReadS SessionIssuer
$creadsPrec :: Int -> ReadS SessionIssuer
Prelude.Read, Int -> SessionIssuer -> ShowS
[SessionIssuer] -> ShowS
SessionIssuer -> String
(Int -> SessionIssuer -> ShowS)
-> (SessionIssuer -> String)
-> ([SessionIssuer] -> ShowS)
-> Show SessionIssuer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SessionIssuer] -> ShowS
$cshowList :: [SessionIssuer] -> ShowS
show :: SessionIssuer -> String
$cshow :: SessionIssuer -> String
showsPrec :: Int -> SessionIssuer -> ShowS
$cshowsPrec :: Int -> SessionIssuer -> ShowS
Prelude.Show, (forall x. SessionIssuer -> Rep SessionIssuer x)
-> (forall x. Rep SessionIssuer x -> SessionIssuer)
-> Generic SessionIssuer
forall x. Rep SessionIssuer x -> SessionIssuer
forall x. SessionIssuer -> Rep SessionIssuer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SessionIssuer x -> SessionIssuer
$cfrom :: forall x. SessionIssuer -> Rep SessionIssuer x
Prelude.Generic)
newSessionIssuer ::
SessionIssuer
newSessionIssuer :: SessionIssuer
newSessionIssuer =
SessionIssuer' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SessionIssuer
SessionIssuer'
{ $sel:principalId:SessionIssuer' :: Maybe Text
principalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:SessionIssuer' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userName:SessionIssuer' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:SessionIssuer' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':SessionIssuer' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
sessionIssuer_principalId :: Lens.Lens' SessionIssuer (Prelude.Maybe Prelude.Text)
sessionIssuer_principalId :: (Maybe Text -> f (Maybe Text)) -> SessionIssuer -> f SessionIssuer
sessionIssuer_principalId = (SessionIssuer -> Maybe Text)
-> (SessionIssuer -> Maybe Text -> SessionIssuer)
-> Lens SessionIssuer SessionIssuer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionIssuer' {Maybe Text
principalId :: Maybe Text
$sel:principalId:SessionIssuer' :: SessionIssuer -> Maybe Text
principalId} -> Maybe Text
principalId) (\s :: SessionIssuer
s@SessionIssuer' {} Maybe Text
a -> SessionIssuer
s {$sel:principalId:SessionIssuer' :: Maybe Text
principalId = Maybe Text
a} :: SessionIssuer)
sessionIssuer_arn :: Lens.Lens' SessionIssuer (Prelude.Maybe Prelude.Text)
sessionIssuer_arn :: (Maybe Text -> f (Maybe Text)) -> SessionIssuer -> f SessionIssuer
sessionIssuer_arn = (SessionIssuer -> Maybe Text)
-> (SessionIssuer -> Maybe Text -> SessionIssuer)
-> Lens SessionIssuer SessionIssuer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionIssuer' {Maybe Text
arn :: Maybe Text
$sel:arn:SessionIssuer' :: SessionIssuer -> Maybe Text
arn} -> Maybe Text
arn) (\s :: SessionIssuer
s@SessionIssuer' {} Maybe Text
a -> SessionIssuer
s {$sel:arn:SessionIssuer' :: Maybe Text
arn = Maybe Text
a} :: SessionIssuer)
sessionIssuer_userName :: Lens.Lens' SessionIssuer (Prelude.Maybe Prelude.Text)
sessionIssuer_userName :: (Maybe Text -> f (Maybe Text)) -> SessionIssuer -> f SessionIssuer
sessionIssuer_userName = (SessionIssuer -> Maybe Text)
-> (SessionIssuer -> Maybe Text -> SessionIssuer)
-> Lens SessionIssuer SessionIssuer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionIssuer' {Maybe Text
userName :: Maybe Text
$sel:userName:SessionIssuer' :: SessionIssuer -> Maybe Text
userName} -> Maybe Text
userName) (\s :: SessionIssuer
s@SessionIssuer' {} Maybe Text
a -> SessionIssuer
s {$sel:userName:SessionIssuer' :: Maybe Text
userName = Maybe Text
a} :: SessionIssuer)
sessionIssuer_accountId :: Lens.Lens' SessionIssuer (Prelude.Maybe Prelude.Text)
sessionIssuer_accountId :: (Maybe Text -> f (Maybe Text)) -> SessionIssuer -> f SessionIssuer
sessionIssuer_accountId = (SessionIssuer -> Maybe Text)
-> (SessionIssuer -> Maybe Text -> SessionIssuer)
-> Lens SessionIssuer SessionIssuer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionIssuer' {Maybe Text
accountId :: Maybe Text
$sel:accountId:SessionIssuer' :: SessionIssuer -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: SessionIssuer
s@SessionIssuer' {} Maybe Text
a -> SessionIssuer
s {$sel:accountId:SessionIssuer' :: Maybe Text
accountId = Maybe Text
a} :: SessionIssuer)
sessionIssuer_type :: Lens.Lens' SessionIssuer (Prelude.Maybe Prelude.Text)
sessionIssuer_type :: (Maybe Text -> f (Maybe Text)) -> SessionIssuer -> f SessionIssuer
sessionIssuer_type = (SessionIssuer -> Maybe Text)
-> (SessionIssuer -> Maybe Text -> SessionIssuer)
-> Lens SessionIssuer SessionIssuer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionIssuer' {Maybe Text
type' :: Maybe Text
$sel:type':SessionIssuer' :: SessionIssuer -> Maybe Text
type'} -> Maybe Text
type') (\s :: SessionIssuer
s@SessionIssuer' {} Maybe Text
a -> SessionIssuer
s {$sel:type':SessionIssuer' :: Maybe Text
type' = Maybe Text
a} :: SessionIssuer)
instance Core.FromJSON SessionIssuer where
parseJSON :: Value -> Parser SessionIssuer
parseJSON =
String
-> (Object -> Parser SessionIssuer)
-> Value
-> Parser SessionIssuer
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SessionIssuer"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SessionIssuer
SessionIssuer'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SessionIssuer)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> SessionIssuer)
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
"principalId")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> SessionIssuer)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> SessionIssuer)
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
"arn")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> SessionIssuer)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> SessionIssuer)
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
"userName")
Parser (Maybe Text -> Maybe Text -> SessionIssuer)
-> Parser (Maybe Text) -> Parser (Maybe Text -> SessionIssuer)
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
"accountId")
Parser (Maybe Text -> SessionIssuer)
-> Parser (Maybe Text) -> Parser SessionIssuer
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
"type")
)
instance Prelude.Hashable SessionIssuer
instance Prelude.NFData SessionIssuer