{-# 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.ChannelBanSummary
-- 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.ChannelBanSummary 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 @ChannelBan@.
--
-- /See:/ 'newChannelBanSummary' smart constructor.
data ChannelBanSummary = ChannelBanSummary'
  { -- | The member being banned from a channel.
    ChannelBanSummary -> Maybe Identity
member :: Prelude.Maybe Identity
  }
  deriving (ChannelBanSummary -> ChannelBanSummary -> Bool
(ChannelBanSummary -> ChannelBanSummary -> Bool)
-> (ChannelBanSummary -> ChannelBanSummary -> Bool)
-> Eq ChannelBanSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelBanSummary -> ChannelBanSummary -> Bool
$c/= :: ChannelBanSummary -> ChannelBanSummary -> Bool
== :: ChannelBanSummary -> ChannelBanSummary -> Bool
$c== :: ChannelBanSummary -> ChannelBanSummary -> Bool
Prelude.Eq, Int -> ChannelBanSummary -> ShowS
[ChannelBanSummary] -> ShowS
ChannelBanSummary -> String
(Int -> ChannelBanSummary -> ShowS)
-> (ChannelBanSummary -> String)
-> ([ChannelBanSummary] -> ShowS)
-> Show ChannelBanSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelBanSummary] -> ShowS
$cshowList :: [ChannelBanSummary] -> ShowS
show :: ChannelBanSummary -> String
$cshow :: ChannelBanSummary -> String
showsPrec :: Int -> ChannelBanSummary -> ShowS
$cshowsPrec :: Int -> ChannelBanSummary -> ShowS
Prelude.Show, (forall x. ChannelBanSummary -> Rep ChannelBanSummary x)
-> (forall x. Rep ChannelBanSummary x -> ChannelBanSummary)
-> Generic ChannelBanSummary
forall x. Rep ChannelBanSummary x -> ChannelBanSummary
forall x. ChannelBanSummary -> Rep ChannelBanSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelBanSummary x -> ChannelBanSummary
$cfrom :: forall x. ChannelBanSummary -> Rep ChannelBanSummary x
Prelude.Generic)

-- |
-- Create a value of 'ChannelBanSummary' 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:
--
-- 'member', 'channelBanSummary_member' - The member being banned from a channel.
newChannelBanSummary ::
  ChannelBanSummary
newChannelBanSummary :: ChannelBanSummary
newChannelBanSummary =
  ChannelBanSummary' :: Maybe Identity -> ChannelBanSummary
ChannelBanSummary' {$sel:member:ChannelBanSummary' :: Maybe Identity
member = Maybe Identity
forall a. Maybe a
Prelude.Nothing}

-- | The member being banned from a channel.
channelBanSummary_member :: Lens.Lens' ChannelBanSummary (Prelude.Maybe Identity)
channelBanSummary_member :: (Maybe Identity -> f (Maybe Identity))
-> ChannelBanSummary -> f ChannelBanSummary
channelBanSummary_member = (ChannelBanSummary -> Maybe Identity)
-> (ChannelBanSummary -> Maybe Identity -> ChannelBanSummary)
-> Lens
     ChannelBanSummary
     ChannelBanSummary
     (Maybe Identity)
     (Maybe Identity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelBanSummary' {Maybe Identity
member :: Maybe Identity
$sel:member:ChannelBanSummary' :: ChannelBanSummary -> Maybe Identity
member} -> Maybe Identity
member) (\s :: ChannelBanSummary
s@ChannelBanSummary' {} Maybe Identity
a -> ChannelBanSummary
s {$sel:member:ChannelBanSummary' :: Maybe Identity
member = Maybe Identity
a} :: ChannelBanSummary)

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

instance Prelude.Hashable ChannelBanSummary

instance Prelude.NFData ChannelBanSummary