{-# 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.ChannelModerator where
import Amazonka.Chime.Types.Identity
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ChannelModerator = ChannelModerator'
{
ChannelModerator -> Maybe Identity
createdBy :: Prelude.Maybe Identity,
ChannelModerator -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
ChannelModerator -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Core.POSIX,
ChannelModerator -> Maybe Identity
moderator :: Prelude.Maybe Identity
}
deriving (ChannelModerator -> ChannelModerator -> Bool
(ChannelModerator -> ChannelModerator -> Bool)
-> (ChannelModerator -> ChannelModerator -> Bool)
-> Eq ChannelModerator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelModerator -> ChannelModerator -> Bool
$c/= :: ChannelModerator -> ChannelModerator -> Bool
== :: ChannelModerator -> ChannelModerator -> Bool
$c== :: ChannelModerator -> ChannelModerator -> Bool
Prelude.Eq, Int -> ChannelModerator -> ShowS
[ChannelModerator] -> ShowS
ChannelModerator -> String
(Int -> ChannelModerator -> ShowS)
-> (ChannelModerator -> String)
-> ([ChannelModerator] -> ShowS)
-> Show ChannelModerator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelModerator] -> ShowS
$cshowList :: [ChannelModerator] -> ShowS
show :: ChannelModerator -> String
$cshow :: ChannelModerator -> String
showsPrec :: Int -> ChannelModerator -> ShowS
$cshowsPrec :: Int -> ChannelModerator -> ShowS
Prelude.Show, (forall x. ChannelModerator -> Rep ChannelModerator x)
-> (forall x. Rep ChannelModerator x -> ChannelModerator)
-> Generic ChannelModerator
forall x. Rep ChannelModerator x -> ChannelModerator
forall x. ChannelModerator -> Rep ChannelModerator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelModerator x -> ChannelModerator
$cfrom :: forall x. ChannelModerator -> Rep ChannelModerator x
Prelude.Generic)
newChannelModerator ::
ChannelModerator
newChannelModerator :: ChannelModerator
newChannelModerator =
ChannelModerator' :: Maybe Identity
-> Maybe Text -> Maybe POSIX -> Maybe Identity -> ChannelModerator
ChannelModerator'
{ $sel:createdBy:ChannelModerator' :: Maybe Identity
createdBy = Maybe Identity
forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:ChannelModerator' :: Maybe Text
channelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdTimestamp:ChannelModerator' :: Maybe POSIX
createdTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:moderator:ChannelModerator' :: Maybe Identity
moderator = Maybe Identity
forall a. Maybe a
Prelude.Nothing
}
channelModerator_createdBy :: Lens.Lens' ChannelModerator (Prelude.Maybe Identity)
channelModerator_createdBy :: (Maybe Identity -> f (Maybe Identity))
-> ChannelModerator -> f ChannelModerator
channelModerator_createdBy = (ChannelModerator -> Maybe Identity)
-> (ChannelModerator -> Maybe Identity -> ChannelModerator)
-> Lens
ChannelModerator ChannelModerator (Maybe Identity) (Maybe Identity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelModerator' {Maybe Identity
createdBy :: Maybe Identity
$sel:createdBy:ChannelModerator' :: ChannelModerator -> Maybe Identity
createdBy} -> Maybe Identity
createdBy) (\s :: ChannelModerator
s@ChannelModerator' {} Maybe Identity
a -> ChannelModerator
s {$sel:createdBy:ChannelModerator' :: Maybe Identity
createdBy = Maybe Identity
a} :: ChannelModerator)
channelModerator_channelArn :: Lens.Lens' ChannelModerator (Prelude.Maybe Prelude.Text)
channelModerator_channelArn :: (Maybe Text -> f (Maybe Text))
-> ChannelModerator -> f ChannelModerator
channelModerator_channelArn = (ChannelModerator -> Maybe Text)
-> (ChannelModerator -> Maybe Text -> ChannelModerator)
-> Lens ChannelModerator ChannelModerator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelModerator' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:ChannelModerator' :: ChannelModerator -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: ChannelModerator
s@ChannelModerator' {} Maybe Text
a -> ChannelModerator
s {$sel:channelArn:ChannelModerator' :: Maybe Text
channelArn = Maybe Text
a} :: ChannelModerator)
channelModerator_createdTimestamp :: Lens.Lens' ChannelModerator (Prelude.Maybe Prelude.UTCTime)
channelModerator_createdTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ChannelModerator -> f ChannelModerator
channelModerator_createdTimestamp = (ChannelModerator -> Maybe POSIX)
-> (ChannelModerator -> Maybe POSIX -> ChannelModerator)
-> Lens
ChannelModerator ChannelModerator (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelModerator' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:ChannelModerator' :: ChannelModerator -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: ChannelModerator
s@ChannelModerator' {} Maybe POSIX
a -> ChannelModerator
s {$sel:createdTimestamp:ChannelModerator' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: ChannelModerator) ((Maybe POSIX -> f (Maybe POSIX))
-> ChannelModerator -> f ChannelModerator)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ChannelModerator
-> f ChannelModerator
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
channelModerator_moderator :: Lens.Lens' ChannelModerator (Prelude.Maybe Identity)
channelModerator_moderator :: (Maybe Identity -> f (Maybe Identity))
-> ChannelModerator -> f ChannelModerator
channelModerator_moderator = (ChannelModerator -> Maybe Identity)
-> (ChannelModerator -> Maybe Identity -> ChannelModerator)
-> Lens
ChannelModerator ChannelModerator (Maybe Identity) (Maybe Identity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelModerator' {Maybe Identity
moderator :: Maybe Identity
$sel:moderator:ChannelModerator' :: ChannelModerator -> Maybe Identity
moderator} -> Maybe Identity
moderator) (\s :: ChannelModerator
s@ChannelModerator' {} Maybe Identity
a -> ChannelModerator
s {$sel:moderator:ChannelModerator' :: Maybe Identity
moderator = Maybe Identity
a} :: ChannelModerator)
instance Core.FromJSON ChannelModerator where
parseJSON :: Value -> Parser ChannelModerator
parseJSON =
String
-> (Object -> Parser ChannelModerator)
-> Value
-> Parser ChannelModerator
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ChannelModerator"
( \Object
x ->
Maybe Identity
-> Maybe Text -> Maybe POSIX -> Maybe Identity -> ChannelModerator
ChannelModerator'
(Maybe Identity
-> Maybe Text -> Maybe POSIX -> Maybe Identity -> ChannelModerator)
-> Parser (Maybe Identity)
-> Parser
(Maybe Text -> Maybe POSIX -> Maybe Identity -> ChannelModerator)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Identity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedBy")
Parser
(Maybe Text -> Maybe POSIX -> Maybe Identity -> ChannelModerator)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Identity -> ChannelModerator)
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
"ChannelArn")
Parser (Maybe POSIX -> Maybe Identity -> ChannelModerator)
-> Parser (Maybe POSIX)
-> Parser (Maybe Identity -> ChannelModerator)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTimestamp")
Parser (Maybe Identity -> ChannelModerator)
-> Parser (Maybe Identity) -> Parser ChannelModerator
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Identity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Moderator")
)
instance Prelude.Hashable ChannelModerator
instance Prelude.NFData ChannelModerator