{-# 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.CreateAttendeeRequestItem where
import Amazonka.Chime.Types.Tag
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CreateAttendeeRequestItem = CreateAttendeeRequestItem'
{
CreateAttendeeRequestItem -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
CreateAttendeeRequestItem -> Sensitive Text
externalUserId :: Core.Sensitive Prelude.Text
}
deriving (CreateAttendeeRequestItem -> CreateAttendeeRequestItem -> Bool
(CreateAttendeeRequestItem -> CreateAttendeeRequestItem -> Bool)
-> (CreateAttendeeRequestItem -> CreateAttendeeRequestItem -> Bool)
-> Eq CreateAttendeeRequestItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAttendeeRequestItem -> CreateAttendeeRequestItem -> Bool
$c/= :: CreateAttendeeRequestItem -> CreateAttendeeRequestItem -> Bool
== :: CreateAttendeeRequestItem -> CreateAttendeeRequestItem -> Bool
$c== :: CreateAttendeeRequestItem -> CreateAttendeeRequestItem -> Bool
Prelude.Eq, Int -> CreateAttendeeRequestItem -> ShowS
[CreateAttendeeRequestItem] -> ShowS
CreateAttendeeRequestItem -> String
(Int -> CreateAttendeeRequestItem -> ShowS)
-> (CreateAttendeeRequestItem -> String)
-> ([CreateAttendeeRequestItem] -> ShowS)
-> Show CreateAttendeeRequestItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAttendeeRequestItem] -> ShowS
$cshowList :: [CreateAttendeeRequestItem] -> ShowS
show :: CreateAttendeeRequestItem -> String
$cshow :: CreateAttendeeRequestItem -> String
showsPrec :: Int -> CreateAttendeeRequestItem -> ShowS
$cshowsPrec :: Int -> CreateAttendeeRequestItem -> ShowS
Prelude.Show, (forall x.
CreateAttendeeRequestItem -> Rep CreateAttendeeRequestItem x)
-> (forall x.
Rep CreateAttendeeRequestItem x -> CreateAttendeeRequestItem)
-> Generic CreateAttendeeRequestItem
forall x.
Rep CreateAttendeeRequestItem x -> CreateAttendeeRequestItem
forall x.
CreateAttendeeRequestItem -> Rep CreateAttendeeRequestItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAttendeeRequestItem x -> CreateAttendeeRequestItem
$cfrom :: forall x.
CreateAttendeeRequestItem -> Rep CreateAttendeeRequestItem x
Prelude.Generic)
newCreateAttendeeRequestItem ::
Prelude.Text ->
CreateAttendeeRequestItem
newCreateAttendeeRequestItem :: Text -> CreateAttendeeRequestItem
newCreateAttendeeRequestItem Text
pExternalUserId_ =
CreateAttendeeRequestItem' :: Maybe (NonEmpty Tag) -> Sensitive Text -> CreateAttendeeRequestItem
CreateAttendeeRequestItem'
{ $sel:tags:CreateAttendeeRequestItem' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
$sel:externalUserId:CreateAttendeeRequestItem' :: Sensitive Text
externalUserId =
Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pExternalUserId_
}
createAttendeeRequestItem_tags :: Lens.Lens' CreateAttendeeRequestItem (Prelude.Maybe (Prelude.NonEmpty Tag))
createAttendeeRequestItem_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateAttendeeRequestItem -> f CreateAttendeeRequestItem
createAttendeeRequestItem_tags = (CreateAttendeeRequestItem -> Maybe (NonEmpty Tag))
-> (CreateAttendeeRequestItem
-> Maybe (NonEmpty Tag) -> CreateAttendeeRequestItem)
-> Lens
CreateAttendeeRequestItem
CreateAttendeeRequestItem
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAttendeeRequestItem' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateAttendeeRequestItem' :: CreateAttendeeRequestItem -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateAttendeeRequestItem
s@CreateAttendeeRequestItem' {} Maybe (NonEmpty Tag)
a -> CreateAttendeeRequestItem
s {$sel:tags:CreateAttendeeRequestItem' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateAttendeeRequestItem) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateAttendeeRequestItem -> f CreateAttendeeRequestItem)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateAttendeeRequestItem
-> f CreateAttendeeRequestItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createAttendeeRequestItem_externalUserId :: Lens.Lens' CreateAttendeeRequestItem Prelude.Text
createAttendeeRequestItem_externalUserId :: (Text -> f Text)
-> CreateAttendeeRequestItem -> f CreateAttendeeRequestItem
createAttendeeRequestItem_externalUserId = (CreateAttendeeRequestItem -> Sensitive Text)
-> (CreateAttendeeRequestItem
-> Sensitive Text -> CreateAttendeeRequestItem)
-> Lens
CreateAttendeeRequestItem
CreateAttendeeRequestItem
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAttendeeRequestItem' {Sensitive Text
externalUserId :: Sensitive Text
$sel:externalUserId:CreateAttendeeRequestItem' :: CreateAttendeeRequestItem -> Sensitive Text
externalUserId} -> Sensitive Text
externalUserId) (\s :: CreateAttendeeRequestItem
s@CreateAttendeeRequestItem' {} Sensitive Text
a -> CreateAttendeeRequestItem
s {$sel:externalUserId:CreateAttendeeRequestItem' :: Sensitive Text
externalUserId = Sensitive Text
a} :: CreateAttendeeRequestItem) ((Sensitive Text -> f (Sensitive Text))
-> CreateAttendeeRequestItem -> f CreateAttendeeRequestItem)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> CreateAttendeeRequestItem
-> f CreateAttendeeRequestItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Prelude.Hashable CreateAttendeeRequestItem
instance Prelude.NFData CreateAttendeeRequestItem
instance Core.ToJSON CreateAttendeeRequestItem where
toJSON :: CreateAttendeeRequestItem -> Value
toJSON CreateAttendeeRequestItem' {Maybe (NonEmpty Tag)
Sensitive Text
externalUserId :: Sensitive Text
tags :: Maybe (NonEmpty Tag)
$sel:externalUserId:CreateAttendeeRequestItem' :: CreateAttendeeRequestItem -> Sensitive Text
$sel:tags:CreateAttendeeRequestItem' :: CreateAttendeeRequestItem -> Maybe (NonEmpty Tag)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ExternalUserId" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
externalUserId)
]
)