{-# 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.ChimeSDKMessaging.Types.Identity where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Identity = Identity'
{
Identity -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Identity -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Core.Sensitive Prelude.Text)
}
deriving (Identity -> Identity -> Bool
(Identity -> Identity -> Bool)
-> (Identity -> Identity -> Bool) -> Eq Identity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Identity -> Identity -> Bool
$c/= :: Identity -> Identity -> Bool
== :: Identity -> Identity -> Bool
$c== :: Identity -> Identity -> Bool
Prelude.Eq, Int -> Identity -> ShowS
[Identity] -> ShowS
Identity -> String
(Int -> Identity -> ShowS)
-> (Identity -> String) -> ([Identity] -> ShowS) -> Show Identity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Identity] -> ShowS
$cshowList :: [Identity] -> ShowS
show :: Identity -> String
$cshow :: Identity -> String
showsPrec :: Int -> Identity -> ShowS
$cshowsPrec :: Int -> Identity -> ShowS
Prelude.Show, (forall x. Identity -> Rep Identity x)
-> (forall x. Rep Identity x -> Identity) -> Generic Identity
forall x. Rep Identity x -> Identity
forall x. Identity -> Rep Identity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Identity x -> Identity
$cfrom :: forall x. Identity -> Rep Identity x
Prelude.Generic)
newIdentity ::
Identity
newIdentity :: Identity
newIdentity =
Identity' :: Maybe Text -> Maybe (Sensitive Text) -> Identity
Identity'
{ $sel:arn:Identity' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Identity' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing
}
identity_arn :: Lens.Lens' Identity (Prelude.Maybe Prelude.Text)
identity_arn :: (Maybe Text -> f (Maybe Text)) -> Identity -> f Identity
identity_arn = (Identity -> Maybe Text)
-> (Identity -> Maybe Text -> Identity)
-> Lens Identity Identity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Identity' {Maybe Text
arn :: Maybe Text
$sel:arn:Identity' :: Identity -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Identity
s@Identity' {} Maybe Text
a -> Identity
s {$sel:arn:Identity' :: Maybe Text
arn = Maybe Text
a} :: Identity)
identity_name :: Lens.Lens' Identity (Prelude.Maybe Prelude.Text)
identity_name :: (Maybe Text -> f (Maybe Text)) -> Identity -> f Identity
identity_name = (Identity -> Maybe (Sensitive Text))
-> (Identity -> Maybe (Sensitive Text) -> Identity)
-> Lens
Identity Identity (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Identity' {Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
$sel:name:Identity' :: Identity -> Maybe (Sensitive Text)
name} -> Maybe (Sensitive Text)
name) (\s :: Identity
s@Identity' {} Maybe (Sensitive Text)
a -> Identity
s {$sel:name:Identity' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
a} :: Identity) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> Identity -> f Identity)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Identity
-> f Identity
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
instance Core.FromJSON Identity where
parseJSON :: Value -> Parser Identity
parseJSON =
String -> (Object -> Parser Identity) -> Value -> Parser Identity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Identity"
( \Object
x ->
Maybe Text -> Maybe (Sensitive Text) -> Identity
Identity'
(Maybe Text -> Maybe (Sensitive Text) -> Identity)
-> Parser (Maybe Text)
-> Parser (Maybe (Sensitive Text) -> Identity)
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
"Arn") Parser (Maybe (Sensitive Text) -> Identity)
-> Parser (Maybe (Sensitive Text)) -> Parser Identity
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
"Name")
)
instance Prelude.Hashable Identity
instance Prelude.NFData Identity