{-# 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.Invite where
import Amazonka.Chime.Types.EmailStatus
import Amazonka.Chime.Types.InviteStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Invite = Invite'
{
Invite -> Maybe InviteStatus
status :: Prelude.Maybe InviteStatus,
Invite -> Maybe EmailStatus
emailStatus :: Prelude.Maybe EmailStatus,
Invite -> Maybe Text
inviteId :: Prelude.Maybe Prelude.Text,
Invite -> Maybe (Sensitive Text)
emailAddress :: Prelude.Maybe (Core.Sensitive Prelude.Text)
}
deriving (Invite -> Invite -> Bool
(Invite -> Invite -> Bool)
-> (Invite -> Invite -> Bool) -> Eq Invite
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Invite -> Invite -> Bool
$c/= :: Invite -> Invite -> Bool
== :: Invite -> Invite -> Bool
$c== :: Invite -> Invite -> Bool
Prelude.Eq, Int -> Invite -> ShowS
[Invite] -> ShowS
Invite -> String
(Int -> Invite -> ShowS)
-> (Invite -> String) -> ([Invite] -> ShowS) -> Show Invite
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Invite] -> ShowS
$cshowList :: [Invite] -> ShowS
show :: Invite -> String
$cshow :: Invite -> String
showsPrec :: Int -> Invite -> ShowS
$cshowsPrec :: Int -> Invite -> ShowS
Prelude.Show, (forall x. Invite -> Rep Invite x)
-> (forall x. Rep Invite x -> Invite) -> Generic Invite
forall x. Rep Invite x -> Invite
forall x. Invite -> Rep Invite x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Invite x -> Invite
$cfrom :: forall x. Invite -> Rep Invite x
Prelude.Generic)
newInvite ::
Invite
newInvite :: Invite
newInvite =
Invite' :: Maybe InviteStatus
-> Maybe EmailStatus
-> Maybe Text
-> Maybe (Sensitive Text)
-> Invite
Invite'
{ $sel:status:Invite' :: Maybe InviteStatus
status = Maybe InviteStatus
forall a. Maybe a
Prelude.Nothing,
$sel:emailStatus:Invite' :: Maybe EmailStatus
emailStatus = Maybe EmailStatus
forall a. Maybe a
Prelude.Nothing,
$sel:inviteId:Invite' :: Maybe Text
inviteId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:emailAddress:Invite' :: Maybe (Sensitive Text)
emailAddress = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing
}
invite_status :: Lens.Lens' Invite (Prelude.Maybe InviteStatus)
invite_status :: (Maybe InviteStatus -> f (Maybe InviteStatus))
-> Invite -> f Invite
invite_status = (Invite -> Maybe InviteStatus)
-> (Invite -> Maybe InviteStatus -> Invite)
-> Lens Invite Invite (Maybe InviteStatus) (Maybe InviteStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Invite' {Maybe InviteStatus
status :: Maybe InviteStatus
$sel:status:Invite' :: Invite -> Maybe InviteStatus
status} -> Maybe InviteStatus
status) (\s :: Invite
s@Invite' {} Maybe InviteStatus
a -> Invite
s {$sel:status:Invite' :: Maybe InviteStatus
status = Maybe InviteStatus
a} :: Invite)
invite_emailStatus :: Lens.Lens' Invite (Prelude.Maybe EmailStatus)
invite_emailStatus :: (Maybe EmailStatus -> f (Maybe EmailStatus)) -> Invite -> f Invite
invite_emailStatus = (Invite -> Maybe EmailStatus)
-> (Invite -> Maybe EmailStatus -> Invite)
-> Lens Invite Invite (Maybe EmailStatus) (Maybe EmailStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Invite' {Maybe EmailStatus
emailStatus :: Maybe EmailStatus
$sel:emailStatus:Invite' :: Invite -> Maybe EmailStatus
emailStatus} -> Maybe EmailStatus
emailStatus) (\s :: Invite
s@Invite' {} Maybe EmailStatus
a -> Invite
s {$sel:emailStatus:Invite' :: Maybe EmailStatus
emailStatus = Maybe EmailStatus
a} :: Invite)
invite_inviteId :: Lens.Lens' Invite (Prelude.Maybe Prelude.Text)
invite_inviteId :: (Maybe Text -> f (Maybe Text)) -> Invite -> f Invite
invite_inviteId = (Invite -> Maybe Text)
-> (Invite -> Maybe Text -> Invite)
-> Lens Invite Invite (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Invite' {Maybe Text
inviteId :: Maybe Text
$sel:inviteId:Invite' :: Invite -> Maybe Text
inviteId} -> Maybe Text
inviteId) (\s :: Invite
s@Invite' {} Maybe Text
a -> Invite
s {$sel:inviteId:Invite' :: Maybe Text
inviteId = Maybe Text
a} :: Invite)
invite_emailAddress :: Lens.Lens' Invite (Prelude.Maybe Prelude.Text)
invite_emailAddress :: (Maybe Text -> f (Maybe Text)) -> Invite -> f Invite
invite_emailAddress = (Invite -> Maybe (Sensitive Text))
-> (Invite -> Maybe (Sensitive Text) -> Invite)
-> Lens
Invite Invite (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Invite' {Maybe (Sensitive Text)
emailAddress :: Maybe (Sensitive Text)
$sel:emailAddress:Invite' :: Invite -> Maybe (Sensitive Text)
emailAddress} -> Maybe (Sensitive Text)
emailAddress) (\s :: Invite
s@Invite' {} Maybe (Sensitive Text)
a -> Invite
s {$sel:emailAddress:Invite' :: Maybe (Sensitive Text)
emailAddress = Maybe (Sensitive Text)
a} :: Invite) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> Invite -> f Invite)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Invite
-> f Invite
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 Invite where
parseJSON :: Value -> Parser Invite
parseJSON =
String -> (Object -> Parser Invite) -> Value -> Parser Invite
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Invite"
( \Object
x ->
Maybe InviteStatus
-> Maybe EmailStatus
-> Maybe Text
-> Maybe (Sensitive Text)
-> Invite
Invite'
(Maybe InviteStatus
-> Maybe EmailStatus
-> Maybe Text
-> Maybe (Sensitive Text)
-> Invite)
-> Parser (Maybe InviteStatus)
-> Parser
(Maybe EmailStatus
-> Maybe Text -> Maybe (Sensitive Text) -> Invite)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InviteStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe EmailStatus
-> Maybe Text -> Maybe (Sensitive Text) -> Invite)
-> Parser (Maybe EmailStatus)
-> Parser (Maybe Text -> Maybe (Sensitive Text) -> Invite)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EmailStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EmailStatus")
Parser (Maybe Text -> Maybe (Sensitive Text) -> Invite)
-> Parser (Maybe Text) -> Parser (Maybe (Sensitive Text) -> Invite)
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
"InviteId")
Parser (Maybe (Sensitive Text) -> Invite)
-> Parser (Maybe (Sensitive Text)) -> Parser Invite
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
"EmailAddress")
)
instance Prelude.Hashable Invite
instance Prelude.NFData Invite