{-# 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.Member where
import Amazonka.Chime.Types.MemberType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Member = Member'
{
Member -> Maybe (Sensitive Text)
fullName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
Member -> Maybe (Sensitive Text)
email :: Prelude.Maybe (Core.Sensitive Prelude.Text),
Member -> Maybe Text
memberId :: Prelude.Maybe Prelude.Text,
Member -> Maybe MemberType
memberType :: Prelude.Maybe MemberType,
Member -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text
}
deriving (Member -> Member -> Bool
(Member -> Member -> Bool)
-> (Member -> Member -> Bool) -> Eq Member
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Member -> Member -> Bool
$c/= :: Member -> Member -> Bool
== :: Member -> Member -> Bool
$c== :: Member -> Member -> Bool
Prelude.Eq, Int -> Member -> ShowS
[Member] -> ShowS
Member -> String
(Int -> Member -> ShowS)
-> (Member -> String) -> ([Member] -> ShowS) -> Show Member
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Member] -> ShowS
$cshowList :: [Member] -> ShowS
show :: Member -> String
$cshow :: Member -> String
showsPrec :: Int -> Member -> ShowS
$cshowsPrec :: Int -> Member -> ShowS
Prelude.Show, (forall x. Member -> Rep Member x)
-> (forall x. Rep Member x -> Member) -> Generic Member
forall x. Rep Member x -> Member
forall x. Member -> Rep Member x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Member x -> Member
$cfrom :: forall x. Member -> Rep Member x
Prelude.Generic)
newMember ::
Member
newMember :: Member
newMember =
Member' :: Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe MemberType
-> Maybe Text
-> Member
Member'
{ $sel:fullName:Member' :: Maybe (Sensitive Text)
fullName = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:email:Member' :: Maybe (Sensitive Text)
email = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:memberId:Member' :: Maybe Text
memberId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:memberType:Member' :: Maybe MemberType
memberType = Maybe MemberType
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:Member' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
member_fullName :: Lens.Lens' Member (Prelude.Maybe Prelude.Text)
member_fullName :: (Maybe Text -> f (Maybe Text)) -> Member -> f Member
member_fullName = (Member -> Maybe (Sensitive Text))
-> (Member -> Maybe (Sensitive Text) -> Member)
-> Lens
Member Member (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Member' {Maybe (Sensitive Text)
fullName :: Maybe (Sensitive Text)
$sel:fullName:Member' :: Member -> Maybe (Sensitive Text)
fullName} -> Maybe (Sensitive Text)
fullName) (\s :: Member
s@Member' {} Maybe (Sensitive Text)
a -> Member
s {$sel:fullName:Member' :: Maybe (Sensitive Text)
fullName = Maybe (Sensitive Text)
a} :: Member) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> Member -> f Member)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Member
-> f Member
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
member_email :: Lens.Lens' Member (Prelude.Maybe Prelude.Text)
member_email :: (Maybe Text -> f (Maybe Text)) -> Member -> f Member
member_email = (Member -> Maybe (Sensitive Text))
-> (Member -> Maybe (Sensitive Text) -> Member)
-> Lens
Member Member (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Member' {Maybe (Sensitive Text)
email :: Maybe (Sensitive Text)
$sel:email:Member' :: Member -> Maybe (Sensitive Text)
email} -> Maybe (Sensitive Text)
email) (\s :: Member
s@Member' {} Maybe (Sensitive Text)
a -> Member
s {$sel:email:Member' :: Maybe (Sensitive Text)
email = Maybe (Sensitive Text)
a} :: Member) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> Member -> f Member)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Member
-> f Member
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
member_memberId :: Lens.Lens' Member (Prelude.Maybe Prelude.Text)
member_memberId :: (Maybe Text -> f (Maybe Text)) -> Member -> f Member
member_memberId = (Member -> Maybe Text)
-> (Member -> Maybe Text -> Member)
-> Lens Member Member (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Member' {Maybe Text
memberId :: Maybe Text
$sel:memberId:Member' :: Member -> Maybe Text
memberId} -> Maybe Text
memberId) (\s :: Member
s@Member' {} Maybe Text
a -> Member
s {$sel:memberId:Member' :: Maybe Text
memberId = Maybe Text
a} :: Member)
member_memberType :: Lens.Lens' Member (Prelude.Maybe MemberType)
member_memberType :: (Maybe MemberType -> f (Maybe MemberType)) -> Member -> f Member
member_memberType = (Member -> Maybe MemberType)
-> (Member -> Maybe MemberType -> Member)
-> Lens Member Member (Maybe MemberType) (Maybe MemberType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Member' {Maybe MemberType
memberType :: Maybe MemberType
$sel:memberType:Member' :: Member -> Maybe MemberType
memberType} -> Maybe MemberType
memberType) (\s :: Member
s@Member' {} Maybe MemberType
a -> Member
s {$sel:memberType:Member' :: Maybe MemberType
memberType = Maybe MemberType
a} :: Member)
member_accountId :: Lens.Lens' Member (Prelude.Maybe Prelude.Text)
member_accountId :: (Maybe Text -> f (Maybe Text)) -> Member -> f Member
member_accountId = (Member -> Maybe Text)
-> (Member -> Maybe Text -> Member)
-> Lens Member Member (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Member' {Maybe Text
accountId :: Maybe Text
$sel:accountId:Member' :: Member -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: Member
s@Member' {} Maybe Text
a -> Member
s {$sel:accountId:Member' :: Maybe Text
accountId = Maybe Text
a} :: Member)
instance Core.FromJSON Member where
parseJSON :: Value -> Parser Member
parseJSON =
String -> (Object -> Parser Member) -> Value -> Parser Member
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Member"
( \Object
x ->
Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe MemberType
-> Maybe Text
-> Member
Member'
(Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe MemberType
-> Maybe Text
-> Member)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe (Sensitive Text)
-> Maybe Text -> Maybe MemberType -> Maybe Text -> Member)
forall (f :: * -> *) a b. Functor 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
"FullName")
Parser
(Maybe (Sensitive Text)
-> Maybe Text -> Maybe MemberType -> Maybe Text -> Member)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Text -> Maybe MemberType -> Maybe Text -> Member)
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
"Email")
Parser (Maybe Text -> Maybe MemberType -> Maybe Text -> Member)
-> Parser (Maybe Text)
-> Parser (Maybe MemberType -> Maybe Text -> Member)
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
"MemberId")
Parser (Maybe MemberType -> Maybe Text -> Member)
-> Parser (Maybe MemberType) -> Parser (Maybe Text -> Member)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MemberType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MemberType")
Parser (Maybe Text -> Member)
-> Parser (Maybe Text) -> Parser Member
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")
)
instance Prelude.Hashable Member
instance Prelude.NFData Member