{-# 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.ChannelBan 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 ChannelBan = ChannelBan'
{
ChannelBan -> Maybe Identity
createdBy :: Prelude.Maybe Identity,
ChannelBan -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
ChannelBan -> Maybe Identity
member :: Prelude.Maybe Identity,
ChannelBan -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Core.POSIX
}
deriving (ChannelBan -> ChannelBan -> Bool
(ChannelBan -> ChannelBan -> Bool)
-> (ChannelBan -> ChannelBan -> Bool) -> Eq ChannelBan
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelBan -> ChannelBan -> Bool
$c/= :: ChannelBan -> ChannelBan -> Bool
== :: ChannelBan -> ChannelBan -> Bool
$c== :: ChannelBan -> ChannelBan -> Bool
Prelude.Eq, Int -> ChannelBan -> ShowS
[ChannelBan] -> ShowS
ChannelBan -> String
(Int -> ChannelBan -> ShowS)
-> (ChannelBan -> String)
-> ([ChannelBan] -> ShowS)
-> Show ChannelBan
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelBan] -> ShowS
$cshowList :: [ChannelBan] -> ShowS
show :: ChannelBan -> String
$cshow :: ChannelBan -> String
showsPrec :: Int -> ChannelBan -> ShowS
$cshowsPrec :: Int -> ChannelBan -> ShowS
Prelude.Show, (forall x. ChannelBan -> Rep ChannelBan x)
-> (forall x. Rep ChannelBan x -> ChannelBan) -> Generic ChannelBan
forall x. Rep ChannelBan x -> ChannelBan
forall x. ChannelBan -> Rep ChannelBan x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelBan x -> ChannelBan
$cfrom :: forall x. ChannelBan -> Rep ChannelBan x
Prelude.Generic)
newChannelBan ::
ChannelBan
newChannelBan :: ChannelBan
newChannelBan =
ChannelBan' :: Maybe Identity
-> Maybe Text -> Maybe Identity -> Maybe POSIX -> ChannelBan
ChannelBan'
{ $sel:createdBy:ChannelBan' :: Maybe Identity
createdBy = Maybe Identity
forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:ChannelBan' :: Maybe Text
channelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:member:ChannelBan' :: Maybe Identity
member = Maybe Identity
forall a. Maybe a
Prelude.Nothing,
$sel:createdTimestamp:ChannelBan' :: Maybe POSIX
createdTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
channelBan_createdBy :: Lens.Lens' ChannelBan (Prelude.Maybe Identity)
channelBan_createdBy :: (Maybe Identity -> f (Maybe Identity))
-> ChannelBan -> f ChannelBan
channelBan_createdBy = (ChannelBan -> Maybe Identity)
-> (ChannelBan -> Maybe Identity -> ChannelBan)
-> Lens ChannelBan ChannelBan (Maybe Identity) (Maybe Identity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelBan' {Maybe Identity
createdBy :: Maybe Identity
$sel:createdBy:ChannelBan' :: ChannelBan -> Maybe Identity
createdBy} -> Maybe Identity
createdBy) (\s :: ChannelBan
s@ChannelBan' {} Maybe Identity
a -> ChannelBan
s {$sel:createdBy:ChannelBan' :: Maybe Identity
createdBy = Maybe Identity
a} :: ChannelBan)
channelBan_channelArn :: Lens.Lens' ChannelBan (Prelude.Maybe Prelude.Text)
channelBan_channelArn :: (Maybe Text -> f (Maybe Text)) -> ChannelBan -> f ChannelBan
channelBan_channelArn = (ChannelBan -> Maybe Text)
-> (ChannelBan -> Maybe Text -> ChannelBan)
-> Lens ChannelBan ChannelBan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelBan' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:ChannelBan' :: ChannelBan -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: ChannelBan
s@ChannelBan' {} Maybe Text
a -> ChannelBan
s {$sel:channelArn:ChannelBan' :: Maybe Text
channelArn = Maybe Text
a} :: ChannelBan)
channelBan_member :: Lens.Lens' ChannelBan (Prelude.Maybe Identity)
channelBan_member :: (Maybe Identity -> f (Maybe Identity))
-> ChannelBan -> f ChannelBan
channelBan_member = (ChannelBan -> Maybe Identity)
-> (ChannelBan -> Maybe Identity -> ChannelBan)
-> Lens ChannelBan ChannelBan (Maybe Identity) (Maybe Identity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelBan' {Maybe Identity
member :: Maybe Identity
$sel:member:ChannelBan' :: ChannelBan -> Maybe Identity
member} -> Maybe Identity
member) (\s :: ChannelBan
s@ChannelBan' {} Maybe Identity
a -> ChannelBan
s {$sel:member:ChannelBan' :: Maybe Identity
member = Maybe Identity
a} :: ChannelBan)
channelBan_createdTimestamp :: Lens.Lens' ChannelBan (Prelude.Maybe Prelude.UTCTime)
channelBan_createdTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime)) -> ChannelBan -> f ChannelBan
channelBan_createdTimestamp = (ChannelBan -> Maybe POSIX)
-> (ChannelBan -> Maybe POSIX -> ChannelBan)
-> Lens ChannelBan ChannelBan (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelBan' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:ChannelBan' :: ChannelBan -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: ChannelBan
s@ChannelBan' {} Maybe POSIX
a -> ChannelBan
s {$sel:createdTimestamp:ChannelBan' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: ChannelBan) ((Maybe POSIX -> f (Maybe POSIX)) -> ChannelBan -> f ChannelBan)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ChannelBan
-> f ChannelBan
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
instance Core.FromJSON ChannelBan where
parseJSON :: Value -> Parser ChannelBan
parseJSON =
String
-> (Object -> Parser ChannelBan) -> Value -> Parser ChannelBan
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ChannelBan"
( \Object
x ->
Maybe Identity
-> Maybe Text -> Maybe Identity -> Maybe POSIX -> ChannelBan
ChannelBan'
(Maybe Identity
-> Maybe Text -> Maybe Identity -> Maybe POSIX -> ChannelBan)
-> Parser (Maybe Identity)
-> Parser
(Maybe Text -> Maybe Identity -> Maybe POSIX -> ChannelBan)
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 Identity -> Maybe POSIX -> ChannelBan)
-> Parser (Maybe Text)
-> Parser (Maybe Identity -> Maybe POSIX -> ChannelBan)
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 Identity -> Maybe POSIX -> ChannelBan)
-> Parser (Maybe Identity) -> Parser (Maybe POSIX -> ChannelBan)
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
"Member")
Parser (Maybe POSIX -> ChannelBan)
-> Parser (Maybe POSIX) -> Parser ChannelBan
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")
)
instance Prelude.Hashable ChannelBan
instance Prelude.NFData ChannelBan