{-# 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.ChannelModeratorSummary
-- 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.ChannelModeratorSummary where

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

-- | Summary of the details of a @ChannelModerator@.
--
-- /See:/ 'newChannelModeratorSummary' smart constructor.
data ChannelModeratorSummary = ChannelModeratorSummary'
  { -- | The data for a moderator.
    ChannelModeratorSummary -> Maybe Identity
moderator :: Prelude.Maybe Identity
  }
  deriving (ChannelModeratorSummary -> ChannelModeratorSummary -> Bool
(ChannelModeratorSummary -> ChannelModeratorSummary -> Bool)
-> (ChannelModeratorSummary -> ChannelModeratorSummary -> Bool)
-> Eq ChannelModeratorSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelModeratorSummary -> ChannelModeratorSummary -> Bool
$c/= :: ChannelModeratorSummary -> ChannelModeratorSummary -> Bool
== :: ChannelModeratorSummary -> ChannelModeratorSummary -> Bool
$c== :: ChannelModeratorSummary -> ChannelModeratorSummary -> Bool
Prelude.Eq, Int -> ChannelModeratorSummary -> ShowS
[ChannelModeratorSummary] -> ShowS
ChannelModeratorSummary -> String
(Int -> ChannelModeratorSummary -> ShowS)
-> (ChannelModeratorSummary -> String)
-> ([ChannelModeratorSummary] -> ShowS)
-> Show ChannelModeratorSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelModeratorSummary] -> ShowS
$cshowList :: [ChannelModeratorSummary] -> ShowS
show :: ChannelModeratorSummary -> String
$cshow :: ChannelModeratorSummary -> String
showsPrec :: Int -> ChannelModeratorSummary -> ShowS
$cshowsPrec :: Int -> ChannelModeratorSummary -> ShowS
Prelude.Show, (forall x.
 ChannelModeratorSummary -> Rep ChannelModeratorSummary x)
-> (forall x.
    Rep ChannelModeratorSummary x -> ChannelModeratorSummary)
-> Generic ChannelModeratorSummary
forall x. Rep ChannelModeratorSummary x -> ChannelModeratorSummary
forall x. ChannelModeratorSummary -> Rep ChannelModeratorSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelModeratorSummary x -> ChannelModeratorSummary
$cfrom :: forall x. ChannelModeratorSummary -> Rep ChannelModeratorSummary x
Prelude.Generic)

-- |
-- Create a value of 'ChannelModeratorSummary' 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:
--
-- 'moderator', 'channelModeratorSummary_moderator' - The data for a moderator.
newChannelModeratorSummary ::
  ChannelModeratorSummary
newChannelModeratorSummary :: ChannelModeratorSummary
newChannelModeratorSummary =
  ChannelModeratorSummary' :: Maybe Identity -> ChannelModeratorSummary
ChannelModeratorSummary'
    { $sel:moderator:ChannelModeratorSummary' :: Maybe Identity
moderator =
        Maybe Identity
forall a. Maybe a
Prelude.Nothing
    }

-- | The data for a moderator.
channelModeratorSummary_moderator :: Lens.Lens' ChannelModeratorSummary (Prelude.Maybe Identity)
channelModeratorSummary_moderator :: (Maybe Identity -> f (Maybe Identity))
-> ChannelModeratorSummary -> f ChannelModeratorSummary
channelModeratorSummary_moderator = (ChannelModeratorSummary -> Maybe Identity)
-> (ChannelModeratorSummary
    -> Maybe Identity -> ChannelModeratorSummary)
-> Lens
     ChannelModeratorSummary
     ChannelModeratorSummary
     (Maybe Identity)
     (Maybe Identity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelModeratorSummary' {Maybe Identity
moderator :: Maybe Identity
$sel:moderator:ChannelModeratorSummary' :: ChannelModeratorSummary -> Maybe Identity
moderator} -> Maybe Identity
moderator) (\s :: ChannelModeratorSummary
s@ChannelModeratorSummary' {} Maybe Identity
a -> ChannelModeratorSummary
s {$sel:moderator:ChannelModeratorSummary' :: Maybe Identity
moderator = Maybe Identity
a} :: ChannelModeratorSummary)

instance Core.FromJSON ChannelModeratorSummary where
  parseJSON :: Value -> Parser ChannelModeratorSummary
parseJSON =
    String
-> (Object -> Parser ChannelModeratorSummary)
-> Value
-> Parser ChannelModeratorSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ChannelModeratorSummary"
      ( \Object
x ->
          Maybe Identity -> ChannelModeratorSummary
ChannelModeratorSummary'
            (Maybe Identity -> ChannelModeratorSummary)
-> Parser (Maybe Identity) -> Parser ChannelModeratorSummary
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
"Moderator")
      )

instance Prelude.Hashable ChannelModeratorSummary

instance Prelude.NFData ChannelModeratorSummary