{-# 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.ChimeSDKMessaging.Types.ChannelSummary where
import Amazonka.ChimeSDKMessaging.Types.ChannelMode
import Amazonka.ChimeSDKMessaging.Types.ChannelPrivacy
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ChannelSummary = ChannelSummary'
{
ChannelSummary -> Maybe ChannelMode
mode :: Prelude.Maybe ChannelMode,
ChannelSummary -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
ChannelSummary -> Maybe ChannelPrivacy
privacy :: Prelude.Maybe ChannelPrivacy,
ChannelSummary -> Maybe POSIX
lastMessageTimestamp :: Prelude.Maybe Core.POSIX,
ChannelSummary -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Core.Sensitive Prelude.Text),
ChannelSummary -> Maybe (Sensitive Text)
metadata :: Prelude.Maybe (Core.Sensitive Prelude.Text)
}
deriving (ChannelSummary -> ChannelSummary -> Bool
(ChannelSummary -> ChannelSummary -> Bool)
-> (ChannelSummary -> ChannelSummary -> Bool) -> Eq ChannelSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelSummary -> ChannelSummary -> Bool
$c/= :: ChannelSummary -> ChannelSummary -> Bool
== :: ChannelSummary -> ChannelSummary -> Bool
$c== :: ChannelSummary -> ChannelSummary -> Bool
Prelude.Eq, Int -> ChannelSummary -> ShowS
[ChannelSummary] -> ShowS
ChannelSummary -> String
(Int -> ChannelSummary -> ShowS)
-> (ChannelSummary -> String)
-> ([ChannelSummary] -> ShowS)
-> Show ChannelSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelSummary] -> ShowS
$cshowList :: [ChannelSummary] -> ShowS
show :: ChannelSummary -> String
$cshow :: ChannelSummary -> String
showsPrec :: Int -> ChannelSummary -> ShowS
$cshowsPrec :: Int -> ChannelSummary -> ShowS
Prelude.Show, (forall x. ChannelSummary -> Rep ChannelSummary x)
-> (forall x. Rep ChannelSummary x -> ChannelSummary)
-> Generic ChannelSummary
forall x. Rep ChannelSummary x -> ChannelSummary
forall x. ChannelSummary -> Rep ChannelSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelSummary x -> ChannelSummary
$cfrom :: forall x. ChannelSummary -> Rep ChannelSummary x
Prelude.Generic)
newChannelSummary ::
ChannelSummary
newChannelSummary :: ChannelSummary
newChannelSummary =
ChannelSummary' :: Maybe ChannelMode
-> Maybe Text
-> Maybe ChannelPrivacy
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> ChannelSummary
ChannelSummary'
{ $sel:mode:ChannelSummary' :: Maybe ChannelMode
mode = Maybe ChannelMode
forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:ChannelSummary' :: Maybe Text
channelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:privacy:ChannelSummary' :: Maybe ChannelPrivacy
privacy = Maybe ChannelPrivacy
forall a. Maybe a
Prelude.Nothing,
$sel:lastMessageTimestamp:ChannelSummary' :: Maybe POSIX
lastMessageTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:name:ChannelSummary' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:metadata:ChannelSummary' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing
}
channelSummary_mode :: Lens.Lens' ChannelSummary (Prelude.Maybe ChannelMode)
channelSummary_mode :: (Maybe ChannelMode -> f (Maybe ChannelMode))
-> ChannelSummary -> f ChannelSummary
channelSummary_mode = (ChannelSummary -> Maybe ChannelMode)
-> (ChannelSummary -> Maybe ChannelMode -> ChannelSummary)
-> Lens
ChannelSummary
ChannelSummary
(Maybe ChannelMode)
(Maybe ChannelMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSummary' {Maybe ChannelMode
mode :: Maybe ChannelMode
$sel:mode:ChannelSummary' :: ChannelSummary -> Maybe ChannelMode
mode} -> Maybe ChannelMode
mode) (\s :: ChannelSummary
s@ChannelSummary' {} Maybe ChannelMode
a -> ChannelSummary
s {$sel:mode:ChannelSummary' :: Maybe ChannelMode
mode = Maybe ChannelMode
a} :: ChannelSummary)
channelSummary_channelArn :: Lens.Lens' ChannelSummary (Prelude.Maybe Prelude.Text)
channelSummary_channelArn :: (Maybe Text -> f (Maybe Text))
-> ChannelSummary -> f ChannelSummary
channelSummary_channelArn = (ChannelSummary -> Maybe Text)
-> (ChannelSummary -> Maybe Text -> ChannelSummary)
-> Lens ChannelSummary ChannelSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSummary' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:ChannelSummary' :: ChannelSummary -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: ChannelSummary
s@ChannelSummary' {} Maybe Text
a -> ChannelSummary
s {$sel:channelArn:ChannelSummary' :: Maybe Text
channelArn = Maybe Text
a} :: ChannelSummary)
channelSummary_privacy :: Lens.Lens' ChannelSummary (Prelude.Maybe ChannelPrivacy)
channelSummary_privacy :: (Maybe ChannelPrivacy -> f (Maybe ChannelPrivacy))
-> ChannelSummary -> f ChannelSummary
channelSummary_privacy = (ChannelSummary -> Maybe ChannelPrivacy)
-> (ChannelSummary -> Maybe ChannelPrivacy -> ChannelSummary)
-> Lens
ChannelSummary
ChannelSummary
(Maybe ChannelPrivacy)
(Maybe ChannelPrivacy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSummary' {Maybe ChannelPrivacy
privacy :: Maybe ChannelPrivacy
$sel:privacy:ChannelSummary' :: ChannelSummary -> Maybe ChannelPrivacy
privacy} -> Maybe ChannelPrivacy
privacy) (\s :: ChannelSummary
s@ChannelSummary' {} Maybe ChannelPrivacy
a -> ChannelSummary
s {$sel:privacy:ChannelSummary' :: Maybe ChannelPrivacy
privacy = Maybe ChannelPrivacy
a} :: ChannelSummary)
channelSummary_lastMessageTimestamp :: Lens.Lens' ChannelSummary (Prelude.Maybe Prelude.UTCTime)
channelSummary_lastMessageTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ChannelSummary -> f ChannelSummary
channelSummary_lastMessageTimestamp = (ChannelSummary -> Maybe POSIX)
-> (ChannelSummary -> Maybe POSIX -> ChannelSummary)
-> Lens ChannelSummary ChannelSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSummary' {Maybe POSIX
lastMessageTimestamp :: Maybe POSIX
$sel:lastMessageTimestamp:ChannelSummary' :: ChannelSummary -> Maybe POSIX
lastMessageTimestamp} -> Maybe POSIX
lastMessageTimestamp) (\s :: ChannelSummary
s@ChannelSummary' {} Maybe POSIX
a -> ChannelSummary
s {$sel:lastMessageTimestamp:ChannelSummary' :: Maybe POSIX
lastMessageTimestamp = Maybe POSIX
a} :: ChannelSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> ChannelSummary -> f ChannelSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ChannelSummary
-> f ChannelSummary
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
channelSummary_name :: Lens.Lens' ChannelSummary (Prelude.Maybe Prelude.Text)
channelSummary_name :: (Maybe Text -> f (Maybe Text))
-> ChannelSummary -> f ChannelSummary
channelSummary_name = (ChannelSummary -> Maybe (Sensitive Text))
-> (ChannelSummary -> Maybe (Sensitive Text) -> ChannelSummary)
-> Lens
ChannelSummary
ChannelSummary
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSummary' {Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
$sel:name:ChannelSummary' :: ChannelSummary -> Maybe (Sensitive Text)
name} -> Maybe (Sensitive Text)
name) (\s :: ChannelSummary
s@ChannelSummary' {} Maybe (Sensitive Text)
a -> ChannelSummary
s {$sel:name:ChannelSummary' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
a} :: ChannelSummary) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> ChannelSummary -> f ChannelSummary)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ChannelSummary
-> f ChannelSummary
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
channelSummary_metadata :: Lens.Lens' ChannelSummary (Prelude.Maybe Prelude.Text)
channelSummary_metadata :: (Maybe Text -> f (Maybe Text))
-> ChannelSummary -> f ChannelSummary
channelSummary_metadata = (ChannelSummary -> Maybe (Sensitive Text))
-> (ChannelSummary -> Maybe (Sensitive Text) -> ChannelSummary)
-> Lens
ChannelSummary
ChannelSummary
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSummary' {Maybe (Sensitive Text)
metadata :: Maybe (Sensitive Text)
$sel:metadata:ChannelSummary' :: ChannelSummary -> Maybe (Sensitive Text)
metadata} -> Maybe (Sensitive Text)
metadata) (\s :: ChannelSummary
s@ChannelSummary' {} Maybe (Sensitive Text)
a -> ChannelSummary
s {$sel:metadata:ChannelSummary' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
a} :: ChannelSummary) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> ChannelSummary -> f ChannelSummary)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ChannelSummary
-> f ChannelSummary
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 ChannelSummary where
parseJSON :: Value -> Parser ChannelSummary
parseJSON =
String
-> (Object -> Parser ChannelSummary)
-> Value
-> Parser ChannelSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ChannelSummary"
( \Object
x ->
Maybe ChannelMode
-> Maybe Text
-> Maybe ChannelPrivacy
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> ChannelSummary
ChannelSummary'
(Maybe ChannelMode
-> Maybe Text
-> Maybe ChannelPrivacy
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> ChannelSummary)
-> Parser (Maybe ChannelMode)
-> Parser
(Maybe Text
-> Maybe ChannelPrivacy
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> ChannelSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ChannelMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Mode")
Parser
(Maybe Text
-> Maybe ChannelPrivacy
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> ChannelSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe ChannelPrivacy
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> ChannelSummary)
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 ChannelPrivacy
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> ChannelSummary)
-> Parser (Maybe ChannelPrivacy)
-> Parser
(Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> ChannelSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ChannelPrivacy)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Privacy")
Parser
(Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> ChannelSummary)
-> Parser (Maybe POSIX)
-> Parser
(Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> ChannelSummary)
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
"LastMessageTimestamp")
Parser
(Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> ChannelSummary)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe (Sensitive Text) -> ChannelSummary)
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
"Name")
Parser (Maybe (Sensitive Text) -> ChannelSummary)
-> Parser (Maybe (Sensitive Text)) -> Parser ChannelSummary
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
"Metadata")
)
instance Prelude.Hashable ChannelSummary
instance Prelude.NFData ChannelSummary