{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Chime.Types.Channel
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Chime.Types.Channel where

import Amazonka.Chime.Types.ChannelMode
import Amazonka.Chime.Types.ChannelPrivacy
import Amazonka.Chime.Types.Identity
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The details of a channel.
--
-- /See:/ 'newChannel' smart constructor.
data Channel = Channel'
  { -- | The mode of the channel.
    Channel -> Maybe ChannelMode
mode :: Prelude.Maybe ChannelMode,
    -- | The @AppInstanceUser@ who created the channel.
    Channel -> Maybe Identity
createdBy :: Prelude.Maybe Identity,
    -- | The ARN of the channel.
    Channel -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
    -- | The channel\'s privacy setting.
    Channel -> Maybe ChannelPrivacy
privacy :: Prelude.Maybe ChannelPrivacy,
    -- | The time at which a member sent the last message in the channel.
    Channel -> Maybe POSIX
lastMessageTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The name of the channel.
    Channel -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The channel\'s metadata.
    Channel -> Maybe (Sensitive Text)
metadata :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The time at which the @AppInstanceUser@ created the channel.
    Channel -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The time at which a channel was last updated.
    Channel -> Maybe POSIX
lastUpdatedTimestamp :: Prelude.Maybe Core.POSIX
  }
  deriving (Channel -> Channel -> Bool
(Channel -> Channel -> Bool)
-> (Channel -> Channel -> Bool) -> Eq Channel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Channel -> Channel -> Bool
$c/= :: Channel -> Channel -> Bool
== :: Channel -> Channel -> Bool
$c== :: Channel -> Channel -> Bool
Prelude.Eq, Int -> Channel -> ShowS
[Channel] -> ShowS
Channel -> String
(Int -> Channel -> ShowS)
-> (Channel -> String) -> ([Channel] -> ShowS) -> Show Channel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Channel] -> ShowS
$cshowList :: [Channel] -> ShowS
show :: Channel -> String
$cshow :: Channel -> String
showsPrec :: Int -> Channel -> ShowS
$cshowsPrec :: Int -> Channel -> ShowS
Prelude.Show, (forall x. Channel -> Rep Channel x)
-> (forall x. Rep Channel x -> Channel) -> Generic Channel
forall x. Rep Channel x -> Channel
forall x. Channel -> Rep Channel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Channel x -> Channel
$cfrom :: forall x. Channel -> Rep Channel x
Prelude.Generic)

-- |
-- Create a value of 'Channel' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'mode', 'channel_mode' - The mode of the channel.
--
-- 'createdBy', 'channel_createdBy' - The @AppInstanceUser@ who created the channel.
--
-- 'channelArn', 'channel_channelArn' - The ARN of the channel.
--
-- 'privacy', 'channel_privacy' - The channel\'s privacy setting.
--
-- 'lastMessageTimestamp', 'channel_lastMessageTimestamp' - The time at which a member sent the last message in the channel.
--
-- 'name', 'channel_name' - The name of the channel.
--
-- 'metadata', 'channel_metadata' - The channel\'s metadata.
--
-- 'createdTimestamp', 'channel_createdTimestamp' - The time at which the @AppInstanceUser@ created the channel.
--
-- 'lastUpdatedTimestamp', 'channel_lastUpdatedTimestamp' - The time at which a channel was last updated.
newChannel ::
  Channel
newChannel :: Channel
newChannel =
  Channel' :: Maybe ChannelMode
-> Maybe Identity
-> Maybe Text
-> Maybe ChannelPrivacy
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe POSIX
-> Maybe POSIX
-> Channel
Channel'
    { $sel:mode:Channel' :: Maybe ChannelMode
mode = Maybe ChannelMode
forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:Channel' :: Maybe Identity
createdBy = Maybe Identity
forall a. Maybe a
Prelude.Nothing,
      $sel:channelArn:Channel' :: Maybe Text
channelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:privacy:Channel' :: Maybe ChannelPrivacy
privacy = Maybe ChannelPrivacy
forall a. Maybe a
Prelude.Nothing,
      $sel:lastMessageTimestamp:Channel' :: Maybe POSIX
lastMessageTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Channel' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:metadata:Channel' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTimestamp:Channel' :: Maybe POSIX
createdTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTimestamp:Channel' :: Maybe POSIX
lastUpdatedTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | The mode of the channel.
channel_mode :: Lens.Lens' Channel (Prelude.Maybe ChannelMode)
channel_mode :: (Maybe ChannelMode -> f (Maybe ChannelMode))
-> Channel -> f Channel
channel_mode = (Channel -> Maybe ChannelMode)
-> (Channel -> Maybe ChannelMode -> Channel)
-> Lens Channel Channel (Maybe ChannelMode) (Maybe ChannelMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe ChannelMode
mode :: Maybe ChannelMode
$sel:mode:Channel' :: Channel -> Maybe ChannelMode
mode} -> Maybe ChannelMode
mode) (\s :: Channel
s@Channel' {} Maybe ChannelMode
a -> Channel
s {$sel:mode:Channel' :: Maybe ChannelMode
mode = Maybe ChannelMode
a} :: Channel)

-- | The @AppInstanceUser@ who created the channel.
channel_createdBy :: Lens.Lens' Channel (Prelude.Maybe Identity)
channel_createdBy :: (Maybe Identity -> f (Maybe Identity)) -> Channel -> f Channel
channel_createdBy = (Channel -> Maybe Identity)
-> (Channel -> Maybe Identity -> Channel)
-> Lens Channel Channel (Maybe Identity) (Maybe Identity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe Identity
createdBy :: Maybe Identity
$sel:createdBy:Channel' :: Channel -> Maybe Identity
createdBy} -> Maybe Identity
createdBy) (\s :: Channel
s@Channel' {} Maybe Identity
a -> Channel
s {$sel:createdBy:Channel' :: Maybe Identity
createdBy = Maybe Identity
a} :: Channel)

-- | The ARN of the channel.
channel_channelArn :: Lens.Lens' Channel (Prelude.Maybe Prelude.Text)
channel_channelArn :: (Maybe Text -> f (Maybe Text)) -> Channel -> f Channel
channel_channelArn = (Channel -> Maybe Text)
-> (Channel -> Maybe Text -> Channel)
-> Lens Channel Channel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:Channel' :: Channel -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: Channel
s@Channel' {} Maybe Text
a -> Channel
s {$sel:channelArn:Channel' :: Maybe Text
channelArn = Maybe Text
a} :: Channel)

-- | The channel\'s privacy setting.
channel_privacy :: Lens.Lens' Channel (Prelude.Maybe ChannelPrivacy)
channel_privacy :: (Maybe ChannelPrivacy -> f (Maybe ChannelPrivacy))
-> Channel -> f Channel
channel_privacy = (Channel -> Maybe ChannelPrivacy)
-> (Channel -> Maybe ChannelPrivacy -> Channel)
-> Lens
     Channel Channel (Maybe ChannelPrivacy) (Maybe ChannelPrivacy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe ChannelPrivacy
privacy :: Maybe ChannelPrivacy
$sel:privacy:Channel' :: Channel -> Maybe ChannelPrivacy
privacy} -> Maybe ChannelPrivacy
privacy) (\s :: Channel
s@Channel' {} Maybe ChannelPrivacy
a -> Channel
s {$sel:privacy:Channel' :: Maybe ChannelPrivacy
privacy = Maybe ChannelPrivacy
a} :: Channel)

-- | The time at which a member sent the last message in the channel.
channel_lastMessageTimestamp :: Lens.Lens' Channel (Prelude.Maybe Prelude.UTCTime)
channel_lastMessageTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Channel -> f Channel
channel_lastMessageTimestamp = (Channel -> Maybe POSIX)
-> (Channel -> Maybe POSIX -> Channel)
-> Lens Channel Channel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe POSIX
lastMessageTimestamp :: Maybe POSIX
$sel:lastMessageTimestamp:Channel' :: Channel -> Maybe POSIX
lastMessageTimestamp} -> Maybe POSIX
lastMessageTimestamp) (\s :: Channel
s@Channel' {} Maybe POSIX
a -> Channel
s {$sel:lastMessageTimestamp:Channel' :: Maybe POSIX
lastMessageTimestamp = Maybe POSIX
a} :: Channel) ((Maybe POSIX -> f (Maybe POSIX)) -> Channel -> f Channel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Channel
-> f Channel
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

-- | The name of the channel.
channel_name :: Lens.Lens' Channel (Prelude.Maybe Prelude.Text)
channel_name :: (Maybe Text -> f (Maybe Text)) -> Channel -> f Channel
channel_name = (Channel -> Maybe (Sensitive Text))
-> (Channel -> Maybe (Sensitive Text) -> Channel)
-> Lens
     Channel Channel (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
$sel:name:Channel' :: Channel -> Maybe (Sensitive Text)
name} -> Maybe (Sensitive Text)
name) (\s :: Channel
s@Channel' {} Maybe (Sensitive Text)
a -> Channel
s {$sel:name:Channel' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
a} :: Channel) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> Channel -> f Channel)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Channel
-> f Channel
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

-- | The channel\'s metadata.
channel_metadata :: Lens.Lens' Channel (Prelude.Maybe Prelude.Text)
channel_metadata :: (Maybe Text -> f (Maybe Text)) -> Channel -> f Channel
channel_metadata = (Channel -> Maybe (Sensitive Text))
-> (Channel -> Maybe (Sensitive Text) -> Channel)
-> Lens
     Channel Channel (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe (Sensitive Text)
metadata :: Maybe (Sensitive Text)
$sel:metadata:Channel' :: Channel -> Maybe (Sensitive Text)
metadata} -> Maybe (Sensitive Text)
metadata) (\s :: Channel
s@Channel' {} Maybe (Sensitive Text)
a -> Channel
s {$sel:metadata:Channel' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
a} :: Channel) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> Channel -> f Channel)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Channel
-> f Channel
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

-- | The time at which the @AppInstanceUser@ created the channel.
channel_createdTimestamp :: Lens.Lens' Channel (Prelude.Maybe Prelude.UTCTime)
channel_createdTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Channel -> f Channel
channel_createdTimestamp = (Channel -> Maybe POSIX)
-> (Channel -> Maybe POSIX -> Channel)
-> Lens Channel Channel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:Channel' :: Channel -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: Channel
s@Channel' {} Maybe POSIX
a -> Channel
s {$sel:createdTimestamp:Channel' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: Channel) ((Maybe POSIX -> f (Maybe POSIX)) -> Channel -> f Channel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Channel
-> f Channel
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

-- | The time at which a channel was last updated.
channel_lastUpdatedTimestamp :: Lens.Lens' Channel (Prelude.Maybe Prelude.UTCTime)
channel_lastUpdatedTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Channel -> f Channel
channel_lastUpdatedTimestamp = (Channel -> Maybe POSIX)
-> (Channel -> Maybe POSIX -> Channel)
-> Lens Channel Channel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe POSIX
lastUpdatedTimestamp :: Maybe POSIX
$sel:lastUpdatedTimestamp:Channel' :: Channel -> Maybe POSIX
lastUpdatedTimestamp} -> Maybe POSIX
lastUpdatedTimestamp) (\s :: Channel
s@Channel' {} Maybe POSIX
a -> Channel
s {$sel:lastUpdatedTimestamp:Channel' :: Maybe POSIX
lastUpdatedTimestamp = Maybe POSIX
a} :: Channel) ((Maybe POSIX -> f (Maybe POSIX)) -> Channel -> f Channel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Channel
-> f Channel
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 Channel where
  parseJSON :: Value -> Parser Channel
parseJSON =
    String -> (Object -> Parser Channel) -> Value -> Parser Channel
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Channel"
      ( \Object
x ->
          Maybe ChannelMode
-> Maybe Identity
-> Maybe Text
-> Maybe ChannelPrivacy
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe POSIX
-> Maybe POSIX
-> Channel
Channel'
            (Maybe ChannelMode
 -> Maybe Identity
 -> Maybe Text
 -> Maybe ChannelPrivacy
 -> Maybe POSIX
 -> Maybe (Sensitive Text)
 -> Maybe (Sensitive Text)
 -> Maybe POSIX
 -> Maybe POSIX
 -> Channel)
-> Parser (Maybe ChannelMode)
-> Parser
     (Maybe Identity
      -> Maybe Text
      -> Maybe ChannelPrivacy
      -> Maybe POSIX
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe POSIX
      -> Maybe POSIX
      -> Channel)
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 Identity
   -> Maybe Text
   -> Maybe ChannelPrivacy
   -> Maybe POSIX
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe POSIX
   -> Maybe POSIX
   -> Channel)
-> Parser (Maybe Identity)
-> Parser
     (Maybe Text
      -> Maybe ChannelPrivacy
      -> Maybe POSIX
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe POSIX
      -> Maybe POSIX
      -> Channel)
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
"CreatedBy")
            Parser
  (Maybe Text
   -> Maybe ChannelPrivacy
   -> Maybe POSIX
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe POSIX
   -> Maybe POSIX
   -> Channel)
-> Parser (Maybe Text)
-> Parser
     (Maybe ChannelPrivacy
      -> Maybe POSIX
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe POSIX
      -> Maybe POSIX
      -> Channel)
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)
   -> Maybe POSIX
   -> Maybe POSIX
   -> Channel)
-> Parser (Maybe ChannelPrivacy)
-> Parser
     (Maybe POSIX
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe POSIX
      -> Maybe POSIX
      -> Channel)
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)
   -> Maybe POSIX
   -> Maybe POSIX
   -> Channel)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe (Sensitive Text) -> Maybe POSIX -> Maybe POSIX -> Channel)
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) -> Maybe POSIX -> Maybe POSIX -> Channel)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe (Sensitive Text) -> Maybe POSIX -> Maybe POSIX -> Channel)
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) -> Maybe POSIX -> Maybe POSIX -> Channel)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe POSIX -> Maybe POSIX -> Channel)
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")
            Parser (Maybe POSIX -> Maybe POSIX -> Channel)
-> Parser (Maybe POSIX) -> Parser (Maybe POSIX -> Channel)
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 POSIX -> Channel)
-> Parser (Maybe POSIX) -> Parser Channel
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
"LastUpdatedTimestamp")
      )

instance Prelude.Hashable Channel

instance Prelude.NFData Channel