{-# 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.Chime.Types.Identity 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 Identity = Identity'
{
Identity -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Identity -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Data.Sensitive Prelude.Text)
}
deriving (Identity -> Identity -> Bool
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
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. 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'
{ $sel:arn:Identity' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:name:Identity' :: Maybe (Sensitive Text)
name = forall a. Maybe a
Prelude.Nothing
}
identity_arn :: Lens.Lens' Identity (Prelude.Maybe Prelude.Text)
identity_arn :: Lens' Identity (Maybe Text)
identity_arn = 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 :: Lens' Identity (Maybe Text)
identity_name = 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) 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 Identity where
parseJSON :: Value -> Parser Identity
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Identity"
( \Object
x ->
Maybe Text -> Maybe (Sensitive Text) -> Identity
Identity'
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
"Arn")
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
"Name")
)
instance Prelude.Hashable Identity where
hashWithSalt :: Int -> Identity -> Int
hashWithSalt Int
_salt Identity' {Maybe Text
Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
arn :: Maybe Text
$sel:name:Identity' :: Identity -> Maybe (Sensitive Text)
$sel:arn:Identity' :: Identity -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
name
instance Prelude.NFData Identity where
rnf :: Identity -> ()
rnf Identity' {Maybe Text
Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
arn :: Maybe Text
$sel:name:Identity' :: Identity -> Maybe (Sensitive Text)
$sel:arn:Identity' :: Identity -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
name