{-# 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.ChannelMembershipSummary
-- 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.ChannelMembershipSummary 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 @ChannelMembership@.
--
-- /See:/ 'newChannelMembershipSummary' smart constructor.
data ChannelMembershipSummary = ChannelMembershipSummary'
  { -- | A member\'s summary data.
    ChannelMembershipSummary -> Maybe Identity
member :: Prelude.Maybe Identity
  }
  deriving (ChannelMembershipSummary -> ChannelMembershipSummary -> Bool
(ChannelMembershipSummary -> ChannelMembershipSummary -> Bool)
-> (ChannelMembershipSummary -> ChannelMembershipSummary -> Bool)
-> Eq ChannelMembershipSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelMembershipSummary -> ChannelMembershipSummary -> Bool
$c/= :: ChannelMembershipSummary -> ChannelMembershipSummary -> Bool
== :: ChannelMembershipSummary -> ChannelMembershipSummary -> Bool
$c== :: ChannelMembershipSummary -> ChannelMembershipSummary -> Bool
Prelude.Eq, Int -> ChannelMembershipSummary -> ShowS
[ChannelMembershipSummary] -> ShowS
ChannelMembershipSummary -> String
(Int -> ChannelMembershipSummary -> ShowS)
-> (ChannelMembershipSummary -> String)
-> ([ChannelMembershipSummary] -> ShowS)
-> Show ChannelMembershipSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelMembershipSummary] -> ShowS
$cshowList :: [ChannelMembershipSummary] -> ShowS
show :: ChannelMembershipSummary -> String
$cshow :: ChannelMembershipSummary -> String
showsPrec :: Int -> ChannelMembershipSummary -> ShowS
$cshowsPrec :: Int -> ChannelMembershipSummary -> ShowS
Prelude.Show, (forall x.
 ChannelMembershipSummary -> Rep ChannelMembershipSummary x)
-> (forall x.
    Rep ChannelMembershipSummary x -> ChannelMembershipSummary)
-> Generic ChannelMembershipSummary
forall x.
Rep ChannelMembershipSummary x -> ChannelMembershipSummary
forall x.
ChannelMembershipSummary -> Rep ChannelMembershipSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ChannelMembershipSummary x -> ChannelMembershipSummary
$cfrom :: forall x.
ChannelMembershipSummary -> Rep ChannelMembershipSummary x
Prelude.Generic)

-- |
-- Create a value of 'ChannelMembershipSummary' 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', 'channelMembershipSummary_member' - A member\'s summary data.
newChannelMembershipSummary ::
  ChannelMembershipSummary
newChannelMembershipSummary :: ChannelMembershipSummary
newChannelMembershipSummary =
  ChannelMembershipSummary' :: Maybe Identity -> ChannelMembershipSummary
ChannelMembershipSummary' {$sel:member:ChannelMembershipSummary' :: Maybe Identity
member = Maybe Identity
forall a. Maybe a
Prelude.Nothing}

-- | A member\'s summary data.
channelMembershipSummary_member :: Lens.Lens' ChannelMembershipSummary (Prelude.Maybe Identity)
channelMembershipSummary_member :: (Maybe Identity -> f (Maybe Identity))
-> ChannelMembershipSummary -> f ChannelMembershipSummary
channelMembershipSummary_member = (ChannelMembershipSummary -> Maybe Identity)
-> (ChannelMembershipSummary
    -> Maybe Identity -> ChannelMembershipSummary)
-> Lens
     ChannelMembershipSummary
     ChannelMembershipSummary
     (Maybe Identity)
     (Maybe Identity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelMembershipSummary' {Maybe Identity
member :: Maybe Identity
$sel:member:ChannelMembershipSummary' :: ChannelMembershipSummary -> Maybe Identity
member} -> Maybe Identity
member) (\s :: ChannelMembershipSummary
s@ChannelMembershipSummary' {} Maybe Identity
a -> ChannelMembershipSummary
s {$sel:member:ChannelMembershipSummary' :: Maybe Identity
member = Maybe Identity
a} :: ChannelMembershipSummary)

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

instance Prelude.NFData ChannelMembershipSummary